Exemplo n.º 1
0
 static function addEntry($object_id, $action_id, $description, $user_id, $table)
 {
     if (!is_numeric($object_id)) {
         return FALSE;
     }
     if ($action_id == '') {
         return FALSE;
     }
     if ($user_id == '') {
         global $current_user;
         if (is_object($current_user)) {
             $user_id = $current_user->getId();
         } else {
             $user_id = 0;
         }
     }
     if ($table == '') {
         return FALSE;
     }
     $lf = new LogFactory();
     $lf->setObject($object_id);
     $lf->setAction($action_id);
     $lf->setTableName($table);
     $lf->setUser((int) $user_id);
     $lf->setDescription($description);
     //Debug::text('Object ID: '. $object_id .' Action ID: '. $action_id .' Table: '. $table .' Description: '. $description, __FILE__, __LINE__, __METHOD__, 10);
     if ($lf->isValid() === TRUE) {
         $lf->Save();
         return TRUE;
     }
     return FALSE;
 }
Exemplo n.º 2
0
 public function __construct($logType = '')
 {
     if (!empty($logType)) {
         $this->logType = $logType;
     }
     $this->log = LogFactory::factory($logType);
 }
 /**
  * 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");
 }
 /**
  * セッション処理を行う
  *
  * @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");
 }
 /**
  * コンポーネントのプロパティを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");
 }
 /**
  * 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");
 }
 protected function _exec()
 {
     $payLog = LogFactory::getLogger(array('prefix' => LogFactory::LOG_MODULE_PLATFORM, 'log_dir' => APP_ROOT . '/log/ApplePayment/', 'archive' => ILogger::ARCHIVE_YEAR_MONTH, 'log_level' => 1));
     $gameuid = $this->getParam("gameuid", 'string');
     $key = $this->getParam("key", 'string');
     //提交审核的时候 使用 沙箱地址
     //		$verify_url = "https://sandbox.itunes.apple.com/verifyReceipt";
     $verify_url = 'https://buy.itunes.apple.com/verifyReceipt';
     $verify_postfields = json_encode(array("receipt-data" => $key));
     $res = HttpRequest::post($verify_url, $verify_postfields);
     $resData = json_decode($res['data'], true);
     if ($resData !== NULL && $resData["status"] == 0) {
         $tradeManager = new TradeLogManager();
         $receipt = $resData["receipt"];
         $id = $receipt['transaction_id'];
         $account = $this->user_account_mgr->getUserAccount($gameuid);
         $payLog->writeInfo($gameuid . " || " . $account['gem'] . " || " . json_encode($receipt));
         $cached_orders = $tradeManager->getOrderCache($gameuid);
         if (empty($cached_orders)) {
             $cached_orders = array();
         }
         if (empty($receipt)) {
             return array('status' => 'error');
         }
         if (in_array($id, $cached_orders)) {
             return TRUE;
         }
         $rewards = InitUser::$treasure_activity;
         $product_id = $receipt['product_id'];
         if ($product_id == "FAMEGEM01") {
             $change['gem'] = 200;
             $item = $this->addReward($gameuid, $rewards['littleFarmGem']);
         } elseif ($product_id == "FAMEGEM02") {
             $change['gem'] = 1100;
             $item = $this->addReward($gameuid, $rewards['largeFarmGem']);
         } else {
             $this->throwException("wrong product_id :" . $product_id, GameStatusCode::PARAMETER_ERROR);
         }
         $this->user_account_mgr->updateUserStatus($gameuid, $change);
         $tradeinfo = array();
         $tradeinfo['gameuid'] = $gameuid;
         $tradeinfo['product_id'] = $product_id;
         $tradeinfo['platform'] = "apple";
         $tradeinfo['orderId'] = $id;
         $tradeinfo['purchaseState'] = 1;
         $tradeinfo['purchasetime'] = time();
         $tradeinfo['status'] = 1;
         $tradeManager->insert($tradeinfo);
         $new_account = $this->user_account_mgr->getUserAccount($gameuid);
         array_push($cached_orders, $id);
         $tradeManager->setOrderCache($gameuid, $cached_orders);
         $payLog->writeInfo($gameuid . " || " . $new_account['gem']);
         if (empty($item)) {
             return array("gem" => $new_account['gem']);
         } else {
             return array("gem" => $new_account['gem'], "items" => $item);
         }
     }
 }
Exemplo n.º 11
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");
 }
Exemplo n.º 12
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());
 }
 public function __construct($gameuid)
 {
     parent::__construct();
     $this->gameuid = $gameuid;
     $this->log = $this->getFromCache($this->getMemKey(), $this->gameuid);
     if ($this->log === false) {
         $this->log = array();
     }
     $this->log_formatter = new EventLogFormatter();
     $this->logger_self = LogFactory::getLogger(array('prefix' => "event_log", 'log_dir' => APP_ROOT . '/log/eventLog/', 'archive' => ILogger::ARCHIVE_YEAR_MONTH, 'log_level' => 1));
 }
Exemplo n.º 14
0
 /**
  * 静态工厂方法,获取相应的LOG接口类
  * @param string $log_type
  * @author Terry<*****@*****.**>
  * @date 2013-08-29
  * @return object
  */
 public static function factory($logType)
 {
     $className = isset(self::$logClass[$logType]) ? self::$logClass[$logType] : '';
     if (!class_exists($className)) {
         throw new IException('the Log Class is not exists', 403);
     }
     if (!self::$log instanceof ILogs) {
         self::$log = new $className();
     }
     return self::$log;
 }
 /**
  * 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->_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");
 }
 /**
  * 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");
 }
 /**
  * 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");
 }
Exemplo n.º 20
0
 /**
  * セッション処理を行う
  *
  * @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");
 }
 /**
  * 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();
 }
 /**
  * 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");
 }
Exemplo n.º 23
0
 /**
  * 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");
 }
Exemplo n.º 28
0
 /**
  * デバッグ情報を表示する
  *
  * @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");
 }