From 60ee0cc74cbe43aa2452c97b1c687320d41b4c59 Mon Sep 17 00:00:00 2001 From: krakjoe Date: Sat, 9 Nov 2013 22:47:39 +0000 Subject: [PATCH] change server->phpdbg --- phpdbg.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/phpdbg.c b/phpdbg.c index ba1b0a3e75..9223824193 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -31,9 +31,9 @@ #include "php_main.h" -static zend_module_entry sapi_server_module_entry = { +static zend_module_entry sapi_phpdbg_module_entry = { STANDARD_MODULE_HEADER, - "server", + "phpdbg", NULL, NULL, NULL, @@ -44,20 +44,20 @@ static zend_module_entry sapi_server_module_entry = { STANDARD_MODULE_PROPERTIES }; -static inline int php_sapi_server_module_startup(sapi_module_struct *module) { /* {{{ */ - if (php_module_startup(module, &sapi_server_module_entry, 1) == FAILURE) { +static inline int php_sapi_phpdbg_module_startup(sapi_module_struct *module) { /* {{{ */ + if (php_module_startup(module, &sapi_phpdbg_module_entry, 1) == FAILURE) { return FAILURE; } return SUCCESS; } /* }}} */ -/* {{{ sapi_module_struct server_sapi_module +/* {{{ sapi_module_struct phpdbg_sapi_module */ -static sapi_module_struct server_sapi_module = { - "server", /* name */ - "SAPI server", /* pretty name */ +static sapi_module_struct phpdbg_sapi_module = { + "phpdbg", /* name */ + "phpdbg", /* pretty name */ - php_sapi_server_module_startup, /* startup */ + php_sapi_phpdbg_module_startup, /* startup */ php_module_shutdown_wrapper, /* shutdown */ NULL, /* activate */ @@ -100,9 +100,16 @@ int main(int argc, char **argv) { /* {{{ */ } #endif - sapi_startup(&server_sapi_module); +#ifdef PHP_WIN32 + _fmode = _O_BINARY; /*sets default for file streams to binary */ + setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ + setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ + setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ +#endif + + sapi_startup(&phpdbg_sapi_module); - if (server_sapi_module.startup(&server_sapi_module) == SUCCESS) + if (phpdbg_sapi_module.startup(&phpdbg_sapi_module) == SUCCESS) { zend_activate(TSRMLS_C); -- 2.50.1