/** * 在该函数中添加需要预处理的项目 */ private static function _pre_init() { //可以在这里注销$_GET等变量 App_Plugin::add_action(App_Key::$TAG_SERVICE_EXECUTE, array('Driver_Input', 'init')); App_Plugin::add_action(App_Key::$TAG_SERVICE_EXECUTE, array('Driver_Cookie', 'init')); //App_Plugin::add_action(App_Key::$TAG_SERVICE_EXECUTE, array('Driver_Session', 'init')); App_Plugin::add_action(App_Key::$TAG_SERVICE_EXECUTE, array('Driver_Limit', 'init')); }
/** * 启动服务 */ public static function start() { self::init(); $get_args = $_GET; $post_args = $_POST; App_Plugin::do_action(App_Key::$TAG_SERVICE_EXECUTE); self::_exec($get_args, $post_args); App_Plugin::do_action(App_Key::$TAG_SERVICE_STOP); }
function __construct() { parent::__construct(); $this->_file_path = $this->_config['log_file_path']; App_Plugin::add_action(App_Key::$TAG_SERVICE_STOP, array($this, 'writer')); }
/** * 必须要实现的方法, 应用加载时执行 * @see Plugin_Interface::setup() */ public function setup() { App_Plugin::add_action(App_Key::$TAG_SERVICE_START, array($this, 'func_service_start')); App_Plugin::add_action(App_Key::$TAG_SERVICE_STOP, array($this, 'func_service_stop')); }