sniper Thu Mar 17 08:43:33 2005 EDT Modified files: /php-src/sapi/cli php_cli.c Log: - Made CLI option -d output error and exit if an non-existing (or unmodifyable) entry is passed http://cvs.php.net/diff.php/php-src/sapi/cli/php_cli.c?r1=1.119&r2=1.120&ty=u Index: php-src/sapi/cli/php_cli.c diff -u php-src/sapi/cli/php_cli.c:1.119 php-src/sapi/cli/php_cli.c:1.120 --- php-src/sapi/cli/php_cli.c:1.119 Thu Mar 17 02:31:22 2005 +++ php-src/sapi/cli/php_cli.c Thu Mar 17 08:43:32 2005 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_cli.c,v 1.119 2005/03/17 07:31:22 derick Exp $ */ +/* $Id: php_cli.c,v 1.120 2005/03/17 13:43:32 sniper Exp $ */ #include "php.h" #include "php_globals.h" @@ -395,7 +395,7 @@ } /* }}} */ -static void define_command_line_ini_entry(char *arg TSRMLS_DC) +static int define_command_line_ini_entry(char *arg TSRMLS_DC) { char *name, *value; @@ -413,8 +413,9 @@ ZVAL_STRING(&extension, value, 0); php_dl(&extension, MODULE_PERSISTENT, &zval TSRMLS_CC); } else { - zend_alter_ini_entry(name, strlen(name)+1, value, strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); + return zend_alter_ini_entry(name, strlen(name)+1, value, strlen(value), PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE); } + return SUCCESS; } @@ -661,7 +662,10 @@ switch (c) { case 'd': /* define ini entries on command line */ - define_command_line_ini_entry(php_optarg TSRMLS_CC); + if (define_command_line_ini_entry(php_optarg TSRMLS_CC) == FAILURE) { + zend_printf("Invalid php.ini entry '%s'.\n", php_optarg); + goto err; + } break; case 'h': /* help & quit */
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php