On Sun, Jan 4, 2015 at 3:52 AM, Benjamin Eberlei <kont...@beberlei.de> 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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php