Changeset 405
Legend:
- Unmodified
- Added
- Removed
-
trunk/utils.c
r393 r405 624 624 } 625 625 /* }}} */ 626 static void xc_sandbox_install(xc_sandbox_t *sandbox TSRMLS_DC) /* {{{ */626 static void xc_sandbox_install(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_DC) /* {{{ */ 627 627 { 628 628 int i; … … 668 668 #endif 669 669 670 xc_undo_pass_two(CG(active_op_array) TSRMLS_CC); 671 xc_foreach_early_binding_class(CG(active_op_array), xc_early_binding_cb, (void *) sandbox TSRMLS_CC); 672 xc_redo_pass_two(CG(active_op_array) TSRMLS_CC); 670 if (install != XC_InstallNoBinding) { 671 xc_undo_pass_two(CG(active_op_array) TSRMLS_CC); 672 xc_foreach_early_binding_class(CG(active_op_array), xc_early_binding_cb, (void *) sandbox TSRMLS_CC); 673 xc_redo_pass_two(CG(active_op_array) TSRMLS_CC); 674 } 673 675 674 676 i = 1; … … 676 678 } 677 679 /* }}} */ 678 void xc_sandbox_free(xc_sandbox_t *sandbox, int install TSRMLS_DC) /* {{{ */680 void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_DC) /* {{{ */ 679 681 { 680 682 /* restore first first install function/class */ … … 689 691 #endif 690 692 691 if (install ) {693 if (install != XC_NoInstall) { 692 694 CG(in_compilation) = 1; 693 695 CG(compiled_filename) = sandbox->filename; 694 696 CG(zend_lineno) = 0; 695 xc_sandbox_install(sandbox TSRMLS_CC);697 xc_sandbox_install(sandbox, install TSRMLS_CC); 696 698 CG(in_compilation) = 0; 697 699 CG(compiled_filename) = NULL; -
trunk/utils.h
r393 r405 100 100 } xc_sandbox_t; 101 101 102 typedef enum _xc_install_action_t { 103 XC_NoInstall, 104 XC_Install, 105 XC_InstallNoBinding 106 } xc_install_action_t; 107 102 108 void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce)); 103 109 xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC); 104 void xc_sandbox_free(xc_sandbox_t *sandbox, int install TSRMLS_DC);110 void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_DC); -
trunk/xcache.c
r403 r405 87 87 88 88 static zend_bool xc_initized = 0; 89 static zend_compile_file_t *origin_compile_file = NULL; 89 90 static zend_compile_file_t *old_compile_file = NULL; 90 91 static zend_llist_element *xc_llist_zend_extension = NULL; … … 974 975 old_constinfo_cnt = zend_hash_num_elements(EG(zend_constants)); 975 976 977 php->op_array = NULL; 978 XG(initial_compile_file_called) = 0; 976 979 zend_try { 977 980 op_array = old_compile_file(h, type TSRMLS_CC); … … 986 989 if (op_array == NULL) { 987 990 goto err_op_array; 991 } 992 993 if (!XG(initial_compile_file_called)) { 994 return op_array; 988 995 } 989 996 … … 1164 1171 } 1165 1172 /* }}} */ 1173 static zend_op_array *xc_check_initial_compile_file(zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ 1174 { 1175 XG(initial_compile_file_called) = 1; 1176 return origin_compile_file(h, type TSRMLS_CC); 1177 } 1178 /* }}} */ 1166 1179 static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ 1167 1180 { … … 1290 1303 } 1291 1304 1305 /* not cachable */ 1306 if (!php.op_array) { 1307 cache->compiling = 0; 1308 xc_sandbox_free(&sandbox, XC_InstallNoBinding TSRMLS_CC); 1309 return op_array; 1310 } 1311 1292 1312 xce.data.php = &php; 1293 1313 } … … 1355 1375 } 1356 1376 if (newlycompiled) { 1357 xc_sandbox_free(&sandbox, 0TSRMLS_CC);1377 xc_sandbox_free(&sandbox, XC_NoInstall TSRMLS_CC); 1358 1378 } 1359 1379 return xc_compile_restore(stored_xce, h TSRMLS_CC); … … 1363 1383 /* install it */ 1364 1384 CG(active_op_array) = op_array; 1365 xc_sandbox_free(&sandbox, 1TSRMLS_CC);1385 xc_sandbox_free(&sandbox, XC_Install TSRMLS_CC); 1366 1386 } 1367 1387 } … … 1371 1391 if (newlycompiled) { 1372 1392 xc_free_php(&php TSRMLS_CC); 1373 xc_sandbox_free(&sandbox, 0TSRMLS_CC);1393 xc_sandbox_free(&sandbox, XC_NoInstall TSRMLS_CC); 1374 1394 } 1375 1395 … … 1564 1584 zend_compile_file = old_compile_file; 1565 1585 old_compile_file = NULL; 1586 } 1587 1588 if (origin_compile_file) { 1589 zend_compile_file = origin_compile_file; 1590 origin_compile_file = NULL; 1566 1591 } 1567 1592 … … 2915 2940 #endif 2916 2941 /* }}} */ 2917 static startup_func_t xc_last_ext_startup = NULL;2942 static startup_func_t xc_last_ext_startup; 2918 2943 static int xc_zend_startup_last(zend_extension *extension) /* {{{ */ 2919 2944 { … … 2936 2961 { 2937 2962 xc_zend_extension_gotup = 1; 2963 2964 if (!origin_compile_file) { 2965 origin_compile_file = zend_compile_file; 2966 zend_compile_file = xc_check_initial_compile_file; 2967 } 2968 2938 2969 if (zend_llist_count(&zend_extensions) > 1) { 2939 2970 zend_llist_position lpos; -
trunk/xcache_globals.h
r399 r405 1 1 2 2 ZEND_BEGIN_MODULE_GLOBALS(xcache) 3 zend_bool initial_compile_file_called; /* true is origin_compile_file is called */ 3 4 zend_bool cacher; /* true if enabled */ 4 5 zend_bool stat;

