Changeset 21963


Ignore:
Timestamp:
2012/07/09 10:57:24 (12 years ago)
Author:
Seasoft
Message:

r21962(機種端末IDをスタティック変数に保持する.)の修正。

  • PHP5.4で動作しない不具合を修正。
  • コメントが外国語となっていたので差し戻し。
  • コメントの修正・追記。
  • 判定基準の見直し。(初期値を正と見なした。)
File:
1 edited

Legend:

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

    r21962 r21963  
    3232    var $response; 
    3333 
    34     var $device; 
     34    /** 端末種別を保持する */ 
     35    // XXX プロパティとして保持する必要があるのか疑問。 
     36    static $device; 
    3537 
    3638    /** SC_View インスタンス */ 
     
    130132 
    131133    /** 
    132      * Detect the viewing device. 
     134     * 端末種別を判別する。 
    133135     * 
    134      * SC_Display::MOBILE = k-tai = 1 
    135      * SC_Display::SMARTPHONE = smart phone = 2 
     136     * SC_Display::MOBILE = ガラケー = 1 
     137     * SC_Display::SMARTPHONE = スマホ = 2 
    136138     * SC_Display::PC = PC = 10 
    137139     * 
    138140     * @static 
    139141     * @param   $reset  boolean 
    140      * @return  integer Device Type ID 
     142     * @return integer 端末種別ID 
    141143     */ 
    142144    public static function detectDevice($reset = FALSE) { 
    143         if (empty(SC_Display_Ex::$device) || $reset) { 
     145        if (is_null(SC_Display_Ex::$device) || $reset) { 
    144146            $nu = new Net_UserAgent_Mobile(); 
    145147            $su = new SC_SmartphoneUserAgent_Ex(); 
Note: See TracChangeset for help on using the changeset viewer.