]> granicus.if.org Git - php/commitdiff
MFH: make use of startup hooks
authorAntony Dovgal <tony2001@php.net>
Tue, 20 Feb 2007 19:20:41 +0000 (19:20 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 20 Feb 2007 19:20:41 +0000 (19:20 +0000)
sapi/cgi/cgi_main.c
sapi/cli/php_cli.c

index 4b92e55df240d39c38fc79df1425c038954da1bb..c1982fa863ce0d24c7ea1afdd92f0e01a7e52b21 100644 (file)
@@ -119,6 +119,7 @@ static pid_t pgroup;
 
 static char *php_optarg = NULL;
 static int php_optind = 1;
+static zend_module_entry cgi_module_entry;
 
 static const opt_struct OPTIONS[] = {
        {'a', 0, "interactive"},
@@ -567,7 +568,7 @@ static int sapi_cgi_deactivate(TSRMLS_D)
 
 static int php_cgi_startup(sapi_module_struct *sapi_module)
 {
-       if (php_module_startup(sapi_module, NULL, 0) == FAILURE) {
+       if (php_module_startup(sapi_module, &cgi_module_entry, 1) == FAILURE) {
                return FAILURE;
        }
        return SUCCESS;
@@ -1262,7 +1263,7 @@ int main(int argc, char *argv[])
        cgi_sapi_module.executable_location = argv[0];
 
        /* startup after we get the above ini override se we get things right */
-       if (php_module_startup(&cgi_sapi_module, &cgi_module_entry, 1) == FAILURE) {
+       if (cgi_sapi_module.startup(&cgi_sapi_module) == FAILURE) {
 #ifdef ZTS
                tsrm_shutdown();
 #endif
index d48617ae468c3067a666a51034b3a43836340f2e..71e13f26d07c0687a4aacf258d06d84ea4f42854 100644 (file)
@@ -698,7 +698,7 @@ int main(int argc, char *argv[])
 #endif
 
        /* startup after we get the above ini override se we get things right */
-       if (php_module_startup(&cli_sapi_module, NULL, 0)==FAILURE) {
+       if (cli_sapi_module.startup(&cli_sapi_module)==FAILURE) {
                /* there is no way to see if we must call zend_ini_deactivate()
                 * since we cannot check if EG(ini_directives) has been initialised
                 * because the executor's constructor does not set initialize it.