Changeset 190


Ignore:
Timestamp:
2006-09-20T02:25:56+02:00 (8 years ago)
Author:
moo
Message:

trick to load and work with zend optimizer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache.c

    r189 r190  
    22942294    } 
    22952295 
     2296    ext = zend_get_extension("Zend Optimizer"); 
     2297    if (ext) { 
     2298        /* zend_optimizer.optimization_level>0 is not compatible with other cacher, disabling */ 
     2299        ext->op_array_handler = NULL; 
     2300    } 
    22962301    /* cache if there's an op_array_ctor */ 
    22972302    for (ext = zend_llist_get_first_ex(&zend_extensions, &lpos); 
     
    24552460#endif 
    24562461/* }}} */ 
     2462static startup_func_t xc_last_ext_startup; 
     2463static zend_llist_element *xc_llist_element; 
     2464static xc_ptr_compare_func(void *p1, void *p2) /* {{{ */ 
     2465{ 
     2466    return p1 == p2; 
     2467} 
     2468/* }}} */ 
     2469static int xc_zend_startup_last(zend_extension *extension) /* {{{ */ 
     2470{ 
     2471    /* restore */ 
     2472    extension->startup = xc_last_ext_startup; 
     2473    if (extension->startup) { 
     2474        if (extension->startup(extension) != SUCCESS) { 
     2475            return FAILURE; 
     2476        } 
     2477    } 
     2478    xc_zend_extension_register(&zend_extension_entry, 0); 
     2479    if (!xc_module_gotup) { 
     2480        return zend_startup_module(&xcache_module_entry); 
     2481    } 
     2482    return SUCCESS; 
     2483} 
     2484/* }}} */ 
    24572485ZEND_DLEXPORT int xcache_zend_startup(zend_extension *extension) /* {{{ */ 
    24582486{ 
     
    24612489    } 
    24622490    xc_zend_extension_gotup = 1; 
    2463     if (!xc_module_gotup) { 
     2491    xc_llist_element = NULL; 
     2492    if (zend_llist_count(&zend_extensions) > 1) { 
     2493        zend_llist_position lpos; 
     2494        zend_extension *ext; 
     2495        llist_dtor_func_t dtor; 
     2496 
     2497        ext = zend_get_extension(XCACHE_NAME); 
     2498        assert(ext); 
     2499        dtor = zend_extensions.dtor; /* avoid dtor */ 
     2500        zend_extensions.dtor = NULL; 
     2501        zend_llist_del_element(&zend_extensions, ext, xc_ptr_compare_func); 
     2502        zend_extensions.dtor = dtor; 
     2503 
     2504        ext = (zend_extension *) zend_llist_get_last_ex(&zend_extensions, &lpos); 
     2505        assert(ext); 
     2506        xc_last_ext_startup = ext->startup; 
     2507        ext->startup = xc_zend_startup_last; 
     2508    } 
     2509    else if (!xc_module_gotup) { 
    24642510        return zend_startup_module(&xcache_module_entry); 
    24652511    } 
Note: See TracChangeset for help on using the changeset viewer.