示例#1
0
 public function __construct($repo)
 {
     if (false == $repo instanceof Repo) {
         throw new \InvalidArgumentException('$repo parameter should be an instance of Repo');
     }
     self::Init();
     // Only init when this class instanced.
     $this->fileCacheDir = self::$DefaultFileCacheDir;
     $this->repo = $repo;
     $curl =& $this->curl;
     $curl = curl_init();
     curl_setopt($curl, CURLOPT_USERAGENT, "User-Agent: tellets/" . TELLETS_VERSION);
     curl_setopt($curl, CURLOPT_HEADER, true);
     // will get the header info
     curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
     if (boolval($this->repo->getAuth())) {
         curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
         curl_setopt($curl, CURLOPT_USERPWD, $this->repo->getAuth());
     }
     curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
     // we dont have cert
 }