Zend API doc II (Aka The Stupid guy)
| From: | Chesneau Serge | Date: | Mon, 03 Jul 2000 15:09:20 +0000 |
| Subject: | Zend API doc II (Aka The Stupid guy) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-23327@lists.php.net to get a copy of this message | ||
Hi again,
Other question, may be same ?
GINIT/MINIT
In my fake extension, i have these output for GINIT/GSHUTDOWN and
MINIT/MSHUTDOWN
Just after apache lauch (for ginit trace):
GINIT pid=30072 ppid=30071
GINIT pid=30073 ppid=1
(for minit trace)
MINIT pid=30072 ppid=30071
MSHUTDOWN pid=30073 ppid=1
MINIT pid=30073 ppid=1
with apache pid = 30073
This mean that :
1) GSHUTDOWN function is never call. May be some special declaration
needed. I have declared it like MINIT or MSHUTDOWN :
in my .h
- PHP_GSHUTDOWN(myext)
in my .c
- in the zend_module_entry struct : PHP_GSHUTDOWN(myext),
STANDARD_MODULE_PROPERTIES_EX
- and the function :
PHP_GSHUTDOWN_FUNCTION(myext)
{
FILE* fp;
fp = fopen ("/tmp/tam","a+");
if ( fp != NULL) {
fprintf (fp,"in GSHUTDOWN\n");
fclose (fp);
}
return SUCCESS;
}
2) The GINIT function is called twice. Before and after apache fork.
3) The MINIT function is called twice. One time in the parent process,
another in the child. This mean before and after apache fork. So why
GINIT + MINIT again ?
4) The MSHUTDOWN is called the first time on the child process (not the
parent) and a second time when apache stop :
Apache start
MINIT pid=30072 ppid=30071
MSHUTDOWN pid=30073 ppid=1
MINIT pid=30073 ppid=1
Apache end
MSHUTDOWN pid=30073 ppid=1
Thank for you patience and answer
Bye, chesneau serge.