From d3473d1f58c3801805ceac5c6c7df839d12c2a04 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Sun, 24 Aug 2003 13:10:03 +0000 Subject: - Provide a unified way to display uncaught exceptions, which shows file/line/message info if possible. - Add zend_eval_string_ex() to be able to handle exceptions in eval'd code. - Use above function to fix memleaks in CLI. --- sapi/cli/php_cli.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sapi/cli/php_cli.c') diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 093621ea3e..864d018cfa 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -945,7 +945,7 @@ int main(int argc, char *argv[]) #endif case PHP_MODE_CLI_DIRECT: cli_register_file_handles(TSRMLS_C); - if (zend_eval_string(exec_direct, NULL, "Command line code" TSRMLS_CC) == FAILURE) { + if (zend_eval_string_ex(exec_direct, NULL, "Command line code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; } break; @@ -958,7 +958,7 @@ int main(int argc, char *argv[]) cli_register_file_handles(TSRMLS_C); - if (exec_begin && zend_eval_string(exec_begin, NULL, "Command line begin code" TSRMLS_CC) == FAILURE) { + if (exec_begin && zend_eval_string_ex(exec_begin, NULL, "Command line begin code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; } ALLOC_ZVAL(argi); @@ -979,7 +979,7 @@ int main(int argc, char *argv[]) zend_hash_update(&EG(symbol_table), "argn", sizeof("argn"), &argn, sizeof(pval *), NULL); Z_LVAL_P(argi) = ++index; if (exec_run) { - if (zend_eval_string(exec_run, NULL, "Command line run code" TSRMLS_CC) == FAILURE) { + if (zend_eval_string_ex(exec_run, NULL, "Command line run code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; } } else { @@ -995,7 +995,7 @@ int main(int argc, char *argv[]) } efree(input); } - if (exec_end && zend_eval_string(exec_end, NULL, "Command line end code" TSRMLS_CC) == FAILURE) { + if (exec_end && zend_eval_string_ex(exec_end, NULL, "Command line end code", 1 TSRMLS_CC) == FAILURE) { exit_status=254; } -- cgit v1.2.1