Ignore:
Timestamp:
2013/05/02 18:11:36 (11 years ago)
Author:
h_yoshimoto
Message:

#2236 2.12.3リリース以降の2.12-devへのコミット差し戻し

File:
1 edited

Legend:

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

    r22567 r22796  
    3333 * @version $Id$ 
    3434 */ 
    35 class SC_SessionFactory_UseRequest extends SC_SessionFactory_Ex  
    36 { 
     35class SC_SessionFactory_UseRequest extends SC_SessionFactory_Ex { 
    3736 
    3837    var $state = null; 
     
    4645     * @param string $state 
    4746     */ 
    48     function setState($state = 'pc') 
    49     { 
     47    function setState($state = 'pc') { 
    5048        switch ($state) { 
    5149            case 'mobile': 
     
    6563     * @return boolean 常にfalseを返す 
    6664     */ 
    67     function useCookie() 
    68     { 
     65    function useCookie() { 
    6966        return false; 
    7067    } 
     
    7774     *                     取得できなかった場合は null を返す。 
    7875     */ 
    79     function getExtSessionId() 
    80     { 
     76    function getExtSessionId() { 
    8177        if (!preg_match('|^' . ROOT_URLPATH . '(.*)$|', $_SERVER['SCRIPT_NAME'], $matches)) { 
    8278            return null; 
     
    108104     * @return void 
    109105     */ 
    110     function setExtSessionId($param_key, $param_value, $url) 
    111     { 
     106    function setExtSessionId($param_key, $param_value, $url) { 
    112107        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
    113108 
     
    132127     * @return boolean セッションデータが有効な場合は true、無効な場合は false を返す。 
    133128     */ 
    134     function validateSession() 
    135     { 
     129    function validateSession() { 
    136130        /** 
    137131         * PCサイトでは 
     
    157151     *                      取得できなかった場合は false を返す。 
    158152     */ 
    159     function getSessionId() 
    160     { 
     153    function getSessionId() { 
    161154        // パラメーターからセッションIDを取得する。 
    162155        $sessionId = @$_POST[session_name()]; 
     
    192185     * @return void 
    193186     */ 
    194     function initSession() 
    195     { 
     187    function initSession() { 
    196188        // セッションIDの受け渡しにクッキーを使用しない。 
    197189        ini_set('session.use_cookies', '0'); 
     
    241233 * 
    242234 */ 
    243 class LC_UseRequest_State  
    244 { 
     235class LC_UseRequest_State { 
    245236    /** 名前空間(pc/mobile) */ 
    246237    var $namespace = ''; 
     
    255246     * @return string 
    256247     */ 
    257     function getNameSpace() 
    258     { return $this->namespace; } 
     248    function getNameSpace() { return $this->namespace; } 
    259249 
    260250    /** 
     
    263253     * @return integer 
    264254     */ 
    265     function getLifeTime() 
    266     { return $this->lifetime; } 
     255    function getLifeTime() { return $this->lifetime; } 
    267256 
    268257    /** 
     
    273262     * @return boolean 
    274263     */ 
    275     function validateNameSpace() 
    276     { 
     264    function validateNameSpace() { 
    277265        $namespace = $this->getNameSpace(); 
    278266        if (isset($_SESSION[$namespace]) && is_array($_SESSION[$namespace])) { 
     
    290278     * @return mixed|null 
    291279     */ 
    292     function getValue($key) 
    293     { 
     280    function getValue($key) { 
    294281        $namespace = $this->getNameSpace(); 
    295282        return isset($_SESSION[$namespace][$key]) 
     
    305292     * @param mixed $value 
    306293     */ 
    307     function setValue($key, $value) 
    308     { 
     294    function setValue($key, $value) { 
    309295        $namespace = $this->getNameSpace(); 
    310296        $_SESSION[$namespace][$key] = $value; 
     
    316302     * @return integer 
    317303     */ 
    318     function getExpire() 
    319     { 
     304    function getExpire() { 
    320305        return $this->getValue('expires'); 
    321306    } 
     
    325310     * 
    326311     */ 
    327     function updateExpire() 
    328     { 
     312    function updateExpire() { 
    329313        $lifetime = $this->getLifeTime(); 
    330314        $this->setValue('expires', time() + $lifetime); 
     
    336320     * @return boolean 
    337321     */ 
    338     function validateExpire() 
    339     { 
     322    function validateExpire() { 
    340323        $expire = $this->getExpire(); 
    341324        if (intval($expire) > time()) { 
     
    352335     * @return string 
    353336     */ 
    354     function getIp() 
    355     { 
     337    function getIp() { 
    356338        return $this->getValue('ip'); 
    357339    } 
     
    361343     * 
    362344     */ 
    363     function updateIp() 
    364     { 
     345    function updateIp() { 
    365346        $this->setValue('ip', $_SERVER['REMOTE_ADDR']); 
    366347    } 
     
    372353     * @return boolean 
    373354     */ 
    374     function validateIp() 
    375     { 
     355    function validateIp() { 
    376356        $ip = $this->getIp(); 
    377357        if (!empty($_SERVER['REMOTE_ADDR']) && $ip === $_SERVER['REMOTE_ADDR']) { 
     
    390370     * @return string 
    391371     */ 
    392     function getModel() 
    393     { 
     372    function getModel() { 
    394373        return $this->getValue('model'); 
    395374    } 
     
    400379     * @return boolean 
    401380     */ 
    402     function validateSessionData() 
    403     { 
     381    function validateSessionData() { 
    404382        foreach ($this->validate as $method) { 
    405383            $method = 'validate' . $method; 
     
    415393     * 
    416394     */ 
    417     function inisializeSessionData() 
    418     {} 
     395    function inisializeSessionData() {} 
    419396} 
    420397 
     
    423400 * 
    424401 */ 
    425 class LC_UseRequest_State_PC extends LC_UseRequest_State  
    426 { 
     402class LC_UseRequest_State_PC extends LC_UseRequest_State { 
    427403 
    428404    /** 
     
    437413     * @return LC_UseRequest_State_PC 
    438414     */ 
    439     function LC_UseRequest_State_PC() 
    440     { 
     415    function LC_UseRequest_State_PC() { 
    441416        $this->namespace = 'pc'; 
    442417        $this->lifetime  = SESSION_LIFETIME; 
     
    448423     * 
    449424     */ 
    450     function updateModel() 
    451     { 
     425    function updateModel() { 
    452426        $this->setValue('model', $_SERVER['HTTP_USER_AGENT']); 
    453427    } 
     
    458432     * @return boolean 
    459433     */ 
    460     function validateModel() 
    461     { 
     434    function validateModel() { 
    462435        $ua = $this->getModel(); 
    463436        if (!empty($_SERVER['HTTP_USER_AGENT']) && $_SERVER['HTTP_USER_AGENT'] === $ua) { 
     
    474447     * 
    475448     */ 
    476     function inisializeSessionData() 
    477     { 
     449    function inisializeSessionData() { 
    478450        $_SESSION = array(); 
    479451        $this->updateModel(); 
     
    487459 * 
    488460 */ 
    489 class LC_UseRequest_State_Mobile extends LC_UseRequest_State  
    490 { 
     461class LC_UseRequest_State_Mobile extends LC_UseRequest_State { 
    491462 
    492463    /** 
     
    502473     * @return LC_UseRequest_State_Mobile 
    503474     */ 
    504     function LC_UseRequest_State_Mobile() 
    505     { 
     475    function LC_UseRequest_State_Mobile() { 
    506476        $this->namespace = 'mobile'; 
    507477        $this->lifetime  = MOBILE_SESSION_LIFETIME; 
     
    513483     * 
    514484     */ 
    515     function updateModel() 
    516     { 
     485    function updateModel() { 
    517486        $this->setValue('model', SC_MobileUserAgent_Ex::getModel()); 
    518487    } 
     
    523492     * @return boolean 
    524493     */ 
    525     function validateModel() 
    526     { 
     494    function validateModel() { 
    527495        $modelInSession = $this->getModel(); 
    528496        $model = SC_MobileUserAgent_Ex::getModel(); 
     
    538506     * @return string 
    539507     */ 
    540     function getPhoneId() 
    541     { 
     508    function getPhoneId() { 
    542509        return $this->getValue('phone_id'); 
    543510    } 
     
    547514     * 
    548515     */ 
    549     function updatePhoneId() 
    550     { 
     516    function updatePhoneId() { 
    551517        $this->setValue('phone_id', SC_MobileUserAgent_Ex::getId()); 
    552518    } 
     
    556522     * 
    557523     */ 
    558     function inisializeSessionData() 
    559     { 
     524    function inisializeSessionData() { 
    560525        $_SESSION = array(); 
    561526        $this->updateModel(); 
Note: See TracChangeset for help on using the changeset viewer.