Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:100802 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65204 invoked from network); 30 Sep 2017 09:30:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 30 Sep 2017 09:30:30 -0000 Received: from [127.0.0.1] ([127.0.0.1:24821]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 07/94-34435-5346FC95 for ; Sat, 30 Sep 2017 05:30:30 -0400 Authentication-Results: pb1.pair.com smtp.mail=nyamsprod@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nyamsprod@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.178 as permitted sender) X-PHP-List-Original-Sender: nyamsprod@gmail.com X-Host-Fingerprint: 209.85.223.178 mail-io0-f178.google.com Received: from [209.85.223.178] ([209.85.223.178:52614] helo=mail-io0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 81/30-34435-53CEDC95 for ; Fri, 29 Sep 2017 02:46:14 -0400 Received: by mail-io0-f178.google.com with SMTP id i197so684256ioe.9 for ; Thu, 28 Sep 2017 23:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=Ofm6xTdqcyL25j80XYJPJn7ZQCLy55NPm+VhORaz0qE=; b=MvboVruxDPzwOVJsQRD7chOFkelA2az73GVGRCPavZuYPjhceWnYXd+Im3DmcS7Ei6 sRjECYsvFGOC0ekiXr79Ps+UajzeDKLj+nCPH915WHk4Emke7UnCr6XGoCelbRbp4HFl UqCi6cN2lOZguF9H5cOUxljHL8am27IDaCE+VPlXsWt/YL6RdoAAfMuCutCRqYIa5f0x MrsK6zIyntKNEiOlmtdxfm1EqQW3yrg/9VV7PCGFAkWDWj9oyoIyJl+hW6Ny2o0NOuEP n7fFVMw1j7lsZaDgb0Hm4B7I2H62rF53Q5vpmO+GZ+j95Wt3/2xN06Ki1K4OfkQYt/7e hQfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=Ofm6xTdqcyL25j80XYJPJn7ZQCLy55NPm+VhORaz0qE=; b=SCWwcOxQQxJvdF7lbD4dHoQ2LEw1ZSqzPhGQlttjf03lwGaLqN+9r7bEoB3Y5KJ/Dy v7UMJVDr6CTMydb/GUyF9yS0mnlHs/qgzVOf2cYizZGCmGntY8/3LsCh3iaV6kDRqbae yzTiBNYAnrYn1GDYjZfmi/NCZf+vg9EMiZRXXmAWnuXjwKASGpZEtJUXnoO/c72JVjDa NOWyetElw0Y2qAdIl50is/3UMKkf2ke9nKFPbVUZGBAzgocEUlKwAipPTtNizvhaPVkN wob6gCzHrIHmr8OUn4zPM025doIvxm4GXejR3gPLSfvdocFwXSGtSiW6XhRGs902YS+e gNug== X-Gm-Message-State: AHPjjUjmQbXwWOxljrn9gXLg4D9TjuffkET1FamyKUzQ7DqpV4NOJFWo QRImLhYc3/oQWT7sutkVlpvgEkfr7Qk6ajjJaZkpnA== X-Google-Smtp-Source: AOwi7QDx1uei9Xfgi4BX9Ip1NFxhSABKSY1iXe4gAeleH4xD5M5nKeC3KOIxS0EcoqnMVfYJXxEpt8Z/UoeOKOO8vmE= X-Received: by 10.107.97.5 with SMTP id v5mr11712759iob.68.1506667570964; Thu, 28 Sep 2017 23:46:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.85.198 with HTTP; Thu, 28 Sep 2017 23:46:10 -0700 (PDT) Date: Fri, 29 Sep 2017 08:46:10 +0200 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary="089e0825cefc5cb0a8055a4e616c" Subject: Making stream functions accepting SplFileObject as valid parameter From: nyamsprod@gmail.com (nyamsprod the funky webmaster) --089e0825cefc5cb0a8055a4e616c Content-Type: text/plain; charset="UTF-8" Hi internals, I've been following the resolution of this bug: https://bugs.php.net/bug.php?id=44392 and it seems that there is no safe way to expose the internal `SplFileObject` filepointer. So I was wondering if we could not do things differently and instead of trying to expose the internal file pointer make any `stream_*` function which accept a resource stream as parameter accept a `SplFileObject`. By doing so we could resolve a couple of issues I encountered while using this SPL object without adding any new method to the class we could: - get informations about the object seekable and open mode status using `stream_get_meta_data`. - append/prepend stream filters without using the `php://filter/` hack which has its own limitations. What do you think ? --089e0825cefc5cb0a8055a4e616c--