Пример #1
0
 /**
  * @param string $url
  * @param boolean $save
  * @param string $new_file_name
  * @return boolean|array
  */
 public function getRemoteFile($url, $save = true, $new_file_name = '')
 {
     if (!$url) {
         return false;
     }
     $file = new AConnect();
     if ($save) {
         $result = $file->getFile($url, $new_file_name);
         //download
     } else {
         $result = $file->getResponse($url);
         // just get data
     }
     if (!$result) {
         $this->error = $file->error;
         return false;
     }
     return $result;
 }
Пример #2
0
 /**
  * this method download xml-file with updates info from remote server.
  * @return boolean
  */
 private function getUpdateInfo()
 {
     if (file_exists($this->updates_path . 'updates.xml')) {
         unlink($this->updates_path . 'updates.xml');
     }
     $pack = new AConnect();
     $info = $pack->getFile($this->updates_url, $this->updates_path . 'updates.xml');
     // get xml-file with updates information
     if ($info) {
         return true;
     }
     return false;
 }