]> granicus.if.org Git - php/commitdiff
- Added parameter TSRMLS_DC in zend_is_callable()
authorFelipe Pena <felipe@php.net>
Sat, 2 Aug 2008 04:40:45 +0000 (04:40 +0000)
committerFelipe Pena <felipe@php.net>
Sat, 2 Aug 2008 04:40:45 +0000 (04:40 +0000)
24 files changed:
Zend/zend_API.c
Zend/zend_API.h
Zend/zend_builtin_functions.c
ext/filter/callback_filter.c
ext/interbase/ibase_events.c
ext/interbase/php_ibase_udf.c
ext/ldap/ldap.c
ext/mysqli/mysqli_api.c
ext/pcntl/pcntl.c
ext/pcre/php_pcre.c
ext/pdo/pdo_stmt.c
ext/pdo_sqlite/sqlite_driver.c
ext/readline/readline.c
ext/session/session.c
ext/spl/spl_iterators.c
ext/sqlite/sqlite.c
ext/sqlite3/sqlite3.c
ext/standard/array.c
ext/standard/basic_functions.c
ext/standard/type.c
ext/sybase_ct/php_sybase_ct.c
ext/unicode/property.c
ext/unicode/unicode.c
ext/xmlrpc/xmlrpc-epi-php.c

index be2b46b9c5983be7ba250d247b91c5177551dc0d..bb6a7218b229082daf00702f6ab12e3135a7f1f7 100644 (file)
@@ -3272,10 +3272,8 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval **object_pp, uint ch
 }
 /* }}} */
 
-ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, zval *callable_name) /* {{{ */
+ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, zval *callable_name TSRMLS_DC) /* {{{ */
 {
-       TSRMLS_FETCH();
-
        return zend_is_callable_ex(callable, NULL, check_flags, callable_name, NULL, NULL TSRMLS_CC);
 }
 /* }}} */
index 34b1c2c692a1b947266973515cc2123ae6532a80..598d348d38ef31411431f9735cd7618577307d2f 100644 (file)
@@ -285,7 +285,7 @@ ZEND_API void zend_wrong_param_count(TSRMLS_D);
 #define IS_CALLABLE_STRICT  (IS_CALLABLE_CHECK_IS_STATIC)
 
 ZEND_API zend_bool zend_is_callable_ex(zval *callable, zval **object_pp, uint check_flags, zval *callable_name, zend_fcall_info_cache *fcc, char **error TSRMLS_DC);
-ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, zval *callable_name);
+ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, zval *callable_name TSRMLS_DC);
 ZEND_API zend_bool zend_make_callable(zval *callable, zval *callable_name TSRMLS_DC);
 ZEND_API const char *zend_get_module_version(const char *module_name);
 ZEND_API int zend_get_module_started(char *module_name);
index b74265f9e6f43a5e44c3592fc8ec815aa39088e8..715219a54ca07dbe99a46923dcc8361f4d6a01e4 100644 (file)
@@ -1506,7 +1506,7 @@ ZEND_FUNCTION(set_error_handler)
                return;
        }
 
-       if (!zend_is_callable(error_handler, 0, &error_handler_name)) {
+       if (!zend_is_callable(error_handler, 0, &error_handler_name TSRMLS_CC)) {
                zend_error(E_WARNING, "%v() expects the argument (%R) to be a valid callback",
                                   get_active_function_name(TSRMLS_C), Z_TYPE(error_handler_name), Z_UNIVAL(error_handler_name));
                zval_dtor(&error_handler_name);
@@ -1576,7 +1576,7 @@ ZEND_FUNCTION(set_exception_handler)
        }
 
        if (Z_TYPE_P(exception_handler) != IS_NULL) { /* NULL == unset */
-               if (!zend_is_callable(exception_handler, 0, &exception_handler_name)) {
+               if (!zend_is_callable(exception_handler, 0, &exception_handler_name TSRMLS_CC)) {
                        zend_error(E_WARNING, "%v() expects the argument (%R) to be a valid callback",
                                           get_active_function_name(TSRMLS_C), Z_TYPE(exception_handler_name), Z_UNIVAL(exception_handler_name));
                        zval_dtor(&exception_handler_name);
index 62c14e335f372f9c725616a18204fbaf9e5bccce..b500c5b4ed866c0c3ced6817c86231c9729351cb 100644 (file)
@@ -26,7 +26,7 @@ void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL)
        zval ***args;
        int status;
 
-       if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, NULL)) {
+       if (!option_array || !zend_is_callable(option_array, IS_CALLABLE_CHECK_NO_ACCESS, NULL TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argument is expected to be a valid callback");
                zval_dtor(value);
                Z_TYPE_P(value) = IS_NULL;
index f5d303c2db4d13f590872db839015604bb06c9e4..b4c204ba26c20d1d689c4d94c243b83455c9ce67 100644 (file)
@@ -304,7 +304,7 @@ PHP_FUNCTION(ibase_set_event_handler)
        }
 
        /* get the callback */
-       if (!zend_is_callable(*cb_arg, 0, NULL)) {
+       if (!zend_is_callable(*cb_arg, 0, NULL TSRMLS_CC)) {
                _php_ibase_module_error("Callback argument %s is not a callable function"
                        TSRMLS_CC, Z_STRVAL_PP(cb_arg));
                RETURN_FALSE;
index 4bdeb87dfb024e8161eb8099eebc57c2d02c1402..3945d465b79a639f7e32ae21fdc07bc643e6a2d4 100644 (file)
@@ -192,10 +192,14 @@ static void call_php(char *name, PARAMDSC *r, int argc, PARAMDSC **argv)
                INIT_ZVAL(callback);
                ZVAL_STRING(&callback,name,0);
 
+               LOCK();
+               
                /* check if the requested function exists */
-               if (!zend_is_callable(&callback, 0, NULL)) {
+               if (!zend_is_callable(&callback, 0, NULL TSRMLS_CC)) {
                        break;
                }
+               
+               UNLOCK();
        
                /* create the argument array */
                for (i = 0; i < argc; ++i) {
index 0622d1e622b8fbe684d66d3d07fab1314599aa7e..57d852bd71bc47d00053e03df4405dd613bf9233 100644 (file)
@@ -2140,7 +2140,7 @@ PHP_FUNCTION(ldap_set_rebind_proc)
        }
 
        /* callable? */
-       if (!zend_is_callable(callback, 0, &callback_name)) {
+       if (!zend_is_callable(callback, 0, &callback_name TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Two arguments expected for '%R' to be a valid callback", Z_TYPE(callback_name), Z_UNIVAL(callback_name));
                zval_dtor(&callback_name);
                RETURN_FALSE;
index 03c041a1153158663416371b187ae60d8466f6ac..44f103628c506a0e9eb215de96d35f1c88b3f283 100644 (file)
@@ -1477,7 +1477,7 @@ PHP_FUNCTION(mysqli_set_local_infile_handler)
        }
 
        /* check callback function */
-       if (!zend_is_callable(callback_func, 0, &callback_name)) {
+       if (!zend_is_callable(callback_func, 0, &callback_name TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a valid callback function %R", Z_TYPE(callback_name), Z_UNIVAL(callback_name));
                zval_dtor(&callback_name);
                RETURN_FALSE;
index b0fa81007caa42bfaf334ee571bd85b5bb8d0ef1..f29588c66f56fa9cd81e2bf76ea5409b4b406544 100755 (executable)
@@ -728,7 +728,7 @@ PHP_FUNCTION(pcntl_signal)
                RETURN_TRUE;
        }
        
-       if (!zend_is_callable(handle, 0, &func_name)) {
+       if (!zend_is_callable(handle, 0, &func_name TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "%R is not a callable function name error", Z_TYPE(func_name), Z_UNIVAL(func_name));
                zval_dtor(&func_name);
                RETURN_FALSE;
index 2e7638ed517c56187fe4fbee074bdb3913484c51..f1ee5585c32f4dd8c6b6856281c0846e68a1910a 100644 (file)
@@ -1463,7 +1463,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl
                if (Z_TYPE_P(replace) != IS_ARRAY && Z_TYPE_P(replace) != IS_OBJECT) {
                        convert_to_text(replace);
                }
-               if (!zend_is_callable(replace, 0, &callback_name)) {
+               if (!zend_is_callable(replace, 0, &callback_name TSRMLS_CC)) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Requires argument 2, '%R', to be a valid callback", Z_TYPE(callback_name), Z_UNIVAL(callback_name));
                        zval_dtor(&callback_name);
                        *return_value = *subject;
index 8d79061138539724bf4de12889ee0cc6218cc085..63b75bf0b924ea4211a075ba4ac0153474146fe5 100755 (executable)
@@ -802,7 +802,7 @@ static int make_callable_ex(pdo_stmt_t *stmt, zval *callable, zend_fcall_info *
                method = &callable;
        }
        
-       if (!method || !zend_is_callable(callable, 0, NULL)) {
+       if (!method || !zend_is_callable(callable, 0, NULL TSRMLS_CC)) {
                pdo_raise_impl_error(stmt->dbh, stmt, "HY000", "user-supplied function must be a valid callback" TSRMLS_CC);
                return 0;
        }
index e63dde7069d7522729975259f50264849f31261e..02fce5019824c653ff13984e8d77c9c7f8996ed0 100644 (file)
@@ -502,7 +502,7 @@ static PHP_METHOD(SQLite, sqliteCreateFunction)
        dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
        PDO_CONSTRUCT_CHECK;
 
-       if (!zend_is_callable(callback, 0, NULL)) {
+       if (!zend_is_callable(callback, 0, NULL TSRMLS_CC)) {
                pdo_sqlite_errmsg(dbh, NULL, "callback is not callable");
                RETURN_FALSE;
        }
@@ -571,11 +571,11 @@ static PHP_METHOD(SQLite, sqliteCreateAggregate)
        dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
        PDO_CONSTRUCT_CHECK;
 
-       if (!zend_is_callable(step_callback, 0, NULL)) {
+       if (!zend_is_callable(step_callback, 0, NULL TSRMLS_CC)) {
                pdo_sqlite_errmsg(dbh, NULL, "step callback is not callable");
                RETURN_FALSE;
        }
-       if (!zend_is_callable(fini_callback, 0, NULL)) {
+       if (!zend_is_callable(fini_callback, 0, NULL TSRMLS_CC)) {
                pdo_sqlite_errmsg(dbh, NULL, "fini callback is not callable");
                RETURN_FALSE;
        }
index ba684389787f73c70930f7de49748ac98b111284..2f53028e64f3b41321d41d24c33fe68c18d8f833 100644 (file)
@@ -499,7 +499,7 @@ PHP_FUNCTION(readline_completion_function)
                RETURN_FALSE;
        }
 
-       if (!zend_is_callable(arg, 0, &name)) {
+       if (!zend_is_callable(arg, 0, &name TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "%R is not callable", Z_TYPE(name), Z_UNIVAL(name));
                zval_dtor(&name);
                RETURN_FALSE;
@@ -552,7 +552,7 @@ PHP_FUNCTION(readline_callback_handler_install)
                return;
        }
 
-       if (!zend_is_callable(callback, 0, &name)) {
+       if (!zend_is_callable(callback, 0, &name TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "%R is not callable", Z_TYPE(name), Z_UNIVAL(name));
                zval_dtor(&name);
                RETURN_FALSE;
index 6b0fe71e13311b992f0296e8b69981720fa47377..b1b812712435734a007c071f11e65ca07e86b8b2 100644 (file)
@@ -1490,7 +1490,7 @@ static PHP_FUNCTION(session_set_save_handler)
        
 
        for (i = 0; i < 6; i++) {
-               if (!zend_is_callable(*args[i], 0, &name)) {
+               if (!zend_is_callable(*args[i], 0, &name TSRMLS_CC)) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument %d is not a valid callback", i+1);
                        zval_dtor(&name);
                        RETURN_FALSE;
index 76dd0805b188ccd40e49c649ca5d0ee043779213..23fa15b10c7bb512b7629a4666c8a6afc2a0c00c 100755 (executable)
@@ -1234,7 +1234,7 @@ int spl_dual_it_call_method(char *method, INTERNAL_FUNCTION_PARAMETERS)
        intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
 
        ZVAL_TEXT(&func, method, 0);
-       if (!zend_is_callable(&func, 0, &method)) {
+       if (!zend_is_callable(&func, 0, &method TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_ERROR, "Method %v::%R() does not exist", intern->inner.ce->name, Z_TYPE(method), Z_UNIVAL(method));
                return FAILURE;
        }
index 15f9d25deee68db62c74209f805a6613ca299620..049eea4d5033de744ac9b2ce5a4b8cc43bb36955 100644 (file)
@@ -3556,14 +3556,14 @@ PHP_FUNCTION(sqlite_create_aggregate)
                DB_FROM_ZVAL(db, &zdb);
        }
 
-       if (!zend_is_callable(zstep, 0, &callable)) {
+       if (!zend_is_callable(zstep, 0, &callable TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "step function `%R' is not callable", Z_TYPE(callable), Z_UNIVAL(callable));
                zval_dtor(&callable);
                return;
        }
        zval_dtor(&callable);
 
-       if (!zend_is_callable(zfinal, 0, &callable)) {
+       if (!zend_is_callable(zfinal, 0, &callable TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "finalize function `%R' is not callable", Z_TYPE(callable), Z_UNIVAL(callable));
                zval_dtor(&callable);
                return;
@@ -3607,7 +3607,7 @@ PHP_FUNCTION(sqlite_create_function)
                DB_FROM_ZVAL(db, &zdb);
        }
 
-       if (!zend_is_callable(zcall, 0, &callable)) {
+       if (!zend_is_callable(zcall, 0, &callable TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "function `%R' is not callable", Z_TYPE(callable), Z_UNIVAL(callable));
                zval_dtor(&callable);
                return;
index 27c55e1ae38c15e409fed20b4344264bfa4c3fba..7b33edb6988e83ed7cf6bda5dde8d4a44f3105be 100644 (file)
@@ -801,7 +801,7 @@ PHP_METHOD(sqlite3, createFunction)
                RETURN_FALSE;
        }
 
-       if (!zend_is_callable(callback_func, 0, &callback_name)) {
+       if (!zend_is_callable(callback_func, 0, &callback_name TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a valid callback function %R", Z_TYPE(callback_name), Z_UNIVAL(callback_name));
                zval_dtor(&callback_name);
                RETURN_FALSE;
@@ -853,14 +853,14 @@ PHP_METHOD(sqlite3, createAggregate)
                RETURN_FALSE;
        }
 
-       if (!zend_is_callable(step_callback, 0, &callback_name)) {
+       if (!zend_is_callable(step_callback, 0, &callback_name TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a valid callback function %R", Z_TYPE(callback_name), Z_UNIVAL(callback_name));
                zval_dtor(&callback_name);
                RETURN_FALSE;
        }
        zval_dtor(&callback_name);
 
-       if (!zend_is_callable(fini_callback, 0, &callback_name)) {
+       if (!zend_is_callable(fini_callback, 0, &callback_name TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a valid callback function %R", Z_TYPE(callback_name), Z_UNIVAL(callback_name));
                zval_dtor(&callback_name);
                RETURN_FALSE;
index 6b9021d4da06daf5aeb72e6096fd0bf2d95dfa3d..fe0da876443b484ccb0f485317c31641526dd42d 100644 (file)
@@ -628,7 +628,7 @@ static int php_array_user_compare(const void *a, const void *b TSRMLS_DC) /* {{{
 
 /* check if comparison function is valid */
 #define PHP_ARRAY_CMP_FUNC_CHECK(func_name)    \
-       if (!zend_is_callable(*func_name, 0, NULL)) {   \
+       if (!zend_is_callable(*func_name, 0, NULL TSRMLS_CC)) { \
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid comparison function");     \
                BG(user_compare_fci) = old_user_compare_fci; \
                BG(user_compare_fci_cache) = old_user_compare_fci_cache; \
index e29e7caff7b1d1ee2d8f0f4247e5fb53fd864dc5..7a55928b70a9882247889d0035bd7aaf6d9e7847 100644 (file)
@@ -5298,7 +5298,7 @@ static int user_shutdown_function_call(php_shutdown_function_entry *shutdown_fun
        zval retval;
        zval function_name;
 
-       if (!zend_is_callable(shutdown_function_entry->arguments[0], 0, &function_name)) {
+       if (!zend_is_callable(shutdown_function_entry->arguments[0], 0, &function_name TSRMLS_CC)) {
                php_error(E_WARNING, "(Registered shutdown functions) Unable to call %R() - function does not exist", Z_TYPE(function_name), Z_UNIVAL(function_name));
                zval_dtor(&function_name);
                return 0;
@@ -5441,7 +5441,7 @@ PHP_FUNCTION(register_shutdown_function)
        }
 
        /* Prevent entering of anything but valid callback (syntax check only!) */
-       if (!zend_is_callable(shutdown_function_entry.arguments[0], 0, &function_name)) {
+       if (!zend_is_callable(shutdown_function_entry.arguments[0], 0, &function_name TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid shutdown callback '%R' passed", Z_TYPE(function_name), Z_UNIVAL(function_name));
                efree(shutdown_function_entry.arguments);
                RETVAL_FALSE;
index 19ca9d03be51e669e58c520aefc6449de2188776..9fde3a4951967c7d2f80549977659158a454254e 100644 (file)
@@ -470,10 +470,10 @@ PHP_FUNCTION(is_callable)
 
        syntax_only = syntax_only ? IS_CALLABLE_CHECK_SYNTAX_ONLY : 0;
        if (ZEND_NUM_ARGS() > 2) {
-               retval = zend_is_callable(var, syntax_only, &name);
+               retval = zend_is_callable(var, syntax_only, &name TSRMLS_CC);
                REPLACE_ZVAL_VALUE(callable_name, &name, 0);
        } else {
-               retval = zend_is_callable(var, syntax_only, NULL);
+               retval = zend_is_callable(var, syntax_only, NULL TSRMLS_CC);
        }
 
        RETURN_BOOL(retval);
index e1d706b96fed84429203fcb74eb39fffaf63bd5a..575f10ef09fba0615200fceb108542a0685d70c0 100644 (file)
@@ -2363,7 +2363,7 @@ PHP_FUNCTION(sybase_set_message_handler)
                case IS_ARRAY:
                case IS_STRING:
                        /* Either "function", array("class", "function") or array($object, "function") */
-                       if (!zend_is_callable(*param, 0, &name)) {
+                       if (!zend_is_callable(*param, 0, &name TSRMLS_CC)) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "First argumented is expected to be a valid callback, '%R' was given", Z_TYPE(name), Z_UNIVAL(name));
                                zval_dtor(&name);
                                RETURN_FALSE;
index 6baf59611ee4f98fcfcceb8c1126779db994a20f..c7ecf3d9f9fb3b9b8180d1a16b2d26147aecc4c9 100644 (file)
@@ -868,7 +868,7 @@ PHP_FUNCTION(char_enum_names)
         return;               
     }   
     
-       if (!zend_is_callable(callback, 0, NULL)) {
+       if (!zend_is_callable(callback, 0, NULL TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid enumeration callback");
                return;
        }
@@ -927,7 +927,7 @@ PHP_FUNCTION(char_enum_types)
         return;               
     }   
     
-       if (!zend_is_callable(callback, 0, NULL)) {
+       if (!zend_is_callable(callback, 0, NULL TSRMLS_CC)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid enumeration callback");
                return;
        }
index d81eb2aae65cff71a419b1c85dd90b30ff526e30..6a0fc09c45bc9d9975d5adf01f1c99c321323582 100644 (file)
@@ -237,7 +237,7 @@ PHP_FUNCTION(unicode_set_error_handler)
        }
 
        if (Z_TYPE_P(error_handler) != IS_NULL) { /* NULL == unset */
-               if (!zend_is_callable(error_handler, 0, &error_handler_name)) {
+               if (!zend_is_callable(error_handler, 0, &error_handler_name TSRMLS_CC)) {
                        zend_error(E_WARNING, "%v() expects the argument (%R) to be a valid callback",
                                           get_active_function_name(TSRMLS_C), Z_TYPE(error_handler_name), Z_UNIVAL(error_handler_name));
                        zval_dtor(&error_handler_name);
index 825b263ff3be40509951d8af78fa5d60ebe7c8b8..835688ad4d8c911200181d3465d035edba1d1b28 100644 (file)
@@ -964,7 +964,7 @@ static void php_xmlrpc_introspection_callback(XMLRPC_SERVER server, void* data)
        zend_hash_internal_pointer_reset(Z_ARRVAL_P(pData->server->introspection_map));
        while(1) {
                if(zend_hash_get_current_data(Z_ARRVAL_P(pData->server->introspection_map), (void**)&php_function) == SUCCESS) {
-                       if (zend_is_callable(*php_function, 0, &php_function_name)) {
+                       if (zend_is_callable(*php_function, 0, &php_function_name TSRMLS_CC)) {
                                /* php func prototype: function string user_func($user_params) */
                                if (call_user_function(CG(function_table), NULL, *php_function, &retval, 1, callback_params TSRMLS_CC) == SUCCESS) {
                                        XMLRPC_VALUE xData;