public function _initPlugins(Yaf\Dispatcher $dispatcher) { $event = $this->profiler->startEvent('Init plugins'); $dispatcher->registerPlugin(new LogPlugin()); $dispatcher->registerPlugin(new AuthTokenPlugin()); $this->profiler->endEvent($event); }
public function _initPlugin(Yaf\Dispatcher $dispatcher) { //开启debug控制台输出 if (APP_DEBUG) { $dispatcher->registerPlugin(new DebugPlugin()); } //开启布局支持 $dispatcher->registerPlugin(new LayoutPlugin()); //开启性能分析 if (APP_ANALYZE && function_exists('xhprof_enable')) { $dispatcher->registerPlugin(new XhprofPlugin()); } }
/** * 加载插件 * @param \Yaf\Dispatcher $dispatcher */ public function _initPlugins(Yaf\Dispatcher $dispatcher) { $config = Yaf\Application::app()->getConfig(); if ($config->get('application.log.status')) { $dispatcher->registerPlugin(new LogPlugin()); } }
public function _initRest(Yaf\Dispatcher $dispatcher) { $dispatcher->disableView(); //如果不是cli就调用rest路由 if (!$dispatcher->getRequest()->isCli()) { $router = $dispatcher->getRouter(); $route = new RestRoute(); $router->addRoute("rest", $route); //设置模板目录 $view_engine = new Yaf\View\Simple(APPLICATION_PATH . '/application/views'); $dispatcher->setView($view_engine); //启用权限控制插件 $auth = new AuthPlugin(); $dispatcher->registerPlugin($auth); } else { $command = new CommandLinePlugin(); $dispatcher->registerPlugin($command); } }
public function _initHooks(Yaf\Dispatcher $dispatcher) { //注册Hooks $dispatcher->registerPlugin(new \Hook\RequestPlugin()); $dispatcher->registerPlugin(new \Hook\AuthenticatePlugin()); $dispatcher->registerPlugin(new \Hook\AuthorizePlugin()); $dispatcher->registerPlugin(new \Hook\ApiRoutePlugin()); $dispatcher->registerPlugin(new \Hook\ResponsePlugin()); $dispatcher->registerPlugin(new \Hook\PostEventPlugin()); }
/** * 加载插件 * @param \Yaf\Dispatcher $dispatcher */ public function _initPlugin(Yaf\Dispatcher $dispatcher) { $dispatcher->registerPlugin(new TplPlugin()); $dispatcher->registerPlugin(new SystemPlugin()); }
public function _initPlugin(Yaf\Dispatcher $dispatcher) { //注册一个插件 $objSamplePlugin = new SamplePlugin(); $dispatcher->registerPlugin($objSamplePlugin); }
public function _initPlugins(Yaf\Dispatcher $dispatcher) { $dispatcher->registerPlugin(new LogPlugin()); $this->config->application->protect_from_csrf && $dispatcher->registerPlugin(new AuthTokenPlugin()); }
public function _initPlugins(Yaf\Dispatcher $dispatcher) { $dispatcher->registerPlugin(new LogPlugin()); $dispatcher->registerPlugin(new AuthTokenPlugin()); }
public function _initPluginUser(Yaf\Dispatcher $dispatcher) { $system = new SystemPlugin(); $dispatcher->registerPlugin($system); }
/** * 初始化插件 * * @param Yaf_Dispatcher $dispatcher */ public function _initPlugin(Yaf\Dispatcher $dispatcher) { $site = new SitePlugin(); $dispatcher->registerPlugin($site); }