public function downloadModule($fileUrl, $savePath, $unzip = 'no')
 {
     // self::uploadFromUrl($fileUrl,$savePath);
     $imgData = Http::getDataUrl($fileUrl);
     $fileName = basename($fileUrl);
     $fullPath = ROOT_PATH . $savePath . $fileName;
     File::create($fullPath, $imgData);
     if ($unzip != 'no') {
         self::unzipModule($fullPath, 'yes');
     }
 }
 public static function get()
 {
     $loadData = Http::getDataUrl(SERVER_URL . 'api/plugin/noblessestore/get_update');
     $loadData = json_decode($loadData, true);
     return $loadData;
 }
Exemple #3
0
 public static function fromUrl($inputData)
 {
     $resultData = Http::getDataUrl($inputData);
     $resultData = self::parseProcess($resultData);
     return $resultData;
 }
Exemple #4
0
 public static function uploadFromUrl($imgUrl, $shortPath = 'uploads/files/')
 {
     $imgUrl = trim($imgUrl);
     if (!preg_match('/^http.*?\\.(\\w+)/i', $imgUrl, $match)) {
         return false;
     }
     $newName = String::randNumber(10);
     $shortPath .= $newName;
     mkdir(ROOT_PATH . $shortPath);
     $shortPath .= '/' . basename($imgUrl);
     $fullPath = ROOT_PATH . $shortPath;
     $imgData = Http::getDataUrl($imgUrl);
     File::create($fullPath, $imgData);
     return $shortPath;
 }