Ejemplo n.º 1
0
 function _initPlugin(Dispatcher $dispatcher)
 {
     Loader::import('vendor/autoload.php');
     $dispatcher->registerPlugin(new PHPConfig());
     $dispatcher->registerPlugin(new LoginPlugin());
     $dispatcher->registerPlugin(new Module(array(Module::TYPE_CLI => array('enable' => true))));
 }
Ejemplo n.º 2
0
 /**
  *
  * @param \Yaf\Dispatcher $dispatcher
  */
 protected function _initLayout(\Yaf\Dispatcher $dispatcher)
 {
     /*
      * layout allows boilerplate HTML to live in
      * /layouts/scripts rather than every script
      */
     $layout = new LayoutPlugin($this->_config->layout->file, $this->_config->layout->dir);
     /* Store a reference in the registry so values can be set later.
      *
      * This is a hack to make up for the lack of a getPlugin
      * method in the dispatcher.
      */
     \Yaf\Registry::set('Layout', $layout);
     /*add the plugin to the dispatcher*/
     $dispatcher->registerPlugin($layout);
 }
Ejemplo n.º 3
0
 public function _initLayout(Dispatcher $dispatcher)
 {
     /*layout allows boilerplate HTML to live in /views/layout rather than every script*/
     $layout = new LayoutPlugin('layout/layout.html');
     /* Store a reference in the registry so values can be set later.
      * This is a hack to make up for the lack of a getPlugin
      * method in the dispatcher.
      */
     Registry::set('layout', $layout);
     /*add the plugin to the dispatcher*/
     $dispatcher->registerPlugin($layout);
 }
Ejemplo n.º 4
0
 public function _initPlugin(Dispatcher $dispatcher)
 {
     $dispatcher->registerPlugin(new ApiPluginBase());
 }
Ejemplo n.º 5
0
 /**
  * 注册插件
  * @param \Yaf\Dispatcher $dispatcher 分发对象
  * @return void
  */
 public function _initPlugin(Dispatcher $dispatcher)
 {
     $dispatcher->registerPlugin(new HandlerPlugin());
 }
Ejemplo n.º 6
0
 /**
  * 注册自动加载插件
  */
 public function _initPlugin(\Yaf\Dispatcher $dispatcher)
 {
     // 注册自动加载插件
     $autoload = new \AutoloadPlugin();
     $dispatcher->registerPlugin($autoload);
 }
Ejemplo n.º 7
0
 /**
  * 注册插件
  *
  * @access public
  * @param Yaf\Dispatcher $dispatcher
  * @return void
  */
 public function _initPlugin(Dispatcher $dispatcher)
 {
     $dispatcher->registerPlugin(new XHProfPlugin());
     $dispatcher->registerPlugin(new ModulePlugin());
 }
Ejemplo n.º 8
0
 /**
  * Initialize plugin.
  * @param  \Yaf\Dispatcher $dispatcher
  * @return void
  */
 public function _initPlugin(\Yaf\Dispatcher $dispatcher)
 {
     if (APPLICATION_PHPCAS_OPEN) {
         $dispatcher->registerPlugin(new Plugin_User());
     }
 }
Ejemplo n.º 9
0
 function _initPlugin(Dispatcher $dispatcher)
 {
     $dispatcher->registerPlugin(new PHPConfig());
     $dispatcher->registerPlugin(new InitPlugin());
 }
Ejemplo n.º 10
0
 /**
  * @brief 初始化插件,调度插件、小流量插件、A/B测试插件、authorize插件、performance测试插件、安全插件
  * @param \Yaf\Dispatcher $dispatcher
  */
 public function _initPlugin(\Yaf\Dispatcher $dispatcher)
 {
     $dispatcher->registerPlugin(new \Boom\Plugin\Security())->registerPlugin(new \Boom\Plugin\Scheduler());
 }
Ejemplo n.º 11
0
 public function _initPlugin(Dispatcher $dispatcher)
 {
     if (!defined("RUN_IN_CLI")) {
         $authPlugin = new AuthPlugin();
         $dispatcher->registerPlugin($authPlugin);
     }
 }
Ejemplo n.º 12
0
 public function _initPlugins(Dispatcher $dispatcher)
 {
     $dispatcher->registerPlugin(new XhprofControllerPlugin());
     $dispatcher->registerPlugin(new PermissionControllerPlugin());
     // $dispatcher->registerPlugin(new OAUTH2Plugin());
 }