Ignore:
Timestamp:
2013/02/18 19:09:54 (11 years ago)
Author:
shutta
Message:

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.12.4)
Zend Framework PHP 標準コーディング規約のコーディングスタイルへ準拠。
classおよびfunctionの開始波括弧「{」のスタイルを修正。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/sessionfactory/SC_SessionFactory_UseRequest.php

    r22206 r22567  
    3333 * @version $Id$ 
    3434 */ 
    35 class SC_SessionFactory_UseRequest extends SC_SessionFactory_Ex { 
     35class SC_SessionFactory_UseRequest extends SC_SessionFactory_Ex  
     36{ 
    3637 
    3738    var $state = null; 
     
    4546     * @param string $state 
    4647     */ 
    47     function setState($state = 'pc') { 
     48    function setState($state = 'pc') 
     49    { 
    4850        switch ($state) { 
    4951            case 'mobile': 
     
    6365     * @return boolean 常にfalseを返す 
    6466     */ 
    65     function useCookie() { 
     67    function useCookie() 
     68    { 
    6669        return false; 
    6770    } 
     
    7477     *                     取得できなかった場合は null を返す。 
    7578     */ 
    76     function getExtSessionId() { 
     79    function getExtSessionId() 
     80    { 
    7781        if (!preg_match('|^' . ROOT_URLPATH . '(.*)$|', $_SERVER['SCRIPT_NAME'], $matches)) { 
    7882            return null; 
     
    104108     * @return void 
    105109     */ 
    106     function setExtSessionId($param_key, $param_value, $url) { 
     110    function setExtSessionId($param_key, $param_value, $url) 
     111    { 
    107112        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    108113 
     
    127132     * @return boolean セッションデータが有効な場合は true、無効な場合は false を返す。 
    128133     */ 
    129     function validateSession() { 
     134    function validateSession() 
     135    { 
    130136        /** 
    131137         * PCサイトでは 
     
    151157     *                      取得できなかった場合は false を返す。 
    152158     */ 
    153     function getSessionId() { 
     159    function getSessionId() 
     160    { 
    154161        // パラメーターからセッションIDを取得する。 
    155162        $sessionId = @$_POST[session_name()]; 
     
    185192     * @return void 
    186193     */ 
    187     function initSession() { 
     194    function initSession() 
     195    { 
    188196        // セッションIDの受け渡しにクッキーを使用しない。 
    189197        ini_set('session.use_cookies', '0'); 
     
    233241 * 
    234242 */ 
    235 class LC_UseRequest_State { 
     243class LC_UseRequest_State  
     244{ 
    236245    /** 名前空間(pc/mobile) */ 
    237246    var $namespace = ''; 
     
    246255     * @return string 
    247256     */ 
    248     function getNameSpace() { return $this->namespace; } 
     257    function getNameSpace() 
     258    { return $this->namespace; } 
    249259 
    250260    /** 
     
    253263     * @return integer 
    254264     */ 
    255     function getLifeTime() { return $this->lifetime; } 
     265    function getLifeTime() 
     266    { return $this->lifetime; } 
    256267 
    257268    /** 
     
    262273     * @return boolean 
    263274     */ 
    264     function validateNameSpace() { 
     275    function validateNameSpace() 
     276    { 
    265277        $namespace = $this->getNameSpace(); 
    266278        if (isset($_SESSION[$namespace]) && is_array($_SESSION[$namespace])) { 
     
    278290     * @return mixed|null 
    279291     */ 
    280     function getValue($key) { 
     292    function getValue($key) 
     293    { 
    281294        $namespace = $this->getNameSpace(); 
    282295        return isset($_SESSION[$namespace][$key]) 
     
    292305     * @param mixed $value 
    293306     */ 
    294     function setValue($key, $value) { 
     307    function setValue($key, $value) 
     308    { 
    295309        $namespace = $this->getNameSpace(); 
    296310        $_SESSION[$namespace][$key] = $value; 
     
    302316     * @return integer 
    303317     */ 
    304     function getExpire() { 
     318    function getExpire() 
     319    { 
    305320        return $this->getValue('expires'); 
    306321    } 
     
    310325     * 
    311326     */ 
    312     function updateExpire() { 
     327    function updateExpire() 
     328    { 
    313329        $lifetime = $this->getLifeTime(); 
    314330        $this->setValue('expires', time() + $lifetime); 
     
    320336     * @return boolean 
    321337     */ 
    322     function validateExpire() { 
     338    function validateExpire() 
     339    { 
    323340        $expire = $this->getExpire(); 
    324341        if (intval($expire) > time()) { 
     
    335352     * @return string 
    336353     */ 
    337     function getIp() { 
     354    function getIp() 
     355    { 
    338356        return $this->getValue('ip'); 
    339357    } 
     
    343361     * 
    344362     */ 
    345     function updateIp() { 
     363    function updateIp() 
     364    { 
    346365        $this->setValue('ip', $_SERVER['REMOTE_ADDR']); 
    347366    } 
     
    353372     * @return boolean 
    354373     */ 
    355     function validateIp() { 
     374    function validateIp() 
     375    { 
    356376        $ip = $this->getIp(); 
    357377        if (!empty($_SERVER['REMOTE_ADDR']) && $ip === $_SERVER['REMOTE_ADDR']) { 
     
    370390     * @return string 
    371391     */ 
    372     function getModel() { 
     392    function getModel() 
     393    { 
    373394        return $this->getValue('model'); 
    374395    } 
     
    379400     * @return boolean 
    380401     */ 
    381     function validateSessionData() { 
     402    function validateSessionData() 
     403    { 
    382404        foreach ($this->validate as $method) { 
    383405            $method = 'validate' . $method; 
     
    393415     * 
    394416     */ 
    395     function inisializeSessionData() {} 
     417    function inisializeSessionData() 
     418    {} 
    396419} 
    397420 
     
    400423 * 
    401424 */ 
    402 class LC_UseRequest_State_PC extends LC_UseRequest_State { 
     425class LC_UseRequest_State_PC extends LC_UseRequest_State  
     426{ 
    403427 
    404428    /** 
     
    413437     * @return LC_UseRequest_State_PC 
    414438     */ 
    415     function LC_UseRequest_State_PC() { 
     439    function LC_UseRequest_State_PC() 
     440    { 
    416441        $this->namespace = 'pc'; 
    417442        $this->lifetime  = SESSION_LIFETIME; 
     
    423448     * 
    424449     */ 
    425     function updateModel() { 
     450    function updateModel() 
     451    { 
    426452        $this->setValue('model', $_SERVER['HTTP_USER_AGENT']); 
    427453    } 
     
    432458     * @return boolean 
    433459     */ 
    434     function validateModel() { 
     460    function validateModel() 
     461    { 
    435462        $ua = $this->getModel(); 
    436463        if (!empty($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] === $ua) { 
     
    447474     * 
    448475     */ 
    449     function inisializeSessionData() { 
     476    function inisializeSessionData() 
     477    { 
    450478        $_SESSION = array(); 
    451479        $this->updateModel(); 
     
    459487 * 
    460488 */ 
    461 class LC_UseRequest_State_Mobile extends LC_UseRequest_State { 
     489class LC_UseRequest_State_Mobile extends LC_UseRequest_State  
     490{ 
    462491 
    463492    /** 
     
    473502     * @return LC_UseRequest_State_Mobile 
    474503     */ 
    475     function LC_UseRequest_State_Mobile() { 
     504    function LC_UseRequest_State_Mobile() 
     505    { 
    476506        $this->namespace = 'mobile'; 
    477507        $this->lifetime  = MOBILE_SESSION_LIFETIME; 
     
    483513     * 
    484514     */ 
    485     function updateModel() { 
     515    function updateModel() 
     516    { 
    486517        $this->setValue('model', SC_MobileUserAgent_Ex::getModel()); 
    487518    } 
     
    492523     * @return boolean 
    493524     */ 
    494     function validateModel() { 
     525    function validateModel() 
     526    { 
    495527        $modelInSession = $this->getModel(); 
    496528        $model = SC_MobileUserAgent_Ex::getModel(); 
     
    506538     * @return string 
    507539     */ 
    508     function getPhoneId() { 
     540    function getPhoneId() 
     541    { 
    509542        return $this->getValue('phone_id'); 
    510543    } 
     
    514547     * 
    515548     */ 
    516     function updatePhoneId() { 
     549    function updatePhoneId() 
     550    { 
    517551        $this->setValue('phone_id', SC_MobileUserAgent_Ex::getId()); 
    518552    } 
     
    522556     * 
    523557     */ 
    524     function inisializeSessionData() { 
     558    function inisializeSessionData() 
     559    { 
    525560        $_SESSION = array(); 
    526561        $this->updateModel(); 
Note: See TracChangeset for help on using the changeset viewer.