From 9ae8c39bab286ac551abdf7952c1b031291c6795 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Wed, 17 Jul 2002 08:06:43 +0000 Subject: [PATCH] - set_time_limit() now returns whether it succeeded in changing the time limit. --- main/main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main/main.c b/main/main.c index 8d14b99f99..186773d487 100644 --- a/main/main.c +++ b/main/main.c @@ -542,7 +542,7 @@ static void php_error_cb(int type, const char *error_filename, const uint error_ } /* }}} */ -/* {{{ proto void set_time_limit(int seconds) +/* {{{ proto bool set_time_limit(int seconds) Sets the maximum time a script can run */ PHP_FUNCTION(set_time_limit) { @@ -558,7 +558,11 @@ PHP_FUNCTION(set_time_limit) } convert_to_string_ex(new_timeout); - zend_alter_ini_entry("max_execution_time", sizeof("max_execution_time"), Z_STRVAL_PP(new_timeout), Z_STRLEN_PP(new_timeout), PHP_INI_USER, PHP_INI_STAGE_RUNTIME); + if (zend_alter_ini_entry("max_execution_time", sizeof("max_execution_time"), Z_STRVAL_PP(new_timeout), Z_STRLEN_PP(new_timeout), PHP_INI_USER, PHP_INI_STAGE_RUNTIME) == SUCCESS) { + RETURN_TRUE; + } else { + RETURN_FALSE; + } } /* }}} */ -- 2.40.0