Changeset 408 for branches/1.2


Ignore:
Timestamp:
2007-05-31T06:20:14+02:00 (7 years ago)
Author:
moo
Message:

merged [405] [407] from trunk: fixed #92, full ZendOptimizer? compatibility

Location:
branches/1.2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/1.2

  • branches/1.2/ChangeLog

    r396 r408  
    55== ChangeLog == 
    66 * #86: remove/edit variable in admin page 
     7 * fixed #92: Zend Optimizer compatibility issue 
    78 * fixed #77: hits/misses was not updated 
    89 * fixed #59: pass by reference for internal function was broken 
  • branches/1.2/NEWS

    r396 r408  
    111.2.1 2007-?-? 
     2======== 
     3 * full Zend Optimizer compatibility 
    24 * ini settings changed 
    3  * bug fixes 
     5 * other bug fixes 
    46 
    5 ======== 
    671.2.0 2006-12-10 
    7 NEWS 
    88======== 
    99 * full 5.2 support 
  • branches/1.2/utils.c

    r394 r408  
    630630} 
    631631/* }}} */ 
    632 static void xc_sandbox_install(xc_sandbox_t *sandbox TSRMLS_DC) /* {{{ */ 
     632static void xc_sandbox_install(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_DC) /* {{{ */ 
    633633{ 
    634634    int i; 
     
    674674#endif 
    675675 
    676     xc_undo_pass_two(CG(active_op_array) TSRMLS_CC); 
    677     xc_foreach_early_binding_class(CG(active_op_array), xc_early_binding_cb, (void *) sandbox TSRMLS_CC); 
    678     xc_redo_pass_two(CG(active_op_array) TSRMLS_CC); 
     676    if (install != XC_InstallNoBinding) { 
     677        xc_undo_pass_two(CG(active_op_array) TSRMLS_CC); 
     678        xc_foreach_early_binding_class(CG(active_op_array), xc_early_binding_cb, (void *) sandbox TSRMLS_CC); 
     679        xc_redo_pass_two(CG(active_op_array) TSRMLS_CC); 
     680    } 
    679681 
    680682    i = 1; 
     
    682684} 
    683685/* }}} */ 
    684 void xc_sandbox_free(xc_sandbox_t *sandbox, int install TSRMLS_DC) /* {{{ */ 
     686void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_DC) /* {{{ */ 
    685687{ 
    686688    /* restore first first install function/class */ 
     
    695697#endif 
    696698 
    697     if (install) { 
     699    if (install != XC_NoInstall) { 
    698700        CG(in_compilation)    = 1; 
    699701        CG(compiled_filename) = sandbox->filename; 
    700702        CG(zend_lineno)       = 0; 
    701         xc_sandbox_install(sandbox TSRMLS_CC); 
     703        xc_sandbox_install(sandbox, install TSRMLS_CC); 
    702704        CG(in_compilation)    = 0; 
    703705        CG(compiled_filename) = NULL; 
  • branches/1.2/utils.h

    r394 r408  
    5757} xc_sandbox_t; 
    5858 
     59typedef enum _xc_install_action_t { 
     60    XC_NoInstall, 
     61    XC_Install, 
     62    XC_InstallNoBinding 
     63} xc_install_action_t; 
     64 
    5965void xc_zend_class_add_ref(zend_class_entry ZESW(*ce, **ce)); 
    6066xc_sandbox_t *xc_sandbox_init(xc_sandbox_t *sandbox, char *filename TSRMLS_DC); 
    61 void xc_sandbox_free(xc_sandbox_t *sandbox, int install TSRMLS_DC); 
     67void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_DC); 
  • branches/1.2/xcache.c

    r406 r408  
    9898 
    9999static zend_bool xc_initized = 0; 
     100static zend_compile_file_t *origin_compile_file = NULL; 
    100101static zend_compile_file_t *old_compile_file = NULL; 
    101102static zend_llist_element  *xc_llist_zend_extension = NULL; 
     
    838839} 
    839840/* }}} */ 
     841static zend_op_array *xc_check_initial_compile_file(zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ 
     842{ 
     843    XG(initial_compile_file_called) = 1; 
     844    return origin_compile_file(h, type TSRMLS_CC); 
     845} 
     846/* }}} */ 
    840847static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ 
    841848{ 
     
    941948    old_constinfo_cnt  = zend_hash_num_elements(EG(zend_constants)); 
    942949 
     950    XG(initial_compile_file_called) = 0; 
    943951    zend_try { 
    944952        op_array = old_compile_file(h, type TSRMLS_CC); 
     
    954962        goto err_oparray; 
    955963    } 
     964 
     965    if (!XG(initial_compile_file_called)) { 
     966        xc_sandbox_free(&sandbox, XC_InstallNoBinding TSRMLS_CC); 
     967        return op_array; 
     968    } 
    956969 
    957970    filename = h->opened_path ? h->opened_path : h->filename; 
     
    11251138    if (xc_test && stored_xce) { 
    11261139        /* free it, no install. restore now */ 
    1127         xc_sandbox_free(&sandbox, 0 TSRMLS_CC); 
     1140        xc_sandbox_free(&sandbox, XC_NoInstall TSRMLS_CC); 
    11281141    } 
    11291142    else if (!op_array) { 
    11301143        /* failed to compile free it, no install */ 
    1131         xc_sandbox_free(&sandbox, 0 TSRMLS_CC); 
     1144        xc_sandbox_free(&sandbox, XC_NoInstall TSRMLS_CC); 
    11321145    } 
    11331146    else { 
    11341147        CG(active_op_array) = op_array; 
    1135         xc_sandbox_free(&sandbox, 1 TSRMLS_CC); 
     1148        xc_sandbox_free(&sandbox, XC_Install TSRMLS_CC); 
    11361149    } 
    11371150 
     
    13781391        zend_compile_file = old_compile_file; 
    13791392        old_compile_file = NULL; 
     1393    } 
     1394 
     1395    if (origin_compile_file) { 
     1396        zend_compile_file = origin_compile_file; 
     1397        origin_compile_file = NULL; 
    13801398    } 
    13811399 
     
    27462764#endif 
    27472765/* }}} */ 
    2748 static startup_func_t xc_last_ext_startup = NULL; 
     2766static startup_func_t xc_last_ext_startup; 
    27492767static int xc_zend_startup_last(zend_extension *extension) /* {{{ */ 
    27502768{ 
     
    27672785{ 
    27682786    xc_zend_extension_gotup = 1; 
     2787 
     2788    if (!origin_compile_file) { 
     2789        origin_compile_file = zend_compile_file; 
     2790        zend_compile_file = xc_check_initial_compile_file; 
     2791    } 
     2792 
    27692793    if (zend_llist_count(&zend_extensions) > 1) { 
    27702794        zend_llist_position lpos; 
  • branches/1.2/xcache_globals.h

    r394 r408  
    11 
    22ZEND_BEGIN_MODULE_GLOBALS(xcache) 
     3    zend_bool initial_compile_file_called; /* true is origin_compile_file is called */ 
    34    zend_bool cacher;      /* true if enabled */ 
    45    zend_bool stat; 
Note: See TracChangeset for help on using the changeset viewer.