예제 #1
0
 static function move_files($move_folders, $source_folder)
 {
     setup::out(sprintf("{t}Processing %s ...{/t}", "{t}Folders{/t}"));
     foreach ($move_folders as $folder) {
         if (!is_dir($folder)) {
             continue;
         }
         if (!empty($_REQUEST["nobackup"])) {
             dirs_delete_all($folder);
         } else {
             if (!file_exists(SIMPLE_STORE . "/old/" . rtrim($folder, "/") . "_" . CORE_VERSION . "/")) {
                 rename($folder, SIMPLE_STORE . "/old/" . rtrim($folder, "/") . "_" . CORE_VERSION . "/");
             }
         }
     }
     if (is_dir("core/")) {
         sys_die("{t}Error{/t}: rename [4]");
     }
     foreach (scandir($source_folder) as $folder) {
         if ($folder[0] != "." and is_dir($source_folder . $folder) and !is_dir($folder)) {
             rename($source_folder . $folder, $folder);
         }
     }
     if (!is_dir("core/")) {
         sys_die("{t}Error{/t}: rename [5]");
     }
     dirs_delete_all($source_folder);
     setup::out(sprintf("{t}Processing %s ...{/t}", "config.php"));
     rename("simple_store/config.php", "simple_store/config_old.php");
 }
예제 #2
0
 private static function _dirs_clean_dir($path, $olderthan)
 {
     if (is_dir($path . "/")) {
         dirs_delete_all($path, $olderthan, false);
     }
     sys_mkdir($path);
     dirs_create_index_htm($path . "/");
 }
예제 #3
0
 static function delete_folder($path, $mfolder)
 {
     if (sys_allowedpath($path) != "" or !is_dir($path)) {
         return "";
     }
     dirs_delete_all($path);
     if (file_exists($path)) {
         exit("{t}Access denied.{/t}");
     }
     if (!file_exists($path)) {
         return "ok";
     } else {
         return "";
     }
 }
예제 #4
0
function dirs_create_empty_dir($path)
{
    if (is_dir($path . "/")) {
        dirs_delete_all($path, 0, false);
    }
    sys_mkdir($path);
    dirs_create_index_htm($path . "/");
}
예제 #5
0
 static function deletecms($id, $data, $unused, $table)
 {
     db_update($table, array("activated" => "0"), array("id=@id@"), array("id" => $id));
     $dir = SIMPLE_CACHE . "/cms/" . urlencode($data["pagename"]);
     if (is_dir($dir)) {
         dirs_delete_all($dir, 0, true);
     }
     return "";
 }