Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80196 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 58852 invoked from network); 5 Jan 2015 18:33:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2015 18:33:03 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.217.177 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.217.177 mail-lb0-f177.google.com Received: from [209.85.217.177] ([209.85.217.177:63665] helo=mail-lb0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C2/C7-21693-ED8DAA45 for ; Mon, 05 Jan 2015 13:33:02 -0500 Received: by mail-lb0-f177.google.com with SMTP id b6so17446518lbj.8 for ; Mon, 05 Jan 2015 10:32:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=zxiI3oc4Qy77apzR315oDdoHPt4o99oWPtR00j/Qeio=; b=HE98AnxyK7csQmWA3oQ48/xkVhTYlJm/z8iw8na1jFwc3IZcKPFJD3Qsy8/VE/6/cX i6RHpK/1ZFMQhcpGOvp1nfUl2NWD33Cc0jc6I6F0Ft7sSR/qWT+yGKt+VFEGKE7KNZ+J gZfu1j+V3IjPh5ros0yMVd9EVKNi47PqHAc4pmQm61Dhk9PJG+jGbwl1HGa+E4pMJaLW o72/2TyBlP3O3saobzPMtH0zn95rkjfktq9Au0MdK/PyX6GJ2Nt+jzBSyiPFBFOlCx0n Dzcr/Vky33uegsJUZ0uY9YTvt3gM6y90vHQTUgi1cK7F36y+qIMWr1KFFQKHSHJbbguh lsjQ== X-Gm-Message-State: ALoCoQnPrehP/+KzOwy9Z4aP388/Zrm46GVl+IsXX64dUMRjbS5L5jKMu7A8mnhrwxk9ZkJVBGgU MIME-Version: 1.0 X-Received: by 10.112.163.33 with SMTP id yf1mr33224470lbb.56.1420482779361; Mon, 05 Jan 2015 10:32:59 -0800 (PST) Sender: php@golemon.com Received: by 10.112.171.97 with HTTP; Mon, 5 Jan 2015 10:32:59 -0800 (PST) X-Originating-IP: [2620:10d:c082:1003:22c9:d0ff:fe87:295b] In-Reply-To: References: Date: Mon, 5 Jan 2015 10:32:59 -0800 X-Google-Sender-Auth: l6iHbu2HNhznSnoynsw79xuZzcE Message-ID: To: Benjamin Eberlei Cc: PHP Internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Extension Prepend Files From: pollita@php.net (Sara Golemon) On Sun, Jan 4, 2015 at 3:52 AM, Benjamin Eberlei wrote: > 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. > > 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: > > https://wiki.php.net/rfc/extension_prepend_files > > 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. > So, I've been meaning to propose something *like* this, but with a few key implementation detail differences: 1) Create the notion of "Persistent User Functions/Classes/Constants/etc...". This is an important perf item as reloading a prepend file on EVERY request is costly. Less costly with an opcache, sure, but still costly. Making the entries persistent lets us deal with this once in the process lifetime and keep the data around. 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 scripts, obviates the need to track what directory the files are in, and generally makes it cleaner. ((Pre-compiling to bytecode is an option, but it complicates the reloading and doesn't really buy us much.)) -Sara