示例#1
0
 /**
  * Test {@link Factory::getControllerDescription}
  *
  * @dataProvider controllerNameProvider
  * @param string $controllerClassName
  */
 public function testGetControllerDescription($controllerClassName)
 {
     $description = $this->factory->getControllerDescription($controllerClassName);
     $this->assertNotNull($description);
     $this->assertTrue($description instanceof ControllerDescription);
     $this->assertEquals($controllerClassName, $description->getClassName());
 }
示例#2
0
 /**
  * Get the list of actions for a controller
  * 
  * @param string $controllerClassName
  * @return array
  */
 public static function getActions($controllerClassName)
 {
     try {
         $actions = ServiceManager::getServiceManager()->get('generis/cache')->get(self::CONTROLLER_PREFIX . $controllerClassName);
     } catch (\common_cache_NotFoundException $e) {
         $factory = new Factory();
         $desc = $factory->getControllerDescription($controllerClassName);
         $actions = array();
         foreach ($desc->getActions() as $action) {
             $actions[] = $action->getName();
         }
         ServiceManager::getServiceManager()->get('generis/cache')->put($actions, self::CONTROLLER_PREFIX . $controllerClassName);
     }
     return $actions;
 }
示例#3
0
 /**
  * Get the list of actions for a controller
  * 
  * @param unknown $controllerClassName
  * @return array
  */
 public static function getActions($controllerClassName)
 {
     try {
         $actions = \common_cache_FileCache::singleton()->get(self::CONTROLLER_PREFIX . $controllerClassName);
     } catch (\common_cache_NotFoundException $e) {
         $factory = new Factory();
         $desc = $factory->getControllerDescription($controllerClassName);
         $actions = array();
         foreach ($desc->getActions() as $action) {
             $actions[] = $action->getName();
         }
         \common_cache_FileCache::singleton()->put($actions, self::CONTROLLER_PREFIX . $controllerClassName);
     }
     return $actions;
 }