Lifecycle Hooks - Executing on Load of Extension #2289
-
I had a question regarding Lifecycle Hooks, probably out of my own confusion. I'd like to author an extension that I'd like to run some code when the PHP interpreter is loaded (well, I guess that is to say when my extension is loaded). Can that be done with the Lifecycle Hooks? If so, can I use code authored in Zephir, or just C? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @willbonde. The answer - yes... in generally. You should use RINIT hook for this. With this hook you will have a Request and the ability to work with memory, zend objects, etc. You can read more about the PHP Lifecycle and Hooks here |
Beta Was this translation helpful? Give feedback.
-
Could be user if someone able to create simple example about life cycle hook |
Beta Was this translation helpful? Give feedback.
Hi @willbonde. The answer - yes... in generally. You should use RINIT hook for this. With this hook you will have a Request and the ability to work with memory, zend objects, etc. You can read more about the PHP Lifecycle and Hooks here