Example #1
0
 private function after(HttpGetResponse $res)
 {
     if (CURLE_OK !== $res->errno) {
         throw new Downloader\TransportException("{$res->error}:{$res->errno}");
     }
     if (in_array($res->info['http_code'], array(401, 403, 404))) {
         $res->setNeedAuth();
         return;
     }
 }
Example #2
0
 public function after(HttpGetResponse $res)
 {
     if (CURLE_OK !== $res->errno) {
         throw new Downloader\TransportException("{$res->error}:{$res->errno}");
     }
     switch ($res->info['http_code']) {
         case 200:
             //OK
             return;
         case 401:
             //Unauthorized
         //Unauthorized
         case 403:
             //Forbidden
         //Forbidden
         case 404:
             //Not Found
             $res->setNeedAuth();
             break;
         case 407:
             //Proxy Authentication Required
             break;
     }
 }