Changeset 20434


Ignore:
Timestamp:
2011/02/28 11:26:53 (11 years ago)
Author:
nanasess
bzr:base-revision:
nanasess@fsm.ne.jp-20110227191043-aos49z5ibjlzreii
bzr:committer:
Kentaro Ohkouchi <ohkouchi@loop-az.jp>
bzr:file-ids:

data/class/pages/admin/LC_Page_Admin_Home.php 15287@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2FLC_Page_Admin_Home.php
data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php 17293@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2Fclass%2Fpages%2Fadmin%2Forder%2FLC_Page_Admin_Order_ProductSelect.php
data/class/pages/products/LC_Page_Products_Detail.php 15154@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fproducts%2FLC_Page_Products_Detail.php
data/class/pages/products/LC_Page_Products_List.php 15154@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fproducts%2FLC_Page_Products_List.php
data/class/pages/shopping/LC_Page_Shopping_Payment.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping_Payment.php
data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php 16839@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fupgrade%2Fhelper%2FLC_Upgrade_Helper_Json.php
data/class/util/SC_Utils.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Futil%2FSC_Utils.php
data/require_classes.php 18500@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fversion-2_4-dev%2Fdata%2Frequire_classes.php
html/test/upgrade/index.php 16949@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Ftest%2Fupgrade%2Findex.php
bzr:mapping-version:
v4
bzr:merge:

ohkouchi@loop-az.jp-20110228022448-wx5sd6g9ytgp3ej7
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
ohkouchi@loop-az.jp-20110228022635-lhbqmawf5ha1owcm
bzr:revno:
3162
bzr:revprop:branch-nick:
branches/version-2_5-dev
bzr:root:
branches/version-2_5-dev
bzr:text-revisions:

data/class/pages/admin/LC_Page_Admin_Home.php ohkouchi@loop-az.jp-20110228022448-wx5sd6g9ytgp3ej7
data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php ohkouchi@loop-az.jp-20110228022448-wx5sd6g9ytgp3ej7
data/class/pages/products/LC_Page_Products_Detail.php ohkouchi@loop-az.jp-20110228022448-wx5sd6g9ytgp3ej7
data/class/pages/products/LC_Page_Products_List.php ohkouchi@loop-az.jp-20110228022448-wx5sd6g9ytgp3ej7
data/class/pages/shopping/LC_Page_Shopping_Payment.php ohkouchi@loop-az.jp-20110228022448-wx5sd6g9ytgp3ej7
data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php ohkouchi@loop-az.jp-20110228022448-wx5sd6g9ytgp3ej7
data/require_classes.php ohkouchi@loop-az.jp-20110228022448-wx5sd6g9ytgp3ej7
html/test/upgrade/index.php ohkouchi@loop-az.jp-20110228022448-wx5sd6g9ytgp3ej7
bzr:timestamp:
2011-02-28 11:26:35.789000034 +0900
bzr:user-agent:
bzr2.2.1+bzr-svn1.0.4
svn:original-date:
2011-02-28T02:26:35.789000Z
Message:

#803(JSON モジュールの統一及び高速化)

Location:
branches/version-2_5-dev
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/admin/LC_Page_Admin_Home.php

    r20345 r20434  
    317317        $jsonStr = @file_get_contents($url, false, stream_context_create($context)); 
    318318 
    319         $objJson = new Services_JSON; 
    320         $arrTmpData = is_string($jsonStr) ? $objJson->decode($jsonStr) : null; 
     319        $arrTmpData = is_string($jsonStr) ? SC_Utils_Ex::jsonDecode($jsonStr) : null; 
    321320 
    322321        if (empty($arrTmpData)) { 
  • branches/version-2_5-dev/data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php

    r20427 r20434  
    159159     */ 
    160160    function getTplJavascript(&$objProduct){ 
    161         $objJson = new Services_JSON(); 
    162         return  'productsClassCategories = ' . $objJson->encode($objProduct->classCategories) . '; '; 
     161        return  'productsClassCategories = ' . SC_Utils_Ex::jsonEncode($objProduct->classCategories) . '; '; 
    163162    } 
    164163 
  • branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_Detail.php

    r20408 r20434  
    132132        $this->tpl_product_type = $objProduct->classCategories[$product_id]['']['']['product_type']; 
    133133 
    134         $objJson = new Services_JSON(); 
    135         $this->tpl_javascript .= 'classCategories = ' . $objJson->encode($objProduct->classCategories[$product_id]) . ';'; 
     134        $this->tpl_javascript .= 'classCategories = ' . SC_Utils_Ex::jsonEncode($objProduct->classCategories[$product_id]) . ';'; 
    136135        $this->tpl_javascript .= 'function lnOnLoad(){' . $this->js_lnOnload . '}'; 
    137136        $this->tpl_onload .= 'lnOnLoad();'; 
     
    316315        return  'fnSetClassCategories(' 
    317316            . 'document.form1, ' 
    318             . Services_JSON::encode($this->objFormParam->getValue('classcategory_id2')) 
     317            . SC_Utils_Ex::jsonEncode($this->objFormParam->getValue('classcategory_id2')) 
    319318            . '); '; 
    320319    } 
  • branches/version-2_5-dev/data/class/pages/products/LC_Page_Products_List.php

    r20344 r20434  
    152152        $this->productStatus = $this->arrProducts["productStatus"]; 
    153153        unset($this->arrProducts["productStatus"]); 
    154  
    155         $objJson = new Services_JSON(); 
    156         $this->tpl_javascript .= 'var productsClassCategories = ' . $objJson->encode($objProduct->classCategories) . ';'; 
    157  
     154        $this->tpl_javascript .= 'var productsClassCategories = ' . SC_Utils_Ex::jsonEncode($objProduct->classCategories) . ';'; 
    158155        //onloadスクリプトを設定 
    159156        foreach ($this->arrProducts as $arrProduct) { 
  • branches/version-2_5-dev/data/class/pages/shopping/LC_Page_Shopping_Payment.php

    r20384 r20434  
    143143 
    144144            if (SC_Display::detectDevice() != DEVICE_TYPE_MOBILE) { 
    145                 $objJson = new Services_JSON(); 
    146                 echo $objJson->encode($arrSelectedDeliv); 
     145                echo SC_Utils_Ex::jsonEncode($arrSelectedDeliv); 
    147146                exit; 
    148147            } else { 
  • branches/version-2_5-dev/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php

    r19684 r20434  
    8383     * @param string $str 
    8484     * @return StdClass 
     85     * @see SC_Utils_Ex::jsonDecode 
    8586     */ 
    8687    function decode($str) { 
    87         if (function_exists('json_decode')) { 
    88             LC_Upgrade_Helper_Log::log(' *use json_decode()'); 
    89             return json_decode($str); 
    90         } 
    91  
    92         LC_Upgrade_Helper_Log::log(' *use Services_JSON::decode()'); 
    93         return parent::decode($str); 
     88        return SC_Utils_Ex::jsonDecode($str); 
    9489    } 
    9590} 
  • branches/version-2_5-dev/data/class/util/SC_Utils.php

    r20428 r20434  
    23112311    } 
    23122312 
     2313    /** 
     2314     * 値を JSON 形式にして返す. 
     2315     * 
     2316     * この関数は, json_encode() 又は Services_JSON::encode() のラッパーです. 
     2317     * json_encode() 関数が使用可能な場合は json_encode() 関数を使用する. 
     2318     * 使用できない場合は, Services_JSON::encode() 関数を使用する. 
     2319     * 
     2320     * @param mixed $value JSON 形式にエンコードする値 
     2321     * @return string JSON 形式にした文字列 
     2322     * @see json_encode() 
     2323     * @see Services_JSON::encode() 
     2324     */ 
     2325    function jsonEncode($value) { 
     2326        if (function_exists('json_encode')) { 
     2327            return json_encode($value); 
     2328        } else { 
     2329            require_once(dirname(__FILE__) . '/../../module/Services/JSON.php'); 
     2330            GC_Utils::gfPrintLog(' *use Services_JSON::encode(). faster than using the json_encode!'); 
     2331            $objJson = new Services_JSON(); 
     2332            return $objJson->encode($value); 
     2333        } 
     2334    } 
     2335 
     2336    /** 
     2337     * JSON 文字列をデコードする. 
     2338     * 
     2339     * この関数は, json_decode() 又は Services_JSON::decode() のラッパーです. 
     2340     * json_decode() 関数が使用可能な場合は json_decode() 関数を使用する. 
     2341     * 使用できない場合は, Services_JSON::decode() 関数を使用する. 
     2342     * 
     2343     * @param string $json JSON 形式にエンコードされた文字列 
     2344     * @return mixed デコードされた PHP の型 
     2345     * @see json_decode() 
     2346     * @see Services_JSON::decode() 
     2347     */ 
     2348    function jsonDecode($json) { 
     2349        if (function_exists('json_decode')) { 
     2350            return json_decode($json); 
     2351        } else { 
     2352            require_once(dirname(__FILE__) . '/../../module/Services/JSON.php'); 
     2353            GC_Utils::gfPrintLog(' *use Services_JSON::decode(). faster than using the json_decode!'); 
     2354            $objJson = new Services_JSON(); 
     2355            return $objJson->decode($json); 
     2356        } 
     2357    } 
    23132358} 
    23142359?> 
  • branches/version-2_5-dev/data/require_classes.php

    r20306 r20434  
    2222 */ 
    2323 
    24 require_once(DATA_REALDIR . "module/Services/JSON.php"); 
    2524require_once(CLASS_EX_REALDIR . "util_extends/GC_Utils_Ex.php"); 
    2625require_once(CLASS_EX_REALDIR . "util_extends/SC_Utils_Ex.php"); 
  • branches/version-2_5-dev/html/test/upgrade/index.php

    r19684 r20434  
    9696    updateModuleTable($arrProductsList); 
    9797 
    98     $objJson = new Services_JSON(); 
    99     echo $objJson->encode($arrRet); 
     98    echo SC_Utils_Ex::jsonEncode($arrRet); 
    10099} 
    101100 
Note: See TracChangeset for help on using the changeset viewer.