Ignore:
Timestamp:
2012-07-22T08:26:35+02:00 (3 years ago)
Author:
Xuefer
Message:

refactor: split extension init to sub module. TODO: compatibility regression

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mod_optimizer/xc_optimizer.c

    r1008 r1026  
    33#endif
    44
     5#include "xc_optimizer.h"
     6#include "xcache/xc_extension.h"
     7#include "xcache/xc_ini.h"
    58#include "xcache/xc_utils.h"
    6 #include "xc_optimizer.h"
    7 /* the "vector" stack */
    89#include "util/xc_stack.h"
    910#include "util/xc_trace.h"
    1011#include "xcache_globals.h"
     12
     13#include "ext/standard/info.h"
    1114
    1215#ifdef XCACHE_DEBUG
     
    607610}
    608611/* }}} */
    609 void xc_optimizer_op_array_handler(zend_op_array *op_array) /* {{{ */
     612static void xc_optimizer_op_array_handler(zend_op_array *op_array) /* {{{ */
    610613{
    611614    TSRMLS_FETCH();
     
    615618}
    616619/* }}} */
     620
     621static int xc_zend_startup(zend_extension *extension) /* {{{ */
     622{
     623    return SUCCESS;
     624}
     625/* }}} */
     626static void xc_zend_shutdown(zend_extension *extension) /* {{{ */
     627{
     628}
     629/* }}} */
     630/* {{{ zend extension definition structure */
     631static zend_extension xc_optimizer_zend_extension_entry = {
     632    XCACHE_NAME " Optimizer",
     633    XCACHE_VERSION,
     634    XCACHE_AUTHOR,
     635    XCACHE_URL,
     636    XCACHE_COPYRIGHT,
     637    xc_zend_startup,
     638    xc_zend_shutdown,
     639    NULL,           /* activate_func_t */
     640    NULL,           /* deactivate_func_t */
     641    NULL,           /* message_handler_func_t */
     642    xc_optimizer_op_array_handler,
     643    NULL,           /* statement_handler_func_t */
     644    NULL,           /* fcall_begin_handler_func_t */
     645    NULL,           /* fcall_end_handler_func_t */
     646    NULL,           /* op_array_ctor_func_t */
     647    NULL,           /* op_array_dtor_func_t */
     648    STANDARD_ZEND_EXTENSION_PROPERTIES
     649};
     650/* }}} */
     651
     652/* {{{ ini */
     653PHP_INI_BEGIN()
     654    STD_PHP_INI_BOOLEAN("xcache.optimizer",              "0", PHP_INI_ALL,    OnUpdateBool,        optimizer,         zend_xcache_globals, xcache_globals)
     655PHP_INI_END()
     656/* }}} */
     657static PHP_MINFO_FUNCTION(xcache_optimizer) /* {{{ */
     658{
     659    php_info_print_table_start();
     660    php_info_print_table_row(2, "XCache Optimizer Version", XCACHE_VERSION);
     661    php_info_print_table_end();
     662
     663    DISPLAY_INI_ENTRIES();
     664}
     665/* }}} */
     666static PHP_MINIT_FUNCTION(xcache_optimizer) /* {{{ */
     667{
     668    REGISTER_INI_ENTRIES();
     669    return xcache_zend_extension_register(&xc_optimizer_zend_extension_entry, 0);
     670}
     671/* }}} */
     672static PHP_MSHUTDOWN_FUNCTION(xcache_optimizer) /* {{{ */
     673{
     674    UNREGISTER_INI_ENTRIES();
     675    return xcache_zend_extension_unregister(&xc_optimizer_zend_extension_entry);
     676}
     677/* }}} */
     678static zend_module_entry xcache_optimizer_module_entry = { /* {{{ */
     679    STANDARD_MODULE_HEADER,
     680    XCACHE_NAME "_Optimizer",
     681    NULL,
     682    PHP_MINIT(xcache_optimizer),
     683    PHP_MSHUTDOWN(xcache_optimizer),
     684    NULL,
     685    NULL,
     686    PHP_MINFO(xcache_optimizer),
     687    XCACHE_VERSION,
     688#ifdef PHP_GINIT
     689    NO_MODULE_GLOBALS,
     690#endif
     691#ifdef ZEND_ENGINE_2
     692    NULL,
     693#else
     694    NULL,
     695    NULL,
     696#endif
     697    STANDARD_MODULE_PROPERTIES_EX
     698};
     699/* }}} */
     700int xc_optimizer_startup_module() /* {{{ */
     701{
     702    return zend_startup_module(&xcache_optimizer_module_entry);
     703}
     704/* }}} */
Note: See TracChangeset for help on using the changeset viewer.