On Sat, Sep 18, 2010 at 1:37 AM, Matthew C. Rice <mr...@rcs.us> wrote: > Hello, > > I was wondering how early a zend_eval_string call can be made. Currently > it works fine in a PHP_FUNCTION(), but was hoping to put it in a PHP_MINIT() > in hopes of it just executing once. > > It seems PHP_MINIT() is too early, and is causing failures. I came across > PHP_GINIT_FUNCTION(), but can't seem to find when its called exactly, but > the same situation as PHP_MINIT() seems to be the case, where its too early. > > In short, I am wondering if there is any place I can put the > zend_eval_string() call in hopes of it running just once, so its result > could be retained throughout the module execution.
definitely, not earlier than PHP_RINIT(), which doesn't help you. all php's "userland" code is executed in the sandbox and sandbox exists between PHP_RINIT and PHP_RSHUTDOWN the only way to execute userland code before serving requests is to use long running process, which serves requests from userland. That's what I do in http://github.com/indeyets/appserver-in-php -- Alexey Zakhlestin http://www.milkfarmsoft.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php