Show
Ignore:
Timestamp:
07/15/08 00:05:41 (5 years ago)
Author:
sasezaki
Message:

lang/php/Diggin_Service_Wedata: Zend/Jsonのとこdecode設定してたらrequireできなくねってかんじなので

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/php/Diggin_Service_Wedata/library/Diggin/Service/Wedata.php

    r11313 r15815  
    3838    const PATH_UPDATE_ITEM = '/items/%s'; //item id 
    3939    const PATH_DELETE_ITEM = '/items/%s'; //item id 
    40      
    41         /** 
     40 
     41    /** 
    4242     * Zend_Http_Client Object 
    4343     * 
     
    5454     * Constructs a new Wedata Web Service Client 
    5555     * 
    56      * @param   
     56     * @param array $params parameter acording Wedata 
    5757     * @param boolean | string @see Zend_Json 
    58      * @return void 
     58     * @return null 
    5959     */ 
    6060    public function __construct(array $params = null, $decodetype = null) 
     
    6868        if (self::$_decodetype === false) { 
    6969            //nothig to do 
    70         } elseif (self::$_decodetype === null) { 
     70        } else { 
    7171            require_once 'Zend/Json.php'; 
    72             $value = Zend_Json::decode($value, Zend_Json::TYPE_ARRAY); 
    73         } else { 
    74             $value = Zend_Json::decode($value, self::$_decodetype); 
     72            if (self::$_decodetype === null) { 
     73                $value = Zend_Json::decode($value, Zend_Json::TYPE_ARRAY); 
     74            } else { 
     75                $value = Zend_Json::decode($value, self::$_decodetype); 
     76            }     
    7577        } 
    7678         
     
    114116     * adding parameter 
    115117     *  
    116      * @param string 
    117      * @param string 
     118     * @param string $key 
     119     * @param string $value 
    118120     */ 
    119121    public static function setParamDatabase($key, $value) 
     
    147149     * adding parameter 
    148150     *  
    149      * @param string 
    150      * @param string 
     151     * @param string $itemId 
    151152     */ 
    152153    public static function setItemId($itemId) 
     
    156157     
    157158    /** 
     159     * Handles all requests to a web service 
     160     *  
    158161     * @param string path 
    159162     * @param string Prease,using Zend_Http_Client's const 
    160      *  
     163     * @return mixed 
    161164     */ 
    162165    public static function makeRequest($path, $method, array $params = null) 
     
    284287        if (isset(self::$_params['page'])) { 
    285288            $params = array('page' => self::$_params['page']); 
     289        } else { 
     290            $params = null; 
    286291        } 
    287292         
     
    294299    /** 
    295300     *  
    296      * @param string 
    297      *  
     301     * @param string $itemId 
     302     * @param string $page 
     303     * @return array Decording Result 
    298304     */ 
    299305    public static function getItem($itemId = null, $page = null) 
    300306    { 
     307        //@todo if int set as itemid or string searching itemid by name 
     308        //is_integer($item); 
     309        //is_string($item) ; 
     310         
    301311        if ($itemId) self::setItemId($itemId); 
    302312        if ($page) self::setParam('page', $page);