Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80144 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83453 invoked from network); 4 Jan 2015 12:36:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Jan 2015 12:36:57 -0000 Authentication-Results: pb1.pair.com header.from=francois@tekwire.net; sender-id=softfail Authentication-Results: pb1.pair.com smtp.mail=francois@tekwire.net; spf=softfail; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain tekwire.net does not designate 212.27.42.2 as permitted sender) X-PHP-List-Original-Sender: francois@tekwire.net X-Host-Fingerprint: 212.27.42.2 smtp2-g21.free.fr Received: from [212.27.42.2] ([212.27.42.2:8056] helo=smtp2-g21.free.fr) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C0/60-15455-8E339A45 for ; Sun, 04 Jan 2015 07:36:57 -0500 Received: from moorea (unknown [82.240.16.115]) by smtp2-g21.free.fr (Postfix) with ESMTP id 6F9D04B01D8; Sun, 4 Jan 2015 13:35:07 +0100 (CET) Reply-To: To: "'Benjamin Eberlei'" , "'PHP Internals'" References: In-Reply-To: Date: Sun, 4 Jan 2015 13:36:52 +0100 Message-ID: <002d01d0281b$1e775730$5b660590$@tekwire.net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQKBrOMj1TuM8+kkOgWpn3PeY833k5tM1pvw Content-Language: fr X-Antivirus: avast! (VPS 150104-0, 04/01/2015), Outbound message X-Antivirus-Status: Clean Subject: RE: [PHP-DEV] [RFC] Extension Prepend Files From: francois@tekwire.net (=?UTF-8?Q?Fran=C3=A7ois_Laupretre?=) > De : Benjamin Eberlei [mailto:kontakt@beberlei.de] > I want to open discussion on my RFC to strengthen the ability of = extensions > to provide functionality to developers in both C **and** PHP code. >=20 > For this extensions can add PHP files to a list of "prepend files" = that are > part of every request execution exactly the same way the INI > auto_prepend_file functionality works: >=20 > https://wiki.php.net/rfc/extension_prepend_files >=20 > I propose implementation details in the RFC, but they are completely = up to > discussion. I am even sure there is probably a better way than what I > proposed, because I am not familiar with the code. Can you please develop the API changes in your RFC ? You're talking = about changes in zend_execute_scripts(), a new zend_execute_script() = function (but the name in the prototype is wrong), then = php_execute_scripts()... Where are the file handles coming from ? Does it mean that the files to = prepend will be kept open ? Do you register paths to prepend, or will the scripts be loaded in = memory during MINIT ? How will these files be cached by opcode caches (mandatory for such a = feature) ? And, finally, how can an extension determine where a given PHP script it = requires has been installed ? It makes sense in php.ini because it is = under control of the final user. But an extension is just a C library, = installed anywhere or bundled in the PHP executable. Would it compute = the script paths from PHP installation paths ? Actually, I don't see how it would work with PHP scripts which would = remain separate from the extension code. What I would imagine for such a = feature, would be PHP code embedded in the extension as a memory buffer, = registered during MINIT, and then executed at each RINIT. This would = probably require a stream wrapper because the opcode cache would require = paths for this code. We can also concatenate the scripts but we still = need a virtual path. The stream wrapper would just be simpler to = implement. Regards Fran=C3=A7ois