Lee,
When you have all of those, there are ones that they call when the
extension is initialized and when shutdown. That is the simple explanation.
Now for the more explained description:
PHP_MINIT - Module Initialization.
This gives each extension a chance to initialize internal variables,
allocate resources, register resource handlers, and register its
functions with ZE, so that if a script calls one of those functions, ZE
knows which code to execute.
PHP_RINIT - Request Initialization.
RINIT gives the extension a chance to set up specific environment
variables, allocate request specific resources, or perform other tasks
such as auditing. A prime example of the RINIT function in action is in
the sessions extension where, if the session.auto_st art option is
enabled, RINIT will automatically trigger the userspace session_start()
function and pre-populate the $_SESSION variable.
PHP_MSHUTDOWN - Module Shutdown.
During shutdown of php it calls all of the PHP_MSHUTDOWN functions and
then shuts down its core subsystems.
PHP_RSHUTDOWN - Request Shutdown
This allows you to preform all the last minute cleanup on the extension
and save anything that you might need to save.
Hope that helps...
All of this is explained in the zend extension tutorials..
http://www.zend.com/php/internals/ex...n-writing1.php http://www.zend.com/php/internals/ex...n-writing2.php
Mike
Another question about writing PHP 5 extensions. What's the difference in
PHP_MINIT() / PHP_MSHUTDOWN() and PHP_RINIT() / PHP_RSHUTDOWN() ? When would
a "per request" init be made?
Thanks,
Lee
LeeStewart @ gmail.com