1
0
Fork 0

cacher: trick in_compilation state, don't trigger !__autoload at compile time

git-svn-id: svn://svn.lighttpd.net/xcache/trunk@235 c26eb9a1-5813-0410-bd6c-c2e55f420ca7
1.2
Xuefer 17 years ago
parent 4972944303
commit 784cff26d0

@ -424,8 +424,6 @@ void xc_install_constant(char *filename, zend_constant *constant, zend_uchar typ
constant, sizeof(zend_constant),
NULL
) == FAILURE) {
CG(in_compilation) = 1;
CG(compiled_filename) = filename;
CG(zend_lineno) = 0;
#ifdef IS_UNICODE
zend_error(E_NOTICE, "Constant %R already defined", type, key);
@ -460,8 +458,6 @@ void xc_install_function(char *filename, zend_function *func, zend_uchar type, z
func, sizeof(zend_op_array),
NULL
) == FAILURE) {
CG(in_compilation) = 1;
CG(compiled_filename) = filename;
CG(zend_lineno) = ZESW(func->op_array.opcodes[0].lineno, func->op_array.line_start);
#ifdef IS_UNICODE
zend_error(E_ERROR, "Cannot redeclare %R()", type, key);
@ -496,8 +492,6 @@ ZESW(xc_cest_t *, void) xc_install_class(char *filename, xc_cest_t *cest, int op
cest, sizeof(xc_cest_t),
ZESW(&stored_ce_ptr, NULL)
) == FAILURE) {
CG(in_compilation) = 1;
CG(compiled_filename) = filename;
CG(zend_lineno) = ZESW(0, cep->line_start);
#ifdef IS_UNICODE
zend_error(E_ERROR, "Cannot redeclare class %R", type, cep->name);
@ -618,7 +612,12 @@ void xc_sandbox_free(xc_sandbox_t *sandbox, int install TSRMLS_DC) /* {{{ */
EG(class_table) = CG(class_table);
if (install) {
CG(in_compilation) = 1;
CG(compiled_filename) = sandbox->filename;
CG(zend_lineno) = 0;
xc_sandbox_install(sandbox TSRMLS_CC);
CG(in_compilation) = 0;
CG(compiled_filename) = NULL;
/* no free as it's installed */
#ifdef HAVE_XCACHE_CONSTANT

@ -1074,6 +1074,9 @@ err_bailout:
return op_array;
restore:
CG(in_compilation) = 1;
CG(compiled_filename) = stored_xce->name.str.val;
CG(zend_lineno) = 0;
#ifdef DEBUG
fprintf(stderr, "restoring\n");
#endif
@ -1104,6 +1107,8 @@ restore:
if (catched) {
zend_bailout();
}
CG(in_compilation) = 0;
CG(compiled_filename) = NULL;
#ifdef DEBUG
fprintf(stderr, "restored\n");
#endif

Loading…
Cancel
Save