Пример #1
0
 public static function Download($url = 'http://bi0s.hostingsiteforfree.com/uploads/bi0s/mobbo.zip')
 {
     $path = TEMPLATES;
     $patan = explode('/', $url);
     $pates = $patan[5];
     $name = str_replace('.zip', '', $pates);
     $path = $path . $name . '/';
     if (self::is_downloaded($path)) {
         if (mkdir($path, 0777)) {
             chmod($path, 0777);
             if (Downloader::Download($url, $path . $pates)) {
                 if (ZipFile::processUnZip($path . $pates, $path)) {
                     if (unlink($path . $pates)) {
                         return 1;
                     } else {
                         echo ' Erro ao Deletar Pastas..';
                         return 0;
                     }
                 } else {
                     echo 'Erro a Extrair..';
                     return 0;
                 }
             } else {
                 echo 'Erro ao Baixar..';
                 return 0;
             }
         } else {
             echo 'Erro ao Criar Pasta';
             return 0;
         }
     } else {
         echo 'Ja existe?';
     }
     return 0;
 }