Пример #1
0
 /**
  *  フレームワークの処理を実行する(CLI)
  *
  *  @access private
  *  @param  mixed   $default_action_name    指定のアクション名
  */
 public function console($action_name)
 {
     self::$instance = $this;
     Ethna::setErrorCallback(array($this, 'handleError'));
     $this->container = new Ethna_Container(BASE, $this->directory, $this->class, $this->appid, $this->locale, '');
     $this->directory = $this->container->getDirectories();
     $config = $this->container->getConfig();
     $this->container->url = $config->get('url');
     $plugin = $this->container->getPlugin();
     $this->logger = $this->container->getLogger();
     $plugin->setLogger($this->logger);
     $this->logger->begin();
     $this->container->setCurrentActionName($action_name);
     $i18n = $this->container->getI18N();
     $i18n->setLanguage($this->locale);
     $form_class_name = $this->class['form'];
     $action_form = new $form_class_name($this->container);
     $this->container->setActionForm($action_form);
     $command_class = sprintf("%s_Command_%s", ucfirst(strtolower($this->appid)), ucfirst($action_name));
     require_once $this->container->getDirectory('command') . '/' . ucfirst($action_name) . '.php';
     $ac = new $command_class($this->container);
     $ac->runcli();
 }