From 8c885b89130e3549297316c0769b27d9d3657902 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 18 Mar 2008 08:36:30 +0000 Subject: Implemented concept of "delayed early binding" that allows opcode caches to perform class declaration (early and/or run-time binding) in exactly the same order as vanila php. The following pseudo-code explains how it should be used in opcode cache. function cache_compile_file($filename) { if (!is_cached($filename)) { ... orig_compiler_options = CG(compiler_optins); CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES | ZEND_COMPILE_DELAYED_BINDING; $op_array = orig_compile_file($filename); CG(compiler_options) = orig_copiler_options; ... } else { $op_array = restore_from_cache($filename); } zend_do_delayed_early_binding($op_array); } --- Zend/zend.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Zend/zend.c') diff --git a/Zend/zend.c b/Zend/zend.c index 5d8eeffd01..97fe82080c 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -443,15 +443,15 @@ static void register_standard_class(TSRMLS_D) /* {{{ */ /* }}} */ #ifdef ZTS -static zend_bool asp_tags_default = 0; -static zend_bool short_tags_default = 1; -static zend_bool ct_pass_ref_default = 1; -static zend_bool extended_info_default = 0; +static zend_bool asp_tags_default = 0; +static zend_bool short_tags_default = 1; +static zend_bool ct_pass_ref_default = 1; +static zend_uint compiler_options_default = ZEND_COMPILE_DEFAULT; #else -# define asp_tags_default 0 -# define short_tags_default 1 -# define ct_pass_ref_default 1 -# define extended_info_default 0 +# define asp_tags_default 0 +# define short_tags_default 1 +# define ct_pass_ref_default 1 +# define compiler_options_default ZEND_COMPILE_DEFAULT #endif static void zend_set_default_compile_time_values(TSRMLS_D) /* {{{ */ @@ -460,7 +460,7 @@ static void zend_set_default_compile_time_values(TSRMLS_D) /* {{{ */ CG(asp_tags) = asp_tags_default; CG(short_tags) = short_tags_default; CG(allow_call_time_pass_reference) = ct_pass_ref_default; - CG(extended_info) = extended_info_default; + CG(compiler_options) = compiler_options_default; } /* }}} */ @@ -721,7 +721,7 @@ void zend_post_startup(TSRMLS_D) /* {{{ */ asp_tags_default = CG(asp_tags); short_tags_default = CG(short_tags); ct_pass_ref_default = CG(allow_call_time_pass_reference); - extended_info_default = CG(extended_info); + compiler_options_default = CG(compiler_options); zend_destroy_rsrc_list(&EG(persistent_list) TSRMLS_CC); free(compiler_globals->function_table); -- cgit v1.2.1