コード例 #1
0
ファイル: CmfPlugin.php プロジェクト: nitronet/fwk-cmf
 /**
  * Adds Actions and Listeners to the Application
  *
  * @param Application $app The running Application
  *
  * @return void
  */
 public function load(Application $app)
 {
     $app->register('PageView', ProxyFactory::factory('Nitronet\\Fwk\\CMF\\Controllers\\PageView:show'));
     $console = $this->cfg('consoleService', false);
     if ($console) {
         $app->addListener(new CommandsListener($this->cfg('consoleService', 'console'), $this->cfg('serviceName', 'cmf')));
     }
 }
コード例 #2
0
ファイル: BasicRuntimeTest.php プロジェクト: fwk/core
 public function testDirectResponse()
 {
     $rsp = new \Symfony\Component\HttpFoundation\Response();
     $this->object->register('TestDirectResponse', ProxyFactory::factory(function () use($rsp) {
         return $rsp;
     }));
     $request = Request::create('/TestDirectResponse.action');
     $response = $this->object->run($request);
     $this->assertEquals($rsp, $response);
 }
コード例 #3
0
ファイル: Descriptor.php プロジェクト: fwk/core
 /**
  * @return Application
  */
 public function execute($appName, Container $services = null)
 {
     $this->sources = array_reverse($this->sources);
     $app = Application::factory($appName, $services);
     if (null === $services) {
         $services = $app->getServices();
     }
     $app->addListener(new DescriptorListener($this));
     $this->loadIniFiles();
     $this->loadServices($services);
     foreach ($this->loadListeners($services) as $listener) {
         $app->addListener($listener);
     }
     foreach ($this->loadPlugins($services) as $plugin) {
         $app->plugin($plugin);
     }
     foreach ($this->loadActions() as $actionName => $str) {
         $app->register($actionName, ProxyFactory::factory($str));
     }
     return $app;
 }
コード例 #4
0
ファイル: ApplicationTest.php プロジェクト: fwk/core
 public function load(Application $app)
 {
     $app->register('PluginAction', ProxyFactory::factory(function () {
         return 'plugin';
     }));
 }
コード例 #5
0
 /**
  * Adds Actions and Listeners to the Application
  *
  * @param Application $app The running Application
  *
  * @return void
  */
 public function load(Application $app)
 {
     $app->register('CommentsThread', PF::factory('Nitronet\\Fwk\\Comments\\Controllers\\Thread:show'));
     $app->register('CommentsCount', PF::factory('Nitronet\\Fwk\\Comments\\Controllers\\Thread:countComments'));
     $app->register('CommentPost', PF::factory('Nitronet\\Fwk\\Comments\\Controllers\\Comment:post'));
 }
コード例 #6
0
 public function load(Application $app)
 {
     $app->register($this->cfg('action', 'Asset'), PF::factory($this->cfg('controller', 'Nitronet\\Fwk\\Assetic\\Controllers\\AssetAction:show')));
 }
コード例 #7
0
ファイル: Application.php プロジェクト: fwk/core
 public function offsetSet($actionName, $proxy)
 {
     if (!$proxy instanceof ActionProxy) {
         $proxy = Action\ProxyFactory::factory($proxy);
     }
     return $this->register($actionName, $proxy);
 }