From 0577ccad2876a763bcd48139b821fc2a193ea177 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Sat, 21 Dec 2013 22:42:11 +0100 Subject: Added breaking upon fatal-ish error --- sapi/phpdbg/phpdbg.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 17193ed244..4b75ce26ca 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -438,6 +438,35 @@ static void php_sapi_phpdbg_log_message(char *message TSRMLS_DC) /* {{{ */ */ if (phpdbg_booted) { phpdbg_error("%s", message); + + switch (PG(last_error_type)) { + case E_ERROR: + case E_CORE_ERROR: + case E_COMPILE_ERROR: + case E_USER_ERROR: + case E_PARSE: + case E_RECOVERABLE_ERROR: + if (!(PHPDBG_G(flags) & PHPDBG_IN_EVAL)) { + phpdbg_list_file( + zend_get_executed_filename(TSRMLS_C), + 3, + zend_get_executed_lineno(TSRMLS_C)-1, + zend_get_executed_lineno(TSRMLS_C) + TSRMLS_CC + ); + } + + do { + switch (phpdbg_interactive(TSRMLS_C)) { + case PHPDBG_LEAVE: + case PHPDBG_FINISH: + case PHPDBG_UNTIL: + case PHPDBG_NEXT: + return; + } + } while (!(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)); + + } } else fprintf(stdout, "%s\n", message); } /* }}} */ -- cgit v1.2.1 From ca882858f41adca912e267559fead5245070587f Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Mon, 23 Dec 2013 23:55:07 +0100 Subject: Fixed credits in phpdbg.* files --- sapi/phpdbg/phpdbg.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 4b75ce26ca..a0665a7ee5 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -14,6 +14,7 @@ +----------------------------------------------------------------------+ | Authors: Felipe Pena | | Authors: Joe Watkins | + | Authors: Bob Weinand | +----------------------------------------------------------------------+ */ -- cgit v1.2.1 From ddf733fa6974e6ada3aec52005611f9b4647beb5 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Tue, 24 Dec 2013 13:11:57 +0100 Subject: Fixed #18 Errors not displaying in some configurations --- sapi/phpdbg/phpdbg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index a0665a7ee5..d025294f1f 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -25,6 +25,7 @@ #include "phpdbg_prompt.h" #include "phpdbg_bp.h" #include "phpdbg_break.h" +#include "phpdbg_list.h" #include "phpdbg_utils.h" #include "phpdbg_set.h" @@ -609,7 +610,8 @@ const char phpdbg_ini_hardcoded[] = "display_errors=Off\n" "log_errors=On\n" "max_execution_time=0\n" -"max_input_time=-1\n\0"; +"max_input_time=-1\n" +"error_log=\n\0"; /* overwriteable ini defaults must be set in phpdbg_ini_defaults() */ #define INI_DEFAULT(name, value) \ -- cgit v1.2.1 From 1e411ebdf5fa56fa8f8870d22a5bdd21c54caf69 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 25 Dec 2013 23:43:20 +0100 Subject: fix c89 compat --- sapi/phpdbg/phpdbg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index d025294f1f..fd15f80984 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -137,9 +137,8 @@ static void php_phpdbg_destroy_bp_condition(void *data) /* {{{ */ static void php_phpdbg_destroy_registered(void *data) /* {{{ */ { - TSRMLS_FETCH(); - zend_function *function = (zend_function*) data; + TSRMLS_FETCH(); destroy_zend_function( function TSRMLS_CC); -- cgit v1.2.1 From c8dedaf2dcd5b545a1da6fb83f03fc06570f6d95 Mon Sep 17 00:00:00 2001 From: krakjoe Date: Fri, 27 Dec 2013 18:03:11 +0000 Subject: update version output --- sapi/phpdbg/phpdbg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index fd15f80984..fb3a67747c 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -1037,11 +1037,10 @@ phpdbg_main: sapi_startup(phpdbg); phpdbg->startup(phpdbg); printf( - "phpdbg %s (built: %s %s)\nCopyright (c) 2013 %s\nPHP %s, Copyright (c) 1997-2013 The PHP Group\n%s", + "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) 1997-2013 The PHP Group\n%s", PHPDBG_VERSION, __DATE__, __TIME__, - PHPDBG_AUTHORS, PHP_VERSION, get_zend_version() ); -- cgit v1.2.1 From c081ce628f0d76d44784d7bb8e06428b06142ac0 Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 3 Jan 2014 11:08:10 +0800 Subject: Bump year --- sapi/phpdbg/phpdbg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index fb3a67747c..deb7be6e2b 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | 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 | @@ -1037,7 +1037,7 @@ phpdbg_main: sapi_startup(phpdbg); phpdbg->startup(phpdbg); printf( - "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) 1997-2013 The PHP Group\n%s", + "phpdbg %s (built: %s %s)\nPHP %s, Copyright (c) 1997-2014 The PHP Group\n%s", PHPDBG_VERSION, __DATE__, __TIME__, -- cgit v1.2.1 From a58c74f1c7f46a0dbdcbe9d1211902a4a8c755cf Mon Sep 17 00:00:00 2001 From: krakjoe Date: Sun, 2 Feb 2014 13:43:43 +0000 Subject: remove use of zend directly, avoid leaks/bugs in modules etc --- sapi/phpdbg/phpdbg.c | 43 +++++++++---------------------------------- 1 file changed, 9 insertions(+), 34 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index e7f841c0bc..7c94ac19dd 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -872,6 +872,7 @@ int main(int argc, char **argv) /* {{{ */ phpdbg_main: if (!cleaning) { bp_tmp_file = malloc(L_tmpnam); + tmpnam(bp_tmp_file); if (bp_tmp_file == NULL) { phpdbg_error("Unable to create temporary file"); @@ -1117,8 +1118,7 @@ phpdbg_main: phpdbg->ini_entries = ini_entries; if (phpdbg->startup(phpdbg) == SUCCESS) { - - zend_activate(TSRMLS_C); + php_request_startup(TSRMLS_C); /* do not install sigint handlers for remote consoles */ /* sending SIGINT then provides a decent way of shutting down the server */ @@ -1186,20 +1186,11 @@ phpdbg_main: /* set default prompt */ phpdbg_set_prompt(PROMPT TSRMLS_CC); - zend_try { - zend_activate_modules(TSRMLS_C); - } zend_end_try(); - if (show_banner) { /* print blurb */ phpdbg_welcome((cleaning > 0) TSRMLS_CC); } - zend_try { - /* activate globals, they can be overwritten */ - zend_activate_auto_globals(TSRMLS_C); - } zend_end_try(); - /* initialize from file */ PHPDBG_G(flags) |= PHPDBG_IS_INITIALIZING; zend_try { @@ -1269,12 +1260,6 @@ phpdbg_interact: } zend_end_try(); } while(!cleaning && !(PHPDBG_G(flags) & PHPDBG_IS_QUITTING)); - /* this must be forced */ - CG(unclean_shutdown) = 0; - - /* this is just helpful */ - PG(report_memleaks) = 0; - phpdbg_out: #ifndef _WIN32 if ((PHPDBG_G(flags) & PHPDBG_IS_DISCONNECTED)) { @@ -1297,24 +1282,14 @@ phpdbg_out: if (ini_override) { free(ini_override); } + + /* this must be forced */ + CG(unclean_shutdown) = 0; + + /* this is just helpful */ + PG(report_memleaks) = 0; - if (PG(modules_activated)) { - zend_try { - zend_deactivate_modules(TSRMLS_C); - } zend_end_try(); - } - - zend_deactivate(TSRMLS_C); - - zend_try { - zend_post_deactivate_modules(TSRMLS_C); - } zend_end_try(); - -#ifdef ZEND_SIGNALS - zend_try { - zend_signal_deactivate(TSRMLS_C); - } zend_end_try(); -#endif + php_request_shutdown((void*)0); zend_try { php_module_shutdown(TSRMLS_C); -- cgit v1.2.1 From 9e84124e2dba2fc652abce076d5d1bbac9ed13bd Mon Sep 17 00:00:00 2001 From: krakjoe Date: Sun, 2 Feb 2014 14:42:31 +0000 Subject: better use of tmpnam/mkstemp --- sapi/phpdbg/phpdbg.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 7c94ac19dd..9341ad35a5 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -831,7 +831,13 @@ int main(int argc, char **argv) /* {{{ */ zend_bool remote = 0; int run = 0; int step = 0; - char *bp_tmp_file; + +#ifdef _WIN32 + char *bp_tmp_file = NULL; +#else + char bp_tmp_file[] = "/tmp/phpdbg.XXXXXX"; +#endif + #ifndef _WIN32 char *address; int listen[2]; @@ -871,10 +877,23 @@ int main(int argc, char **argv) /* {{{ */ phpdbg_main: if (!cleaning) { + +#ifdef _WIN32 bp_tmp_file = malloc(L_tmpnam); - tmpnam(bp_tmp_file); - if (bp_tmp_file == NULL) { + if (bp_tmp_file) { + if (!tmpnam(bp_tmp_file)) { + free(bp_tmp_file); + bp_tmp_file = NULL; + } + } +#else + if (!mkstemp(bp_tmp_file)) { + memset(bp_tmp_file, 0, sizeof(bp_tmp_file)); + } +#endif + + if (!bp_tmp_file) { phpdbg_error("Unable to create temporary file"); } } @@ -1317,7 +1336,11 @@ phpdbg_out: free(sapi_name); } +#ifdef _WIN32 free(bp_tmp_file); +#else + unlink(bp_tmp_file); +#endif return 0; } /* }}} */ -- cgit v1.2.1 From 6a6bec44add665fc8330eb03161dc36d278ed40d Mon Sep 17 00:00:00 2001 From: krakjoe Date: Sun, 2 Feb 2014 14:50:32 +0000 Subject: woops --- sapi/phpdbg/phpdbg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 9341ad35a5..6cb1645e65 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -892,9 +892,11 @@ phpdbg_main: memset(bp_tmp_file, 0, sizeof(bp_tmp_file)); } #endif - + if (!bp_tmp_file) { - phpdbg_error("Unable to create temporary file"); + phpdbg_error( + "Unable to create temporary file"); + return 1; } } ini_entries = NULL; -- cgit v1.2.1 From ccae70b7650046fd5692a15b7148dac1862a65a3 Mon Sep 17 00:00:00 2001 From: Mateusz Kocielski Date: Tue, 18 Mar 2014 09:51:39 +0100 Subject: Fix phpdbg build on FreeBSD Added missing netinet/in.h header. --- sapi/phpdbg/phpdbg.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 6cb1645e65..7e0e2bafcd 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -35,6 +35,7 @@ # include # include # include +# include # include # include #endif /* }}} */ -- cgit v1.2.1 From 6c259625c45f4a4137b53a9e3a06677f7c3236ed Mon Sep 17 00:00:00 2001 From: Mateusz Kocielski Date: Tue, 18 Mar 2014 10:49:28 +0100 Subject: Fixed wrong indentation --- sapi/phpdbg/phpdbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 7e0e2bafcd..51a328d0b5 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -35,7 +35,7 @@ # include # include # include -# include +# include # include # include #endif /* }}} */ -- cgit v1.2.1 From 3ad8616aff458a11b5f4121139734907e5431f0e Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Thu, 1 May 2014 11:38:08 +0200 Subject: Added stdion/stdout/stderr constsnts and their php:// wrappers Fixes issue #85 --- sapi/phpdbg/phpdbg.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 064e266082..fc121839e8 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -533,6 +533,69 @@ static inline void php_sapi_phpdbg_flush(void *context) /* {{{ */ fflush(PHPDBG_G(io)[PHPDBG_STDOUT]); } /* }}} */ +/* copied from sapi/cli/php_cli.c cli_register_file_handles */ +static void phpdbg_register_file_handles(TSRMLS_D) /* {{{ */ +{ + zval *zin, *zout, *zerr; + php_stream *s_in, *s_out, *s_err; + php_stream_context *sc_in=NULL, *sc_out=NULL, *sc_err=NULL; + zend_constant ic, oc, ec; + + MAKE_STD_ZVAL(zin); + MAKE_STD_ZVAL(zout); + MAKE_STD_ZVAL(zerr); + + s_in = php_stream_open_wrapper_ex("php://stdin", "rb", 0, NULL, sc_in); + s_out = php_stream_open_wrapper_ex("php://stdout", "wb", 0, NULL, sc_out); + s_err = php_stream_open_wrapper_ex("php://stderr", "wb", 0, NULL, sc_err); + + if (s_in==NULL || s_out==NULL || s_err==NULL) { + FREE_ZVAL(zin); + FREE_ZVAL(zout); + FREE_ZVAL(zerr); + if (s_in) php_stream_close(s_in); + if (s_out) php_stream_close(s_out); + if (s_err) php_stream_close(s_err); + return; + } + +#if PHP_DEBUG + /* do not close stdout and stderr */ + s_out->flags |= PHP_STREAM_FLAG_NO_CLOSE; + s_err->flags |= PHP_STREAM_FLAG_NO_CLOSE; +#endif + + php_stream_to_zval(s_in, zin); + php_stream_to_zval(s_out, zout); + php_stream_to_zval(s_err, zerr); + + ic.value = *zin; + ic.flags = CONST_CS; + ic.name = zend_strndup(ZEND_STRL("STDIN")); + ic.name_len = sizeof("STDIN"); + ic.module_number = 0; + zend_register_constant(&ic TSRMLS_CC); + + oc.value = *zout; + oc.flags = CONST_CS; + oc.name = zend_strndup(ZEND_STRL("STDOUT")); + oc.name_len = sizeof("STDOUT"); + oc.module_number = 0; + zend_register_constant(&oc TSRMLS_CC); + + ec.value = *zerr; + ec.flags = CONST_CS; + ec.name = zend_strndup(ZEND_STRL("STDERR")); + ec.name_len = sizeof("STDERR"); + ec.module_number = 0; + zend_register_constant(&ec TSRMLS_CC); + + FREE_ZVAL(zin); + FREE_ZVAL(zout); + FREE_ZVAL(zerr); +} +/* }}} */ + /* {{{ sapi_module_struct phpdbg_sapi_module */ static sapi_module_struct phpdbg_sapi_module = { @@ -1262,6 +1325,9 @@ phpdbg_main: /* set default prompt */ phpdbg_set_prompt(PROMPT TSRMLS_CC); + /* Make stdin, stdout and stderr accessible from PHP scripts */ + phpdbg_register_file_handles(TSRMLS_C); + if (show_banner) { /* print blurb */ phpdbg_welcome((cleaning > 0) TSRMLS_CC); -- cgit v1.2.1 From 63d3f0b844b3a5f1c94be3c97bca29235dc2b3fc Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Tue, 19 Aug 2014 08:07:31 +0200 Subject: basic macro replacements, all at once --- sapi/phpdbg/phpdbg.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 1fbd18a423..aaed7a3a88 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -87,14 +87,14 @@ static PHP_MINIT_FUNCTION(phpdbg) /* {{{ */ REGISTER_STRINGL_CONSTANT("PHPDBG_VERSION", PHPDBG_VERSION, sizeof(PHPDBG_VERSION)-1, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_FILE", FILE_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_METHOD", METHOD_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_LINENO", NUMERIC_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_FUNC", STR_PARAM, CONST_CS|CONST_PERSISTENT); - - REGISTER_LONG_CONSTANT("PHPDBG_COLOR_PROMPT", PHPDBG_COLOR_PROMPT, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_COLOR_NOTICE", PHPDBG_COLOR_NOTICE, CONST_CS|CONST_PERSISTENT); - REGISTER_LONG_CONSTANT("PHPDBG_COLOR_ERROR", PHPDBG_COLOR_ERROR, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_FILE", FILE_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_METHOD", METHOD_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_LINENO", NUMERIC_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_FUNC", STR_PARAM, CONST_CS|CONST_PERSISTENT); + + REGISTER_INT_CONSTANT("PHPDBG_COLOR_PROMPT", PHPDBG_COLOR_PROMPT, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_COLOR_NOTICE", PHPDBG_COLOR_NOTICE, CONST_CS|CONST_PERSISTENT); + REGISTER_INT_CONSTANT("PHPDBG_COLOR_ERROR", PHPDBG_COLOR_ERROR, CONST_CS|CONST_PERSISTENT); return SUCCESS; } /* }}} */ -- cgit v1.2.1 From c3e3c98ec666812daaaca896cf5ef758a8a6df14 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Mon, 25 Aug 2014 19:24:55 +0200 Subject: master renames phase 1 --- sapi/phpdbg/phpdbg.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index aaed7a3a88..1fbd18a423 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -87,14 +87,14 @@ static PHP_MINIT_FUNCTION(phpdbg) /* {{{ */ REGISTER_STRINGL_CONSTANT("PHPDBG_VERSION", PHPDBG_VERSION, sizeof(PHPDBG_VERSION)-1, CONST_CS|CONST_PERSISTENT); - REGISTER_INT_CONSTANT("PHPDBG_FILE", FILE_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_INT_CONSTANT("PHPDBG_METHOD", METHOD_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_INT_CONSTANT("PHPDBG_LINENO", NUMERIC_PARAM, CONST_CS|CONST_PERSISTENT); - REGISTER_INT_CONSTANT("PHPDBG_FUNC", STR_PARAM, CONST_CS|CONST_PERSISTENT); - - REGISTER_INT_CONSTANT("PHPDBG_COLOR_PROMPT", PHPDBG_COLOR_PROMPT, CONST_CS|CONST_PERSISTENT); - REGISTER_INT_CONSTANT("PHPDBG_COLOR_NOTICE", PHPDBG_COLOR_NOTICE, CONST_CS|CONST_PERSISTENT); - REGISTER_INT_CONSTANT("PHPDBG_COLOR_ERROR", PHPDBG_COLOR_ERROR, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHPDBG_FILE", FILE_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHPDBG_METHOD", METHOD_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHPDBG_LINENO", NUMERIC_PARAM, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHPDBG_FUNC", STR_PARAM, CONST_CS|CONST_PERSISTENT); + + REGISTER_LONG_CONSTANT("PHPDBG_COLOR_PROMPT", PHPDBG_COLOR_PROMPT, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHPDBG_COLOR_NOTICE", PHPDBG_COLOR_NOTICE, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("PHPDBG_COLOR_ERROR", PHPDBG_COLOR_ERROR, CONST_CS|CONST_PERSISTENT); return SUCCESS; } /* }}} */ -- cgit v1.2.1 From 3234480827b27ff5d3469a732167afd289632a96 Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Wed, 27 Aug 2014 15:31:48 +0200 Subject: first show to make 's' work with size_t --- sapi/phpdbg/phpdbg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 1fbd18a423..6fe06a9f65 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -308,7 +308,7 @@ static PHP_FUNCTION(phpdbg_color) { long element = 0L; char *color = NULL; - int color_len = 0; + size_t color_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &element, &color, &color_len) == FAILURE) { return; @@ -329,7 +329,7 @@ static PHP_FUNCTION(phpdbg_color) static PHP_FUNCTION(phpdbg_prompt) { char *prompt = NULL; - int prompt_len = 0; + size_t prompt_len = 0; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &prompt, &prompt_len) == FAILURE) { return; -- cgit v1.2.1 From d0cb715373c3fbe9dc095378ec5ed8c71f799f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Schl=C3=BCter?= Date: Fri, 19 Sep 2014 18:33:14 +0200 Subject: s/PHP 5/PHP 7/ --- sapi/phpdbg/phpdbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sapi/phpdbg/phpdbg.c') diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index c10af61e1a..4388b4f86d 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2014 The PHP Group | +----------------------------------------------------------------------+ -- cgit v1.2.1