/**
  * セッション処理を行う
  *
  * @access  public
  * @since   3.0.0
  */
 function execute()
 {
     $log =& LogFactory::getLog();
     $log->trace("Filter_Sessionの前処理が実行されました", "Filter_Session#execute");
     $container =& DIContainerFactory::getContainer();
     $session =& new Session();
     $container->register($session, "Session");
     $attributes = $this->getAttributes();
     $modeArray = array();
     if (isset($attributes["mode"])) {
         $modeArray = explode(",", $attributes["mode"]);
         foreach ($modeArray as $key => $value) {
             $modeArray[$key] = trim($value);
         }
     } else {
         $modeArray[] = "start";
     }
     if (isset($attributes["name"])) {
         $session->setName($attributes["name"]);
     }
     if (isset($attributes["id"])) {
         $session->setID($attributes["id"]);
     }
     if (isset($attributes["savePath"])) {
         $session->setSavePath($attributes["savePath"]);
     }
     if (isset($attributes["subsavePath"]) && !is_writable($session->getSavePath())) {
         $session->setSavePath($attributes["subsavePath"]);
     }
     if (isset($attributes["cacheLimiter"])) {
         $session->setCacheLimiter($attributes["cacheLimiter"]);
     }
     if (isset($attributes["cacheExpire"])) {
         $session->setCacheExpire($attributes["cacheExpire"]);
     }
     if (isset($attributes["useCookies"])) {
         $session->setUseCookies($attributes["useCookies"]);
     }
     if (isset($attributes["lifetime"])) {
         $session->setCookieLifetime($attributes["lifetime"]);
     }
     if (isset($attributes["path"])) {
         $session->setCookiePath($attributes["path"]);
     }
     if (isset($attributes["domain"])) {
         $session->setCookieDomain($attributes["domain"]);
     }
     if (isset($attributes["secure"])) {
         $session->setCookieSecure($attributes["secure"]);
     }
     if (in_array('start', $modeArray)) {
         $session->start();
     }
     $filterChain =& $container->getComponent("FilterChain");
     $filterChain->execute();
     if (in_array('close', $modeArray)) {
         $session->close();
     }
     $log->trace("Filter_Sessionの後処理が実行されました", "Filter_Session#execute");
 }
 /**
  * command line parameters to dto
  *
  * @access  public
  */
 function execute()
 {
     $className = get_class($this);
     $container =& DIContainerFactory::getContainer();
     $actionChain =& $container->getComponent("ActionChain");
     $this->_errorList =& $actionChain->getCurErrorList();
     $log =& LogFactory::getLog();
     $log->trace("{$className}の前処理が実行されました", "{$className}#execute");
     $req =& $container->getComponent('Request');
     $cmdArgs = $req->getParameter('args');
     $dto =& $this->_createDto($this->getAttributes(), is_array($cmdArgs) ? $cmdArgs : array());
     if (is_object($dto)) {
         $container->register($dto, $this->componentKey);
         //余ったパラメータをargsに上書き
         $req->setParameter('args', $dto->args);
     } elseif ($this->registerDummy) {
         $dummy = new stdClass();
         $req->setParameterRef($this->componentKey, $dummy);
         $container->register($dummy, $this->componentKey);
     }
     //
     // ここで一旦次のフィルターに制御を移す
     //
     $filterChain =& $container->getComponent("FilterChain");
     $filterChain->execute();
     //
     // ここに後処理を記述
     //
     $log->trace("{$className}の後処理が実行されました", "{$className}#execute");
 }
 /**
  * コンポーネントのプロパティをRequestに展開する
  *
  * @access  public
  */
 function execute()
 {
     $className = get_class($this);
     $container =& DIContainerFactory::getContainer();
     $log =& LogFactory::getLog();
     $log->trace("{$className}の前処理が実行されました", "{$className}#execute");
     if ($this->componentKey && is_object($obj =& $container->getComponent($this->componentKey))) {
         $req =& $container->getComponent('Request');
         foreach ($obj as $prop => $value) {
             if (preg_match('/^_/', $prop) || $req->getParameter($prop) !== null && !$this->override) {
                 continue;
             }
             if (!is_object($value)) {
                 $req->setParameter($prop, $value);
             } elseif ($this->extractObject) {
                 $req->setParameterRef($prop, $obj->{$prop});
             }
         }
     }
     //
     // ここで一旦次のフィルターに制御を移す
     //
     $filterChain =& $container->getComponent("FilterChain");
     $filterChain->execute();
     //
     // ここに後処理を記述
     //
     $log->trace("{$className}の後処理が実行されました", "{$className}#execute");
 }
 /**
  * 
  *
  * @access  public
  */
 function execute()
 {
     $container =& DIContainerFactory::getContainer();
     $filterChain =& $container->getComponent("FilterChain");
     $className = get_class($this);
     $log =& LogFactory::getLog();
     $log->trace("{$className}の前処理が実行されました", "{$className}#execute");
     //
     // ここに前処理を記述
     //
     $this->_component = $this->getAttribute('component');
     $this->_method = $this->getAttribute('method');
     $this->_targetFilterName = $this->getAttribute('targetFilterName');
     if ($this->_validate()) {
         $componentAttrs = $this->_getAttrsFromComponent();
         if (is_array($componentAttrs)) {
             $this->_setAttrsToFilter($filterChain, $componentAttrs);
         }
     }
     //
     // ここで一旦次のフィルターに制御を移す
     //
     $filterChain->execute();
     //
     // ここに後処理を記述
     //
     $log->trace("{$className}の後処理が実行されました", "{$className}#execute");
 }
 /**
  * 
  *
  * @access  public
  */
 function execute()
 {
     $container =& DIContainerFactory::getContainer();
     $actionChain =& $container->getComponent('ActionChain');
     $errorList =& $actionChain->getCurErrorList();
     $className = get_class($this);
     $log =& LogFactory::getLog();
     $log->trace("{$className}の前処理が実行されました", "{$className}#execute");
     $globalConfig =& $container->getComponent($this->_component);
     if (!is_object($globalConfig)) {
         $this->_fatalError("{$this->_component}が登録されていません", "{$className}#execute");
     }
     if ($errorList->getType() != "") {
         $errorList->add(get_class($this), "failed to initialize {$this->_component}");
     } elseif (!$this->_checkConstants($globalConfig, $errorList)) {
         $errorList->setType('error');
     }
     //
     //
     $filterChain =& $container->getComponent("FilterChain");
     $filterChain->execute();
     //
     // ここに後処理を記述
     //
     $log->trace("{$className}の後処理が実行されました", "{$className}#execute");
 }
 /**
  * Mobile用クラス実行
  *
  * @access  public
  *
  */
 function execute()
 {
     $this->_container =& DIContainerFactory::getContainer();
     $this->_log =& LogFactory::getLog();
     $this->_filterChain =& $this->_container->getComponent("FilterChain");
     $this->_actionChain =& $this->_container->getComponent("ActionChain");
     $this->_db =& $this->_container->getComponent("DbObject");
     $this->_session =& $this->_container->getComponent("Session");
     $this->_request =& $this->_container->getComponent("Request");
     $this->_modulesView =& $this->_container->getComponent("modulesView");
     //$this->_mobile_obj = $this->_modulesView->getModuleByDirname("mobile");
     $this->_usersView =& $this->_container->getComponent("usersView");
     //mb_stringがロードされているかどうか
     if (!extension_loaded('mbstring') && !function_exists("mb_convert_encoding")) {
         include_once MAPLE_DIR . '/includes/mbstring.php';
     } else {
         if (function_exists("mb_detect_order")) {
             mb_detect_order(_MB_DETECT_ORDER_VALUE);
         }
     }
     if (function_exists("mb_internal_encoding")) {
         mb_internal_encoding(INTERNAL_CODE);
     }
     if (function_exists("mb_language")) {
         mb_language("Japanese");
     }
     $this->_log->trace("{$this->_classname}の前処理が実行されました", "{$this->_classname}#execute");
     $this->_preFilter();
     $this->_filterChain->execute();
     $this->_log->trace("{$this->_classname}の後処理が実行されました", "{$this->_classname}#execute");
     $this->_postFilter();
 }
 /**
  * Injectionを行う
  *
  * @access  public
  * @since   3.0.0
  */
 function execute()
 {
     $log =& LogFactory::getLog();
     $log->trace("Filter_InjectSessionの前処理が実行されました", "Filter_InjectSession#execute");
     //
     // 設定ファイルに入っていた値を元に設定
     //
     $container =& DIContainerFactory::getContainer();
     if ($this->getSize() > 0) {
         $session =& $container->getComponent("Session");
         $params = $session->getParameters();
         if (count($params) > 0) {
             foreach ($this->getAttributes() as $key => $value) {
                 $component =& $container->getComponent($key);
                 if (is_object($component)) {
                     BeanUtils::setAttributes($component, $params, true);
                 } else {
                     $log->error("不正なコンポーネントが設定ファイルで指定されています({$key})", "Filter_InjectSession#execute");
                 }
             }
         }
     }
     $filterChain =& $container->getComponent("FilterChain");
     $filterChain->execute();
     $log->trace("Filter_InjectSessionの後処理が実行されました", "Filter_InjectSession#execute");
 }
Пример #8
0
 /**
  * コンストラクター
  *
  * @access	public
  */
 function Userinf_Components_Check()
 {
     $log =& LogFactory::getLog();
     $log->trace("component userinf check のコンストラクタが実行されました", "UserinfCheck#Userinf_Components_Check");
     $this->_container =& DIContainerFactory::getContainer();
     $this->_usersView =& $this->_container->getComponent("usersView");
     $this->_session =& $this->_container->getComponent("Session");
 }
Пример #9
0
 /**
  * コンストラクター
  *
  * @access	public
  */
 function Login_Components_View()
 {
     $log =& LogFactory::getLog();
     $log->trace("component login View のコンストラクタが実行されました", "loginView#Login_View");
     $this->_container =& DIContainerFactory::getContainer();
     $this->_config =& $this->_container->getComponent("configView");
     $renderer =& SmartyTemplate::getInstance();
     $renderer->assign('autoregist_use', $this->getAutoregistUse());
     $renderer->assign('autoregist_disclaimer', $this->getDisclaimer());
 }
 /**
  * Mobile用クラス実行
  *
  * @access  public
  * 
  */
 function execute()
 {
     $this->_container =& DIContainerFactory::getContainer();
     $this->_log =& LogFactory::getLog();
     $this->_filterChain =& $this->_container->getComponent("FilterChain");
     $this->_session =& $this->_container->getComponent("Session");
     $this->_request =& $this->_container->getComponent("Request");
     $this->_log->trace("{$this->_classname}の前処理が実行されました", "{$this->_classname}#execute");
     $this->_preFilter();
     $this->_filterChain->execute();
     $this->_log->trace("{$this->_classname}の後処理が実行されました", "{$this->_classname}#execute");
     $this->_postFilter();
 }
 /**
  * Viewの処理を実行
  *
  * @access	public
  **/
 function execute()
 {
     $this->_container =& DIContainerFactory::getContainer();
     $this->_log =& LogFactory::getLog();
     $this->_filterChain =& $this->_container->getComponent("FilterChain");
     $this->_actionChain =& $this->_container->getComponent("ActionChain");
     $this->_commonMain =& $this->_container->getComponent("commonMain");
     $this->_className = get_class($this);
     $this->_log->trace("{$this->_className}の前処理が実行されました", "{$this->_className}#execute");
     $this->_prefilter();
     $this->_filterChain->execute();
     $this->_postfilter();
     $this->_log->trace("{$this->_className}の後処理が実行されました", "{$this->_className}#execute");
 }
 /**
  * Viewの処理を実行
  *
  * @access	public
  **/
 function execute()
 {
     $this->_container =& DIContainerFactory::getContainer();
     $this->_log =& LogFactory::getLog();
     $this->_filterChain =& $this->_container->getComponent("FilterChain");
     $this->_actionChain =& $this->_container->getComponent("ActionChain");
     $this->_request =& $this->_container->getComponent("Request");
     //$this->_response =& $this->_container->getComponent("Response");
     $this->_session =& $this->_container->getComponent("Session");
     $this->_getdata =& $this->_container->getComponent("GetData");
     $this->_className = get_class($this);
     $this->_errorList =& $this->_actionChain->getCurErrorList();
     // ----------------------------------------------
     // ---  CURRENT_URL定義                  ---
     // ----------------------------------------------
     if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') {
         $url = BASE_URL_HTTPS . INDEX_FILE_NAME . $this->_request->getStrParameters();
     } else {
         $url = BASE_URL . INDEX_FILE_NAME . $this->_request->getStrParameters();
     }
     define("CURRENT_URL", $url);
     // ----------------------------------------------
     // ---  PERMALINK_URL定義                ---
     // ----------------------------------------------
     if ($this->_session->getParameter("_permalink_flag") == _OFF) {
         $url = CURRENT_URL;
     } else {
         $_restful_permalink = $this->_request->getParameter("_restful_permalink");
         $request_str = $this->_request->getStrParameters(false);
         if (isset($_restful_permalink) && $_restful_permalink != '') {
             $url = BASE_URL . '/' . $_restful_permalink . '/' . $request_str;
         } else {
             $url = BASE_URL . '/' . $request_str;
         }
     }
     define("PERMALINK_URL", $url);
     // ----------------------------------------------
     // ---  _JS_VERSION定義                    ---
     // -----------------------------------------------
     $db =& $this->_container->getComponent("DbObject");
     $js_update_time = $db->maxExecute("javascript_files", "update_time");
     define("_JS_VERSION", $js_update_time);
     $cssUpdateTime = $db->maxExecute('css_files', 'update_time');
     define('_CSS_VERSION', $cssUpdateTime);
     $this->_prefilter();
     $this->_log->trace("{$this->_className}の前処理が実行されました", "{$this->_className}#execute");
     $this->_filterChain->execute();
     $this->_postfilter();
     $this->_log->trace("{$this->_className}の後処理が実行されました", "{$this->_className}#execute");
 }
 /**
  * Convert処理を実行
  *
  * @access  public
  * @since   3.0.0
  */
 function execute()
 {
     $log =& LogFactory::getLog();
     $log->trace("Filter_Convertの前処理が実行されました", "Filter_Convert#execute");
     $attributes = $this->getAttributes();
     if (is_array($attributes) && count($attributes) > 0) {
         $converterManager =& new ConverterManager();
         $converterManager->execute($attributes);
     }
     $container =& DIContainerFactory::getContainer();
     $filterChain =& $container->getComponent("FilterChain");
     $filterChain->execute();
     $log->trace("Filter_Convertの後処理が実行されました", "Filter_Convert#execute");
 }
 /**
  * Configファイルの設定を行うFilter
  *
  * @access	public
  **/
 function execute()
 {
     $this->_container =& DIContainerFactory::getContainer();
     $this->_log =& LogFactory::getLog();
     $this->_filterChain =& $this->_container->getComponent("FilterChain");
     $this->_actionChain =& $this->_container->getComponent("ActionChain");
     $this->_request =& $this->_container->getComponent("Request");
     $this->_session =& $this->_container->getComponent("Session");
     $this->_errorList =& $this->_actionChain->getCurErrorList();
     $this->_className = get_class($this);
     $this->_prefilter();
     $this->_log->trace("{$this->_className}の前処理が実行されました", "{$this->_className}#execute");
     $this->_filterChain->execute();
     $this->_postfilter();
     $this->_log->trace("{$this->_className}の後処理が実行されました", "{$this->_className}#execute");
 }
 /**
  * Whatsnew用クラスデータ登録用Filter
  *
  * @access  public
  * 
  */
 function execute()
 {
     $this->_container =& DIContainerFactory::getContainer();
     $this->_log =& LogFactory::getLog();
     $this->_filterChain =& $this->_container->getComponent("FilterChain");
     $this->_actionChain =& $this->_container->getComponent("ActionChain");
     $this->_db =& $this->_container->getComponent("DbObject");
     $this->_modulesView =& $this->_container->getComponent("modulesView");
     $this->_request =& $this->_container->getComponent("Request");
     $this->_session =& $this->_container->getComponent("Session");
     $this->_whatsnewAction =& $this->_container->getComponent("whatsnewAction");
     $this->_log->trace("{$this->_classname}の前処理が実行されました", "{$this->_classname}#execute");
     $this->_preFilter();
     $this->_filterChain->execute();
     $this->_log->trace("{$this->_classname}の後処理が実行されました", "{$this->_classname}#execute");
     $this->_postFilter();
 }
 /**
  * セッション処理を行う
  *
  * @access  public
  * @since   3.0.0
  */
 function execute()
 {
     $log =& LogFactory::getLog();
     $log->trace("Filter_Tokenの前処理が実行されました", "Filter_Token#execute");
     $container =& DIContainerFactory::getContainer();
     $session =& $container->getComponent("Session");
     $token =& new Token();
     $container->register($token, "Token");
     $token->setSession($session);
     $attributes = $this->getAttributes();
     if (isset($attributes["name"])) {
         $token->setName($attributes["name"]);
     }
     $modeArray = array();
     if (isset($attributes["mode"])) {
         $modeArray = explode(",", $attributes["mode"]);
         foreach ($modeArray as $key => $value) {
             $modeArray[$key] = trim($value);
         }
     } else {
         //var_dump($this->_container);
         $modeArray[] = "build";
     }
     foreach ($modeArray as $value) {
         switch ($value) {
             case 'check':
                 $request =& $container->getComponent("Request");
                 if (!$token->check($request)) {
                     $actionChain =& $container->getComponent("ActionChain");
                     $errorList =& $actionChain->getCurErrorList();
                     $errorList->setType(TOKEN_ERROR_TYPE);
                 }
                 break;
             case 'remove':
                 $token->remove();
                 break;
             case 'build':
             default:
                 $token->build();
                 break;
         }
     }
     $filterChain =& $container->getComponent("FilterChain");
     $filterChain->execute();
     $log->trace("Filter_Tokenの後処理が実行されました", "Filter_Token#execute");
 }
 /**
  * Validate処理を実行
  *
  * @access	public
  * @since	3.0.0
  **/
 function execute()
 {
     $log =& LogFactory::getLog();
     $log->trace("Filter_ValidateDefの前処理が実行されました", "Filter_ValidateDef#execute");
     $container =& DIContainerFactory::getContainer();
     $actionChain =& $container->getComponent("ActionChain");
     $errorList =& $actionChain->getCurErrorList();
     $type = $errorList->getType();
     //
     // 前のフィルターでエラーが発生してなくて、項目がある場合には実行
     //
     $attributes = $this->getAttributes();
     if ($type == "" && is_array($attributes) && count($attributes) > 0) {
         $validatorManager =& new ValidatorManager();
         $validatorManager->execute($attributes);
     }
     $filterChain =& $container->getComponent("FilterChain");
     $filterChain->execute();
     $log->trace("Filter_ValidateDefの後処理が実行されました", "Filter_ValidateDef#execute");
 }
 /**
  * Cacheの削除、登録するキーを登録するフィルタ
  *
  * @access	public
  **/
 function execute()
 {
     $this->_container =& DIContainerFactory::getContainer();
     $this->_log =& LogFactory::getLog();
     $this->_filterChain =& $this->_container->getComponent("FilterChain");
     $this->_actionChain =& $this->_container->getComponent("ActionChain");
     $this->_request =& $this->_container->getComponent("Request");
     $this->_response =& $this->_container->getComponent("Response");
     $this->_session =& $this->_container->getComponent("Session");
     $this->_className = get_class($this);
     $_mobile_flag = $this->_session->getParameter("_mobile_flag");
     $this->attributes_postfix = "";
     if ($_mobile_flag == _ON) {
         $this->attributes_postfix = "_mobile";
     }
     $this->_log->trace("{$this->_className}の前処理が実行されました", "{$this->_className}#execute");
     $this->_prefilter();
     $this->_filterChain->execute();
     $this->_postfilter();
     $this->_log->trace("{$this->_className}の後処理が実行されました", "{$this->_className}#execute");
 }
 /**
  * Token処理を行う
  *
  * @access  public
  * @since   3.0.0
  */
 function execute()
 {
     $log =& LogFactory::getLog();
     $log->trace("Filter_TokenExtraの前処理が実行されました", "Filter_TokenExtra#execute");
     $this->_container =& DIContainerFactory::getContainer();
     $this->_session =& $this->_container->getComponent("Session");
     $this->_actionChain =& $this->_container->getComponent("ActionChain");
     $this->_token =& $this->_container->getComponent("Token");
     if (!isset($this->_token)) {
         $this->_token =& new TokenExtra();
         $this->_container->register($this->_token, "Token");
     }
     $this->_token->setSession($this->_session);
     $action_name = $this->_actionChain->getCurActionName();
     $this->_request =& $this->_container->getComponent("Request");
     //メイン処理
     $this->setToken($action_name);
     $filterChain =& $this->_container->getComponent("FilterChain");
     $filterChain->execute();
     $log->trace("Filter_TokenExtraの後処理が実行されました", "Filter_TokenExtra#execute");
 }
 /**
  * Configファイルの設定を行うFilter
  *
  * @access	public
  **/
 function execute()
 {
     $this->_container =& DIContainerFactory::getContainer();
     $this->_log =& LogFactory::getLog();
     $this->_filterChain =& $this->_container->getComponent("FilterChain");
     $this->_actionChain =& $this->_container->getComponent("ActionChain");
     $this->_request =& $this->_container->getComponent("Request");
     $this->_response =& $this->_container->getComponent("Response");
     $this->_session =& $this->_container->getComponent("Session");
     $this->_languagesView =& $this->_container->getComponent('languagesView');
     if (empty($this->_languagesView)) {
         $common =& $this->_container->getComponent('commonMain');
         $this->_languagesView =& $common->registerClass(COMPONENT_DIR . '/languages/View.class.php', 'Languages_View', 'languagesView');
     }
     $this->_errorList =& $this->_actionChain->getCurErrorList();
     $this->_className = get_class($this);
     $this->_prefilter();
     $this->_log->trace("{$this->_className}の前処理が実行されました", "{$this->_className}#execute");
     $this->_filterChain->execute();
     $this->_postfilter();
     $this->_log->trace("{$this->_className}の後処理が実行されました", "{$this->_className}#execute");
 }
 /**
  * Actionを実行
  *
  * @access  public
  * @since   3.0.0
  */
 function execute()
 {
     $start = explode(' ', microtime());
     $start = $start[1] + $start[0];
     //------------------------------------------------------------
     // ↑↑↑ ここまでがFilterの前処理
     //------------------------------------------------------------
     $container =& DIContainerFactory::getContainer();
     $filterChain =& $container->getComponent("FilterChain");
     $filterChain->execute();
     //------------------------------------------------------------
     // ↓↓↓ ここからがFilterの後処理
     //------------------------------------------------------------
     $end = explode(' ', microtime());
     $end = $end[1] + $end[0];
     $time = round($end - $start, 4);
     //
     // maple.iniでセットした引数を取得できる
     //
     $name = $this->getAttribute("name");
     $log =& LogFactory::getLog();
     $log->debug("[{$name}] {$time} sec", "Filter_ExecutionTime#execute");
 }
 /**
  * Actionを実行
  *
  * @access  public
  * @since   3.1.0
  */
 function execute()
 {
     $log =& LogFactory::getLog();
     $log->trace("Filter_CheckCLIの前処理が実行されました", "Filter_CheckCLI#execute");
     $sapiName = php_sapi_name();
     if ($sapiName != 'cli') {
         $message = 'CLIではない環境で実行されました';
         $log->error($message, "Filter_CheckCLI#execute");
         if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD']) {
             header("HTTP/1.0 403 Forbidden");
         } else {
             if (OUTPUT_CODE != SCRIPT_CODE) {
                 $message = mb_convert_encoding($message, OUTPUT_CODE, SCRIPT_CODE);
             }
             print $message;
         }
         exit;
     }
     $container =& DIContainerFactory::getContainer();
     $filterChain =& $container->getComponent("FilterChain");
     $filterChain->execute();
     $log->trace("Filter_CheckCLIの後処理が実行されました", "Filter_CheckCLI#execute");
 }
 /**
  * デバッグ情報を表示する
  *
  * @access  public
  * @since   3.1.0
  */
 function execute()
 {
     $log =& LogFactory::getLog();
     $container =& DIContainerFactory::getContainer();
     //MAPLEデバッグ
     if (defined("MAPLE_DEBUG")) {
         if (MAPLE_DEBUG) {
             $maple_debug = _ON;
         } else {
             $maple_debug = _OFF;
         }
     } else {
         $session =& $container->getComponent("Session");
         if ($session) {
             $maple_debug = $session->getParameter("_maple_debug");
         } else {
             $maple_debug = _OFF;
         }
     }
     if ($maple_debug) {
         $this->_preFilter();
         $log->trace("Filter_Debugの前処理が実行されました", "Filter_Debug#execute");
     }
     $filterChain =& $container->getComponent("FilterChain");
     $filterChain->execute();
     if ($maple_debug) {
         // Debugはビューを表示した後のみ出力する必要あり
         // ResponseオブジェクトのResultに値があるときはビューを出力するとみなす
         //$response =& $container->getComponent("Response");
         //$result = $response->getResult();
         //$contentType = $response->getContentType();
         //if ($result != '' && ($contentType == '' || strrchr(strtolower($contentType),'text/html'))) {
         $this->_postFilter();
         //}
         $log->trace("Filter_Debugの後処理が実行されました", "Filter_Debug#execute");
     }
 }
 /**
  * Validator特有の処理を実装する
  *
  * @param   mixed   $attributes チェックする値(配列の場合あり)
  * @param   string  $errStr エラー文字列
  * @param   array   $params チェック時に使用する引数(使用しない場合もあり)
  * @return  string  エラー文字列(エラーの場合)
  * @access  public
  * @since   3.0.0
  */
 function validate($attributes, $errStr, $params)
 {
     $log =& LogFactory::getLog();
     $log->fatal("Validatorでvalidate関数が作成されていません。", "Validator#validate");
     exit;
 }
 /**
  * モジュールヘッダーメニューの登録(ブロック上部にタブを表示させる)
  *
  * @access	public
  **/
 function execute()
 {
     $this->_container =& DIContainerFactory::getContainer();
     $common =& $this->_container->getComponent("commonMain");
     $actionChain =& $this->_container->getComponent("ActionChain");
     $action_name = $actionChain->getCurActionName();
     $pathList = explode("_", $action_name);
     $edit_action_name = "";
     if (isset($pathList[0])) {
         $getdata =& $this->_container->getComponent("GetData");
         $modules =& $getdata->getParameter("modules");
         if (preg_match("/edit_init\$/i", $modules[$pathList[0]]['edit_action_name'])) {
             $edit_action_name = $modules[$pathList[0]]['edit_action_name'];
         }
     }
     $headermenuArray["menu"] = array();
     $headermenuNumber = array();
     $attributes = $this->getAttributes();
     $headermenuArray["active"] = 1;
     $muneNumber = 1;
     $activeNumber = 0;
     if (!isset($attributes['mode']) || $attributes['mode'] != "nobuild") {
         foreach ($attributes as $key => $value) {
             if ($key == "mode") {
                 continue;
             }
             $key_array = explode(",", $key);
             if (count($key_array) == 1) {
                 $active_colum = _OFF;
                 $menuText = $key;
             } else {
                 $active_colum = _ON;
                 $menuText = $key_array[1];
             }
             //$muneNumber++;
             //権限により表示・非表示を切り替える等で使用
             $valueList = explode("->", $value);
             $menuArray = array();
             if (count($valueList) == 1) {
                 $menuArray["text"] = $menuText;
                 $menuArray["click"] = !empty($value) ? $this->_getValue($value) : "";
                 if ($edit_action_name != "" && preg_match("/'" . $edit_action_name . "'/i", $menuArray["click"])) {
                     //アクション名称「XXX_XXX_edit_init」がedit_action_nameならば、
                     //ショートカットブロックならば表示しない
                     if (!$common->isResultByOperatorString("_shortcut_flag==_OFF")) {
                         $menuArray = array();
                     }
                 }
                 //$menuArray["click"] = str_replace("{\$block_id}", $block_id, $value);
             } else {
                 // 権限チェック等
                 if ($common->isResultByOperatorString($valueList[0])) {
                     $menuArray["text"] = $menuText;
                     $menuArray["click"] = !empty($valueList[1]) ? $this->_getValue($valueList[1]) : "";
                     //$menuArray["click"] = "parent.". str_replace(array("{\$block_id}", "{\$id}"), array($block_id, $id), $valueList[1]);
                 }
             }
             if ($active_colum) {
                 $activeNumber = $muneNumber;
             }
             if (isset($menuArray["text"])) {
                 if (isset($headermenuNumber[$menuText])) {
                     if ($active_colum) {
                         $headermenuArray["active"] = $headermenuNumber[$menuText];
                     }
                     $headermenuArray["menu"][$headermenuNumber[$menuText]] = $menuArray;
                 } else {
                     if ($active_colum) {
                         $headermenuArray["active"] = $muneNumber;
                     }
                     $headermenuArray["menu"][$muneNumber] = $menuArray;
                     //number保存用
                     $headermenuNumber[$menuText] = $muneNumber;
                 }
             }
             if (isset($menuArray["text"])) {
                 $muneNumber++;
             }
             //$tempArray["menu"][$muneNumber] = $menuArray;
             //ksort($tempArray["menu"]);
         }
         $this->_menu = $headermenuArray;
     }
     $log =& LogFactory::getLog();
     $log->trace("Filter_HeaderMenuの前処理が実行されました", "Filter_HeaderMenu#execute");
     //
     // 後処理
     //
     $filterChain =& $this->_container->getComponent("FilterChain");
     $filterChain->execute();
     $log->trace("Filter_HeaderMenuの後処理が実行されました", "Filter_HeaderMenu#execute");
 }
Пример #26
0
 /**
  * 指定された属性に値をセット(配列でまとめてセット)
  *
  * @param   array   $attributes 属性の値(配列)
  * @access  public
  * @since   3.0.0
  */
 function setAttributes($attributes)
 {
     $log =& LogFactory::getLog();
     if (!is_array($attributes) || count($attributes) < 1) {
         $log->warn("引数が不正です", "Filter#setAttributes");
         return false;
     }
     foreach ($attributes as $key => $value) {
         $this->setAttribute($key, $value);
     }
 }
 /**
  * エラーハンドラ
  * 
  * @access public
  * @param string  error message
  * @param string  caller info
  */
 function handleError($msg, $caller)
 {
     $log =& LogFactory::getLog();
     $log->error($msg, $caller);
 }
Пример #28
0
 /**
  * DIContainerを生成する
  *
  * @access  public
  * @since   3.0.0
  */
 function &_createDIContainer()
 {
     $log =& LogFactory::getLog();
     if (!@file_exists(WEBAPP_DIR . BASE_INI)) {
         $log->fatal("設定ファイルが存在しません", "Controller#_createDIContainer");
         return;
     }
     $config = parse_ini_file(WEBAPP_DIR . BASE_INI, TRUE);
     if (count($config) < 1) {
         $log->fatal("設定ファイルが不正です", "Controller#_createDIContainer");
         return;
     }
     $container =& DIContainerFactory::getContainer();
     foreach ($config as $key => $value) {
         if (isset($config[$key]["name"])) {
             $className = $config[$key]["name"];
         }
         if (isset($config[$key]["path"])) {
             $filename = $config[$key]["path"];
         }
         if (!$className || !$filename) {
             $log->fatal("設定ファイルが不正です", "Controller#_createDIContainer");
             return;
         }
         include_once $filename;
         $instance =& new $className();
         if (!is_object($instance)) {
             $log->fatal("インスタンスの生成に失敗しました({$className})", "Controller#_createDIContainer");
             return;
         }
         $container->register($instance, $key);
     }
     return $container;
 }
 /**
  * Converter特有の処理を実装する
  *
  * @param   mixed   $attributes 変換する文字列
  * @return  string  変換後の文字列
  * @access  public
  * @since   3.0.0
  */
 function convert($attributes)
 {
     $log =& LogFactory::getLog();
     $log->fatal("Converterでconvert関数が作成されていません。", "Converter#convert");
     exit;
 }
 /**
  * Converterを実行
  *
  * @param   array   $params Convertする条件が入った配列
  * @access  private
  */
 function _convert($params)
 {
     $log =& LogFactory::getLog();
     foreach ($params as $key => $value) {
         $key = preg_replace("/\\s+/", "", $key);
         $value = preg_replace("/\\s+/", "", $value);
         if ($key == "") {
             $log->error("Converterの指定が不正です", "ConverterManager#_convert");
             continue;
         }
         //
         // $key は attribute.name のパターン
         //      又は、attribute.module_name.name のパターン
         //
         $keyArray = explode(".", $key);
         $keyCount = count($keyArray);
         if ($keyCount < 2 && $keyCount > 3) {
             //attribute.name or attribute.module_name.nameでなければ次へ
             break;
         }
         for ($i = 0; $i < $keyCount; $i++) {
             if ($i == 0) {
                 $attribute = $keyArray[$i];
                 // 属性の名前
                 $module_name = "";
             } else {
                 if ($i == $keyCount - 1) {
                     $name = $keyArray[$i];
                 } else {
                     $module_name = strtolower($keyArray[$i]);
                     // モジュールの名前
                 }
             }
         }
         //$name      = strtolower($name);
         $name = $module_name != "" ? $module_name . "." . $name : $name;
         //
         // $value にはConvert後の値を入れる変数名がセットできる
         //
         $newAttribute = $value;
         //
         // Converterを取得
         //
         $converter =& $this->_list[$name];
         if (!is_object($converter)) {
             continue;
         }
         //
         // attributeに * が指定されている場合は
         // リクエストパラメータ全てが変換対象となる
         //
         $container =& DIContainerFactory::getContainer();
         $request =& $container->getComponent("Request");
         if ($attribute == '*') {
             $attribute = join(",", array_keys($request->getParameters()));
         }
         if (preg_match("/,/", $attribute)) {
             $attributes = array();
             foreach (explode(",", $attribute) as $param) {
                 if ($param) {
                     $attributes[$param] = $request->getParameter($param);
                 }
             }
         } else {
             $attributes = $request->getParameter($attribute);
         }
         //
         // Converterを適用
         //
         $result = $converter->convert($attributes);
         if ($newAttribute != "") {
             $request->setParameter($newAttribute, $result);
         } else {
             if (is_array($attributes)) {
                 foreach ($result as $key => $value) {
                     if ($key) {
                         $request->setParameter($key, $value);
                     }
                 }
             } else {
                 $request->setParameter($attribute, $result);
             }
         }
     }
 }