Пример #1
0
 public static function showBackups(&$website)
 {
     $dir = MainWP_Utility::getMainWPSpecificDir($website->id);
     if (!file_exists($dir . 'index.php')) {
         @touch($dir . 'index.php');
     }
     $dbBackups = array();
     $fullBackups = array();
     if (file_exists($dir) && ($dh = opendir($dir))) {
         while (($file = readdir($dh)) !== false) {
             if ($file != '.' && $file != '..') {
                 $theFile = $dir . $file;
                 if (MainWP_Utility::isSQLFile($file)) {
                     $dbBackups[filemtime($theFile) . $file] = $theFile;
                 } else {
                     if (MainWP_Utility::isArchive($file)) {
                         $fullBackups[filemtime($theFile) . $file] = $theFile;
                     }
                 }
             }
         }
         closedir($dh);
     }
     krsort($dbBackups);
     krsort($fullBackups);
     MainWP_Manage_Sites_View::showBackups($website, $fullBackups, $dbBackups);
 }