Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80231 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52229 invoked from network); 6 Jan 2015 11:39:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jan 2015 11:39:42 -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.216.178 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.216.178 mail-qc0-f178.google.com Received: from [209.85.216.178] ([209.85.216.178:52824] helo=mail-qc0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CF/B3-26786-D79CBA45 for ; Tue, 06 Jan 2015 06:39:41 -0500 Received: by mail-qc0-f178.google.com with SMTP id p6so669541qcv.37 for ; Tue, 06 Jan 2015 03:39:38 -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; bh=+G6ORIG9pVZ/4YqxHO0aWAXLUoCXVwn7AP+EL6lXxWQ=; b=EvFddE6gfdMzR2NShDA3fi3PJSrsaoCcG0WIUQ4dh79ZHGcEB+96J6EzEod5TNNX8U 7u45ghof7p3RNV0nQ28M3wy5M20J9NKrkqUlnaYTqQsEZXUK6rmH02Mi30MS0/zTsna7 hcpkz86drQqa/arEzHo5pUMUh2qhlpifoTBlT7lltS5b7yhQzT5HouicP7kt3QsLkSZ/ xQaF8q0Xhw7motKgymKG6MUNK8+fxfamoNB2MKcP04T+2z2cFDbJadV39/45uOPxzxje KmiJ2qBcOIGv//n1gD5B5+MTmyyuqlCGQSTF78+3xnfD6MIssJbTuN5Hs6CqN08pMhOO 7Ugg== MIME-Version: 1.0 X-Received: by 10.140.32.166 with SMTP id h35mr141572839qgh.22.1420544378290; Tue, 06 Jan 2015 03:39:38 -0800 (PST) Received: by 10.140.22.106 with HTTP; Tue, 6 Jan 2015 03:39:38 -0800 (PST) In-Reply-To: References: <54AAF98B.4020709@gmail.com> Date: Tue, 6 Jan 2015 03:39:38 -0800 Message-ID: To: Derick Rethans Cc: Stanislav Malyshev , Sara Golemon , Benjamin Eberlei , PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Extension Prepend Files From: pierre.php@gmail.com (Pierre Joye) On Tue, Jan 6, 2015 at 3:24 AM, Derick Rethans wrote: > On Mon, 5 Jan 2015, Stanislav Malyshev wrote: > >> > 2) Embedded text sections. It's possible to place the raw PHP code >> > into the compiled .so/.dylib/.dll file and fetch it out for >> > compilation at runtime. This enables easy bundling of the loaded >> >> I guess it is possible, but why - what's wrong with plain old files and >> phars? > > Deployment and installation. Right now, "pecl install extension" doesn't > really allow you to also install **and** load a PHP script on every > request. Such a PHP script could define extra classes, that are written > in PHP - because maintainting them as a C implementation would be way > more work. Having users install another set of PHP files for every > project is error prone, and frankly, bad for user experience. I can > definitely see the use case here, and it's probably something we'd want > to use for the new MongoDB driver. The more I read the replies here the more I think we have two issues two solves. That does not mean this proposal (how it will be done seems to be very open at this point) is a bad idea. 1. Current internals APIs are not good enough for easy to implement and maintain exposed classes (declaration, implementation, etc.) 2. We have no easy way to actually release and deploy adhoc scripts, used by a given extension For 1., as stated earlier, we really need to work on that. The sooner the better. For 2., it is one of the thing I can imagine implementing in pickle. Or even better add it a s part of the build scripts and macros. Either will work, even for binary install on windows f.e.. I would really like to define a clear location relative to the extension directory. This location will be used by this new feature, if implemented. I also think that it should be either part of the current prepend setting, by default and system only, or another setting. What I really consider as a bad practice is any kind of bundling scripts in the extensions, that will be a real pain to maintain and it opens some unknown can of worms. Distros may also prefer to have that script outside the extension, easier for cherry picks update when necessary (f.e. security fixes). Please take it as a brainstorming, thoughts?