diff options
Diffstat (limited to 'sapi/nsapi/nsapi.c')
-rw-r--r-- | sapi/nsapi/nsapi.c | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c index 1e6a680c91..bb99c31652 100644 --- a/sapi/nsapi/nsapi.c +++ b/sapi/nsapi/nsapi.c @@ -1,8 +1,8 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2013 The PHP Group | + | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -251,7 +251,7 @@ static void php_nsapi_init_dynamic_symbols(void) /* try user specified server_lib */ module = GetModuleHandle(nsapi_dll); if (!module) { - log_error(LOG_WARN, "php5_init", NULL, NULL, "Cannot find DLL specified by server_lib parameter: %s", nsapi_dll); + log_error(LOG_WARN, "php7_init", NULL, NULL, "Cannot find DLL specified by server_lib parameter: %s", nsapi_dll); } } else { /* find a LOADED dll module from nsapi_dlls */ @@ -414,7 +414,7 @@ PHP_FUNCTION(nsapi_request_headers) for (i=0; i < rc->rq->headers->hsize; i++) { entry=rc->rq->headers->ht[i]; while (entry) { - add_assoc_string(return_value, entry->param->name, entry->param->value, 1); + add_assoc_string(return_value, entry->param->name, entry->param->value); entry=entry->next; } } @@ -438,7 +438,7 @@ PHP_FUNCTION(nsapi_response_headers) for (i=0; i < rc->rq->srvhdrs->hsize; i++) { entry=rc->rq->srvhdrs->ht[i]; while (entry) { - add_assoc_string(return_value, entry->param->name, entry->param->value, 1); + add_assoc_string(return_value, entry->param->name, entry->param->value); entry=entry->next; } } @@ -467,10 +467,9 @@ static int sapi_nsapi_ub_write(const char *str, unsigned int str_length TSRMLS_D } /* modified version of apache2 */ -static void sapi_nsapi_flush(void *server_context) +static void sapi_nsapi_flush(void *server_context TSRMLS_DC) { nsapi_request_context *rc = (nsapi_request_context *)server_context; - TSRMLS_FETCH(); if (!rc) { /* we have no context, so no flushing needed. This fixes a SIGSEGV on shutdown */ @@ -782,7 +781,7 @@ static void nsapi_log_message(char *message TSRMLS_DC) if (rc) { log_error(LOG_INFORM, pblock_findval("fn", rc->pb), rc->sn, rc->rq, "%s", message); } else { - log_error(LOG_INFORM, "php5", NULL, NULL, "%s", message); + log_error(LOG_INFORM, "php7", NULL, NULL, "%s", message); } } @@ -869,7 +868,7 @@ static void nsapi_php_ini_entries(NSLS_D TSRMLS_DC) } } -void NSAPI_PUBLIC php5_close(void *vparam) +void NSAPI_PUBLIC php7_close(void *vparam) { if (nsapi_sapi_module.shutdown) { nsapi_sapi_module.shutdown(&nsapi_sapi_module); @@ -889,13 +888,13 @@ void NSAPI_PUBLIC php5_close(void *vparam) sapi_shutdown(); tsrm_shutdown(); - log_error(LOG_INFORM, "php5_close", NULL, NULL, "Shutdown PHP Module"); + log_error(LOG_INFORM, "php7_close", NULL, NULL, "Shutdown PHP Module"); } /********************************************************* / init SAF / -/ Init fn="php5_init" [php_ini="/path/to/php.ini"] [server_lib="ns-httpdXX.dll"] +/ Init fn="php7_init" [php_ini="/path/to/php.ini"] [server_lib="ns-httpdXX.dll"] / Initialize the NSAPI module in magnus.conf / / php_ini: gives path to php.ini file @@ -903,7 +902,7 @@ void NSAPI_PUBLIC php5_close(void *vparam) / servact_* functions / /*********************************************************/ -int NSAPI_PUBLIC php5_init(pblock *pb, Session *sn, Request *rq) +int NSAPI_PUBLIC php7_init(pblock *pb, Session *sn, Request *rq) { php_core_globals *core_globals; char *strval; @@ -918,13 +917,13 @@ int NSAPI_PUBLIC php5_init(pblock *pb, Session *sn, Request *rq) core_globals = ts_resource(core_globals_id); - /* look if php_ini parameter is given to php5_init */ + /* look if php_ini parameter is given to php7_init */ if (strval = pblock_findval("php_ini", pb)) { nsapi_sapi_module.php_ini_path_override = strdup(strval); } #ifdef PHP_WIN32 - /* look if server_lib parameter is given to php5_init + /* look if server_lib parameter is given to php7_init * (this disables the automatic search for the newest ns-httpdXX.dll) */ if (strval = pblock_findval("server_lib", pb)) { nsapi_dll = strdup(strval); @@ -935,7 +934,7 @@ int NSAPI_PUBLIC php5_init(pblock *pb, Session *sn, Request *rq) sapi_startup(&nsapi_sapi_module); nsapi_sapi_module.startup(&nsapi_sapi_module); - daemon_atrestart(&php5_close, NULL); + daemon_atrestart(&php7_close, NULL); log_error(LOG_INFORM, pblock_findval("fn", pb), sn, rq, "Initialized PHP Module (%d threads expected)", threads); return REQ_PROCEED; @@ -944,19 +943,19 @@ int NSAPI_PUBLIC php5_init(pblock *pb, Session *sn, Request *rq) /********************************************************* / normal use in Service directive: / -/ Service fn="php5_execute" type=... method=... [inikey=inivalue inikey=inivalue...] +/ Service fn="php7_execute" type=... method=... [inikey=inivalue inikey=inivalue...] / / use in Service for a directory to supply a php-made directory listing instead of server default: / -/ Service fn="php5_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] +/ Service fn="php7_execute" type="magnus-internal/directory" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] / / use in Error SAF to display php script as error page: / -/ Error fn="php5_execute" code=XXX script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] -/ Error fn="php5_execute" reason="Reason" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] +/ Error fn="php7_execute" code=XXX script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] +/ Error fn="php7_execute" reason="Reason" script="/path/to/script.php" [inikey=inivalue inikey=inivalue...] / /*********************************************************/ -int NSAPI_PUBLIC php5_execute(pblock *pb, Session *sn, Request *rq) +int NSAPI_PUBLIC php7_execute(pblock *pb, Session *sn, Request *rq) { int retval; nsapi_request_context *request_context; @@ -1077,15 +1076,15 @@ int NSAPI_PUBLIC php5_execute(pblock *pb, Session *sn, Request *rq) / will pass authentication through to php, and allow us to / check authentication with our scripts. / -/ php5_auth_trans +/ php7_auth_trans / main function called from netscape server to authenticate / a line in obj.conf: -/ funcs=php5_auth_trans shlib="path/to/this/phpnsapi.dll" +/ funcs=php7_auth_trans shlib="path/to/this/phpnsapi.dll" / and: / <Object ppath="path/to/be/authenticated/by/php/*"> -/ AuthTrans fn="php5_auth_trans" +/ AuthTrans fn="php7_auth_trans" /*********************************************************/ -int NSAPI_PUBLIC php5_auth_trans(pblock * pb, Session * sn, Request * rq) +int NSAPI_PUBLIC php7_auth_trans(pblock * pb, Session * sn, Request * rq) { /* This is a DO NOTHING function that allows authentication * information |