Changeset 18901 for lang/php

Show
Ignore:
Timestamp:
09/05/08 22:55:58 (3 months ago)
Author:
sasezaki
Message:

lang/php/ びちょうせい(Http/Client/Adapter/TestPlus.phpとかの

Location:
lang/php
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/php/Scraper/demos/Diggin/twitterfollow2wassr.php

    r17801 r18901  
    5050              $client->setUri('http://wassr.jp/friend/add'); 
    5151              $client->request('POST'); 
    52           } catch (Diggin_Scraper_Exception $e){ 
     52          } catch (Diggin_Scraper_Strategy_Exception $e){ 
    5353              echo $list .' is not join wassr or you had KOUDOKU'; 
    5454               
  • lang/php/ZendFramework_ext/library/Diggin/Http/Client/Adapter/TestPlus.php

    r17595 r18901  
    139139     */ 
    140140    public function connect($host, $port = 80, $secure = false) 
    141     { } 
     141    {  
     142        //require_once 'Zend/Http/Client/Adapter/Exception.php'; 
     143        //throw new Zend_Http_Client_Adapter_Exception('Unable to set the connection timeout'); 
     144    } 
    142145 
    143146    /** 
     
    197200            }             
    198201             
    199             $randkey = mt_rand(0, count($keys)-1); 
    200             $code = $keys[$randkey]; 
     202            shuffle($keys); 
     203            $code = current($keys); 
    201204             
    202205            $headers = Zend_Http_Response::extractHeaders($response_str); 
  • lang/php/ZendFramework_ext/library/Diggin/Http/CookieJar/Loader/Firefox3.php

    r17598 r18901  
    3434     * @param string $use_topppp_domain //@todo 
    3535     * @return Zend_Http_CookieJar 
     36     * @throws Diggin_Http_CookieJar_Loader_Exception 
    3637     */ 
    3738    public static function load($path, $ref_uri = true, $use_topppp_domain = false) 
     
    5960        } 
    6061         
    61         require_once 'Zend/Db.php';         
    62         $db = Zend_Db::factory('Pdo_Sqlite', array('dbname' => $path) ); 
    63         $db->setFetchMode(Zend_Db::FETCH_OBJ); 
    64         $select = $db->select()->from(self::TABLENAME); 
    65         if ($ref_uri !== false) { 
    66             $select = $select->where('host = ?', $host)->orWhere('host = ?', '.'.$host); 
     62        require_once 'Zend/Db.php'; 
     63        try { 
     64            $db = Zend_Db::factory('Pdo_Sqlite', array('dbname' => $path) ); 
     65            $db->setFetchMode(Zend_Db::FETCH_OBJ); 
     66            $select = $db->select()->from(self::TABLENAME); 
     67            if ($ref_uri !== false) { 
     68                $select = $select->where('host = ?', $host)->orWhere('host = ?', '.'.$host); 
     69             
     70                if (is_string($use_topppp_domain)) { 
     71                    $select = $select->orWhere('host = ?', $use_topppp_domain); 
     72                } 
     73            } 
     74     
     75            $fetch = $db->fetchAll($select); 
     76        } catch (Zend_Db_Exception $e) { 
     77            require_once 'Diggin/Http/CookieJar/Loader/Exception.php'; 
     78            throw new Diggin_Http_CookieJar_Loader_Exception($e); 
    6779        } 
    68  
    69         $fetch = $db->fetchAll($select); 
    7080 
    7181        if (count($fetch) === 0) { 
     
    7686        require_once 'Zend/Http/CookieJar.php'; 
    7787        $cookieJar = new Zend_Http_CookieJar(); 
    78         foreach ($fetch as $result) {   
    79             $cookie = new Zend_Http_Cookie($result->name,  //cookie->name 
    80                                            $result->value, //cookie->value 
    81                                            $result->host,   //cookie->domain 
    82                                            $result->expiry, // exipry / cookie->expires 
    83                                            $result->path,   //cookie->path = null,  
    84                                            (boolean)$result->isSecure); 
    85             $cookieJar->addCookie($cookie); 
     88        foreach ($fetch as $result) { 
     89            if ($result->name and $result->value and $result->host) {   
     90                $cookie = new Zend_Http_Cookie($result->name,  //cookie->name 
     91                                               $result->value, //cookie->value 
     92                                               $result->host,   //cookie->domain 
     93                                               $result->expiry, // exipry / cookie->expires 
     94                                               $result->path,   //cookie->path = null,  
     95                                               (boolean)$result->isSecure); 
     96                $cookieJar->addCookie($cookie); 
     97            } 
    8698        } 
    8799