Exemplo n.º 1
0
 public static function create($userAgent = self::UA_DEFAULT)
 {
     $client = new Client();
     $client->setOpt('USERAGENT', $userAgent);
     $browser = new Browser($client);
     return $browser;
 }
Exemplo n.º 2
0
 public function setOpt($name, $value = null)
 {
     if (is_array($name)) {
         foreach ($name as $k => $v) {
             $this->setOpt($k, $v);
         }
         return $this;
     }
     if (is_string($name)) {
         $num = self::$map[Client::getOptToInt($name)];
     } else {
         $num = $name;
     }
     curl_setopt($this->handler(), $num, $value);
 }