Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80360 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53216 invoked from network); 11 Jan 2015 07:21:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jan 2015 07:21:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.53 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.215.53 mail-la0-f53.google.com Received: from [209.85.215.53] ([209.85.215.53:64146] helo=mail-la0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E3/50-48183-07422B45 for ; Sun, 11 Jan 2015 02:21:21 -0500 Received: by mail-la0-f53.google.com with SMTP id gm9so20463399lab.12 for ; Sat, 10 Jan 2015 23:21:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=3oRrLVzmLkC97vJhONv9/SN03YDkXarWLDClXffWhYQ=; b=GajvprrNSpwzQ3cpBD9lGFOSqSNhA6EwC/CE73tCvNOYWLnRE8jVe0b1f9dV9MH+gK lpYPAEubufuxeT4415+ipbHkXBODxYLyXHhtwiOFtTKaxkPCQbuXemAbTBBJTEcGOTGg Tzf76zIzc5XCLHyLGCBsbp4w48Z3M23uTbNSw/hGuSdIdi9BDPgWb5vOv4IKBoINj5rU Atmm70riFKu+665/LcyKT00yjxUSLekbBeMj0onRsiQCtP8YafJFSTDJlWsCghy++e2A AbkKzZTb1JW9xeDeFKf51bZLAsLGOcnyfr6YAtf9DkvWdWXygvfbEii3kE0mCarkDQDG CLaw== MIME-Version: 1.0 X-Received: by 10.112.150.194 with SMTP id uk2mr30532789lbb.84.1420960872059; Sat, 10 Jan 2015 23:21:12 -0800 (PST) Received: by 10.112.154.133 with HTTP; Sat, 10 Jan 2015 23:21:11 -0800 (PST) In-Reply-To: <004e01d02d6d$3e745180$bb5cf480$@tekwire.net> References: <001501d02ccc$574a6bf0$05df43d0$@tekwire.net> <000a01d02cf8$ab090130$011b0390$@tekwire.net> <003c01d02d58$731d0cc0$59572640$@tekwire.net> <004e01d02d6d$3e745180$bb5cf480$@tekwire.net> Date: Sat, 10 Jan 2015 23:21:11 -0800 Message-ID: To: =?UTF-8?Q?Fran=C3=A7ois_Laupretre?= Cc: Dmitry Stogov , Sara Golemon , Laruence , Derick Rethans , PHP internals , Benjamin Eberlei Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Extension Prepend Files From: pierre.php@gmail.com (Pierre Joye) On Sat, Jan 10, 2015 at 11:07 PM, Fran=C3=A7ois Laupretre wrote: > De : Pierre Joye [mailto:pierre.php@gmail.com] > >> Say we do support builtin scripts, an opcache will simply load them on m= init or on the first request and flag them as >> permanent. Yes, it means we need to change opcache but could be way easi= er than trying to hack the engine to support >> persistent Opcodes without ending with ... an opcache. > > OK. Agree. I just didn't understand how it was possible without any chang= e to the cache code. > > Personnally, if I implemented this, I would distribute a virtual file tre= e through a stream wrapper. The stream wrapper would be the same for all 'c= lient' extensions. The fact to emulate a file tree would allow PHP scripts = to reference each other using a path similar to what we do in packages : (d= irname(__FILE__).'/relative/path'). We just need the stream wrapper to emul= ate '.' and '..' and the whole range of relative paths is available. This w= ay, the script executes in an environment as familiar as possible. To avoid= conflicts, each extension would have a separate root dir, something like '= :///'. For a pure builtin script for an extension point of view, I am not in favour of allowing multiple files or add streams. The impact will be too big in comparison to in-memory, cache&check only once, scripts. Starting to redo phar for extension builtin scripts sound like an even bigger can of worms. > Off topic: I'd like to write a PHP7 RFC to extend the file system feature= s whose behavior remains different for plain files and for stream wrappers.= As most RFCs I write these days, this is an old subject but it was refused= for security reasons, as there was no way to distinguish a 'remote' stream= wrapper from a 'local' one. Now, the is_url flag allows to restrict danger= ous features, like include_path or globbing, to 'local' wrappers, and some = of these wrappers desperately need these features (primarily phar developer= s and me, actually :). If you find it crazy, please tell me before I write = something more elaborate. Good idea, and the stream APIs need a cleanup as well (see the other discussions about that too). One key point btw: portability. Adding non portable features add more pains than gains. --=20 Pierre @pierrejoye | http://www.libgd.org