Esempio n. 1
0
 /**
  *  LogWriterオブジェクトを取得する
  *
  *  @access protected
  *  @param  array   $option     ログオプション
  *  @param  string  $facility   ログファシリティ
  *  @return object  LogWriter   LogWriterオブジェクト
  */
 protected function _getLogWriter($option, $facility = null)
 {
     if ($facility == null) {
         $facility = $this->getLogFacility();
         if (is_array($facility)) {
             $facility = $facility[0];
         }
     }
     if (is_null($facility)) {
         $plugin = "default";
     } else {
         if (isset($this->log_facility_list[$facility])) {
             if ($facility == "file" || $facility == "echo") {
                 $plugin = $facility;
             } else {
                 $plugin = "syslog";
             }
         } else {
             $plugin = $facility;
         }
     }
     $plugin_manager = $this->container->getPlugin();
     $plugin_object = $plugin_manager->getPlugin('Logwriter', ucfirst(strtolower($plugin)));
     if (Ethna::isError($plugin_object)) {
         return $plugin_object;
     }
     if (isset($option['ident']) == false) {
         $option['ident'] = $this->container->getAppId();
     }
     if (isset($option['facility']) == false) {
         $option['facility'] = $facility;
     }
     $plugin_object->setOption($option);
     return $plugin_object;
 }
Esempio n. 2
0
 /**
  *  Ethna_ActionFormクラスのコンストラクタ
  *
  */
 public function __construct(ContainerInterface $container)
 {
     $this->container = $container;
     $this->action_error = $container->getActionError();
     $this->ae = $this->action_error;
     $this->action_error->action_form = $this;
     $this->i18n = $container->getI18N();
     $this->logger = $container->getLogger();
     $this->plugin = $container->getPlugin();
     if (isset($_SERVER['REQUEST_METHOD']) == false) {
         return;
     }
     // フォーム値テンプレートの更新
     $this->form_template = $this->_setFormTemplate($this->form_template);
     // フォーム値定義の設定
     $this->_setFormDef();
     // 省略値補正
     foreach ($this->form as $name => $value) {
         foreach ($this->def as $k) {
             if (isset($value[$k]) == false) {
                 $this->form[$name][$k] = null;
             }
         }
     }
 }
Esempio n. 3
0
 /**
  *
  */
 public function __construct(ContainerInterface $container)
 {
     $this->container = $container;
     $this->config = $container->getConfig();
     $this->i18n = $container->getI18N();
     $this->plugin = $container->getPlugin();
     $this->logger = $container->getLogger();
 }
Esempio n. 4
0
 /**
  *  Ethna_ActionClassのコンストラクタ
  *
  */
 public function __construct(ContainerInterface $container, $action_form, $viewResolver)
 {
     $this->container = $container;
     $this->config = $container->getConfig();
     $this->i18n = $container->getI18N();
     $this->action_error = $container->getActionError();
     $this->ae = $this->action_error;
     $this->action_form = $action_form;
     $this->af = $this->action_form;
     $this->session = $container->getSession();
     $this->plugin = $container->getPlugin();
     $this->logger = $container->getLogger();
     $this->viewResolver = $viewResolver;
 }