Пример #1
0
 private function getMirror()
 {
     if (self::$mirror != null) {
         return self::$mirror;
     }
     try {
         $info = @file_get_contents("http://www.thetvdb.com/api/{$this->apiKey}/mirrors.xml");
         if ($info === false) {
             throw new Exception();
         }
         $mirrorList = new SimpleXMLElement($info);
     } catch (Exception $e) {
         throw new Exception("Please test with your browser if the page is available: http://www.thetvdb.com/api/{$this->apiKey}/mirrors.xml");
     }
     self::$mirror = $mirrorList->Mirror[0]->mirrorpath . "";
     return self::$mirror;
 }