Re: [PHP Guru question]: run php script from within pecl extension

From: Date: Mon, 02 Oct 2006 13:59:04 +0000
Subject: Re: [PHP Guru question]: run php script from within pecl extension
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-25906@lists.php.net to get a copy of this message
Hi Sara... Thanks for your reply... Sara Golemon schrieb:
For several reasons I need to call a php script every x minutes. I need that on several platforms so I started to write a pecl extension that implements something like a cron service.
Why not cron then? I love cron, but I am mainly (85%) on windows with my apps and
want to have a simple and easy setup and not a bunch of applications/services to install. There is just the apache service bringing in php and my pecl. All other solutions I know are much more voluminous and have more errorpoints.
Obviously I miss something in initing php, because php crashes in main/streams/streams.c function php_stream_locate_url_wrapper() when I call php_execute_script()
Correct. You're not in a request (you're probably not even in an identifiable/unique thread context). Both are fixable by spinning up a context at thread startup and either (A) wrapping a request activate/deactivate around that timer, or (B) wrapping the activate/deactivate just inside your thread context (giving you a single-uberlong-running request). Do you have some example / skeleton stuff for this
or can you give me a pointer on this where to find? Many thanks in advance, Roland

« previous php.internals (#25906) next »