Commit: 987dee9ca1be517f4be02d9c8f721d569596dc5a Author: Dmitry Stogov <dmi...@zend.com> Mon, 25 Mar 2013 12:21:58 +0400 Parents: a3316ffe6a05d86c9b49d37c5ac9ed101c606d86 Branches: PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=987dee9ca1be517f4be02d9c8f721d569596dc5a Log: Fixed PHP-5.2 ZTS compatibility Changed paths: M ext/opcache/Optimizer/block_pass.c M ext/opcache/Optimizer/pass1_5.c M ext/opcache/ZendAccelerator.c M ext/opcache/zend_accelerator_util_funcs.c Diff: diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index d4299c8..7fd986c 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -972,7 +972,11 @@ static void zend_optimize_block(zend_code_block *block, zend_op_array *op_array, zval result; if (unary_op) { +#if ZEND_EXTENSION_API_NO < PHP_5_3_X_API_NO + unary_op(&result, &ZEND_OP1_LITERAL(opline)); +#else unary_op(&result, &ZEND_OP1_LITERAL(opline) TSRMLS_CC); +#endif literal_dtor(&ZEND_OP1_LITERAL(opline)); } else { /* BOOL */ diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 8938e14..dc9e731 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -203,7 +203,11 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) { er = EG(error_reporting); EG(error_reporting) = 0; +#if ZEND_EXTENSION_API_NO < PHP_5_3_X_API_NO + if (unary_op(&result, &ZEND_OP1_LITERAL(opline)) != SUCCESS) { +#else if (unary_op(&result, &ZEND_OP1_LITERAL(opline) TSRMLS_CC) != SUCCESS) { +#endif EG(error_reporting) = er; break; } diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 64c5aa8..e634c13 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -1204,10 +1204,18 @@ static zend_persistent_script *compile_and_cache_file(zend_file_handle *file_han } else { *op_array_p = NULL; if (type == ZEND_REQUIRE) { +#if ZEND_EXTENSION_API_NO < PHP_5_3_X_API_NO + zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename); +#else zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC); +#endif zend_bailout(); } else { +#if ZEND_EXTENSION_API_NO < PHP_5_3_X_API_NO + zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename); +#else zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename TSRMLS_CC); +#endif } return NULL; } @@ -1422,10 +1430,18 @@ static zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int zend_stream_open(file_handle->filename, file_handle TSRMLS_CC) == FAILURE) { #endif if (type == ZEND_REQUIRE) { +#if ZEND_EXTENSION_API_NO < PHP_5_3_X_API_NO + zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename); +#else zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC); +#endif zend_bailout(); } else { +#if ZEND_EXTENSION_API_NO < PHP_5_3_X_API_NO + zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename); +#else zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename TSRMLS_CC); +#endif } return NULL; } @@ -1542,7 +1558,11 @@ static zend_op_array *persistent_compile_file(zend_file_handle *file_handle, int zend_hash_quick_add(&EG(included_files), persistent_script->full_path, persistent_script->full_path_len + 1, persistent_script->hash_value, &dummy, sizeof(void *), NULL); } } +#if ZEND_EXTENSION_API_NO < PHP_5_3_X_API_NO + zend_file_handle_dtor(file_handle); +#else zend_file_handle_dtor(file_handle TSRMLS_CC); +#endif from_shared_memory = 1; } diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index 7d5028c..75b1561 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -857,7 +857,7 @@ static void zend_do_delayed_early_binding(zend_op_array *op_array, zend_uint ear } opline_num = op_array->opcodes[opline_num].result.u.opline_num; } - zend_restore_compiled_filename(orig_compiled_filename); + zend_restore_compiled_filename(orig_compiled_filename TSRMLS_CC); CG(in_compilation) = orig_in_compilation; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php