Re: Extension Cleanup
| From: | Sara Golemon | Date: | Mon, 14 Feb 2005 03:38:00 +0000 |
| Subject: | Re: Extension Cleanup | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-14912@lists.php.net to get a copy of this message | ||
> Is there a set of functions within an extension that is called
> automatically
> by the ZEND engine framework to "initialize" and "deinitailize" the
> extension?
>
MINIT: Module Initialization (Called once when the PHP processor is started)
RINIT: Request Initialization (Called at the start of every request)
RSHUTDOWN: Request Shutdown (Called at the end of every request)
MSHUTDOWN: Module Shutdown (Called when the PHP processor exits)
> In a particular PHP script, a user may call a method that sets up an
> environment. I cannot always rely on the user to call the cleanup API
> method at the end of the script. In that event, I would like my extension
> to automatically cleanup after itself when the script completes.
>
Resource dtors are also good for that kinda thing.
-Sara