Changeset 1045 for trunk/xcache.c
- Timestamp:
- 2012-07-25T11:32:11+02:00 (10 months ago)
- File:
-
- 1 edited
-
trunk/xcache.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/xcache.c
r1040 r1045 39 39 40 40 static zend_compile_file_t *old_compile_file = NULL; 41 static zend_llist_element *xc_llist_zend_extension = NULL;42 41 43 42 zend_bool xc_test = 0; … … 544 543 #endif 545 544 546 static startup_func_t xc_last_ext_startup; 545 static startup_func_t xc_last_ext_old_startup; 546 static xc_stack_t xc_llist_zend_extensions; /* (zend_extension *) */ 547 547 static int xc_zend_startup_last_hook(zend_extension *extension) /* {{{ */ 548 548 { … … 552 552 } 553 553 /* restore */ 554 extension->startup = xc_last_ext_startup; 554 extension->startup = xc_last_ext_old_startup; 555 extension->startup = xc_last_ext_old_startup; 556 xc_last_ext_old_startup = NULL; 555 557 if (extension->startup) { 556 558 if (extension->startup(extension) != SUCCESS) { … … 558 560 } 559 561 } 560 assert(xc_llist_zend_extension); 561 xcache_llist_prepend(&zend_extensions, xc_llist_zend_extension); 562 563 assert(xc_stack_count(&xc_llist_zend_extensions)); 564 while (xc_stack_count(&xc_llist_zend_extensions)) { 565 zend_llist_element *p = (zend_llist_element *) xc_stack_pop(&xc_llist_zend_extensions); 566 xcache_llist_prepend(&zend_extensions, p); 567 } 568 xc_stack_destroy(&xc_llist_zend_extensions); 562 569 return SUCCESS; 563 570 } … … 568 575 zend_compile_file = xc_check_initial_compile_file; 569 576 570 if ( zend_llist_count(&zend_extensions) > 1) {577 if (1 || xcache_zend_extension_count_by_prefix(&zend_extensions, XCACHE_NAME) != zend_llist_count(&zend_extensions)) { 571 578 zend_llist_position lpos; 572 zend_extension *ext ;573 574 xc_llist_zend_extension = xcache_llist_get_element_by_zend_extension(&zend_extensions, XCACHE_NAME); 575 if ( xc_llist_zend_extension != zend_extensions.head) {576 zend_error(E_WARNING, "XCache failed to load itself as the first zend_extension. compatibility downgraded");577 } 578 579 /* hide myself*/580 /* TODO: hide handle sub modules */581 xcache_ llist_unlink(&zend_extensions, xc_llist_zend_extension);579 zend_extension *ext = (zend_extension *) zend_extensions.head->data; 580 assert(ext); 581 582 if (strcmp(ext->name, XCACHE_NAME) != 0) { 583 zend_error(E_WARNING, "XCache failed to load itself as the before \"%s\". compatibility downgraded", ext->name); 584 } 585 586 /* hide XCache modules */ 587 xc_stack_init(&xc_llist_zend_extensions); 588 xcache_zend_extension_unlink_by_prefix(&xc_llist_zend_extensions, &zend_extensions, XCACHE_NAME); 582 589 583 590 ext = (zend_extension *) zend_llist_get_last_ex(&zend_extensions, &lpos); 584 assert(ext && ext != (zend_extension *) xc_llist_zend_extension->data);585 xc_last_ext_ startup = ext->startup;591 assert(ext); 592 xc_last_ext_old_startup = ext->startup; 586 593 ext->startup = xc_zend_startup_last_hook; 587 594 } … … 638 645 static PHP_MINIT_FUNCTION(xcache) /* {{{ */ 639 646 { 640 /* must be the first */641 xcache_zend_extension_register(&xc_zend_extension_entry, 1);642 643 647 #ifndef PHP_GINIT 644 648 ZEND_INIT_MODULE_GLOBALS(xcache, xc_init_globals, xc_shutdown_globals); … … 653 657 xc_shm_init_modules(); 654 658 659 /* ZendExtension is registered in reverse order for prepend by XCache */ 660 #ifdef HAVE_XCACHE_COVERAGER 661 xc_coverager_startup_module(); 662 #endif 663 #ifdef HAVE_XCACHE_DISASSEMBLER 664 xc_disassembler_startup_module(); 665 #endif 666 #ifdef HAVE_XCACHE_CACHER 667 xc_cacher_startup_module(); 668 #endif 655 669 #ifdef HAVE_XCACHE_OPTIMIZER 656 670 xc_optimizer_startup_module(); 657 671 #endif 658 #ifdef HAVE_XCACHE_CACHER 659 xc_cacher_startup_module(); 660 #endif 661 #ifdef HAVE_XCACHE_COVERAGER 662 xc_coverager_startup_module(); 663 #endif 664 #ifdef HAVE_XCACHE_DISASSEMBLER 665 xc_disassembler_startup_module(); 666 #endif 672 /* must be the first */ 673 xcache_zend_extension_prepend(&xc_zend_extension_entry); 674 667 675 return SUCCESS; 668 676 … … 694 702 695 703 UNREGISTER_INI_ENTRIES(); 696 xcache_zend_extension_ unregister(&xc_zend_extension_entry);704 xcache_zend_extension_remove(&xc_zend_extension_entry); 697 705 return SUCCESS; 698 706 }
Note: See TracChangeset
for help on using the changeset viewer.

