當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dir::remove方法代碼示例

本文整理匯總了PHP中Dir::remove方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dir::remove方法的具體用法?PHP Dir::remove怎麽用?PHP Dir::remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dir的用法示例。


在下文中一共展示了Dir::remove方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: make

 public static function make($inputData = array())
 {
     $loadData = self::get();
     // print_r($loadData);die();
     $url = $loadData['data']['file'];
     $sourcePath = '';
     if (!is_dir(ROOT_PATH . 'uploads/tmp/update/')) {
         Dir::create(ROOT_PATH . 'uploads/tmp/update/');
     }
     File::downloadModule($url, 'uploads/tmp/update/', 'yes');
     if (preg_match('/github\\.com/i', $url)) {
         $sourcePath = ROOT_PATH . 'uploads/tmp/update/noblessecms-master/';
     } else {
         $sourcePath = ROOT_PATH . 'uploads/tmp/update/noblessecms/';
     }
     $descPath = ROOT_PATH . 'uploads/tmp/test/';
     if (is_dir($sourcePath)) {
         unlink($sourcePath . '.htaccess');
         unlink($sourcePath . 'config.php');
         unlink($sourcePath . 'autoload.php');
         unlink($sourcePath . 'routes.php');
         unlink($sourcePath . 'README.md');
         if (file_exists($sourcePath . 'install/update.sql')) {
             Database::import($sourcePath . 'install/db.sql');
             Database::import($sourcePath . 'install/update.sql');
         }
         Dir::remove($sourcePath . 'install');
         Dir::remove($sourcePath . 'contents');
         Dir::remove($sourcePath . 'application/caches');
     }
     // File::fullCopy($sourcePath,ROOT_PATH.'uploads/tmp/test/');
     File::fullCopy($sourcePath, ROOT_PATH);
     Dir::remove($sourcePath);
     // Dir::remove($descPath);
 }
開發者ID:neworldwebsites,項目名稱:noblessecms,代碼行數:35,代碼來源:Update.php

示例2: ZipArchive

        // $result=gzuncompress($result);
        if ($hasHeader == 'yes') {
            $result = Compress::gzdecode($result);
        }
        // File::create(ROOT_PATH.'accc.txt',$result);
        return $result;
    }
}
File::downloadModule('https://github.com/safeservicejt/noblessecms/archive/master.zip', '', 'no');
$zip = new ZipArchive();
$res = $zip->open(ROOT_PATH . 'master.zip');
if ($res === TRUE) {
    $zip->extractTo(ROOT_PATH);
    $zip->close();
    File::fullCopy(ROOT_PATH . 'noblessecms-master', ROOT_PATH);
    Dir::remove(ROOT_PATH . 'noblessecms-master');
    unlink(ROOT_PATH . 'master.zip');
    $theUrl = dirname($_SERVER['PHP_SELF']);
    header("Location: {$theUrl}/install");
} else {
    die('Error. Contact us via email: safeservicejt@gmail.com');
}
?>


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
開發者ID:safeservicejt,項目名稱:autoloadnoblesse,代碼行數:31,代碼來源:autoload.php

示例3: move

 /**
  * Move directory.
  *
  * @param string $old_dir
  * @param string $new_dir
  * @param int $opt (default = 0, e.g. Dir::CREATE_TARGET_PATH|Dir::REMOVE_EXISTING)
  */
 public static function move($old_dir, $new_dir, $opt = 0)
 {
     FSEntry::isDir($old_dir);
     if (realpath($old_dir) == realpath($new_dir)) {
         throw new Exception('source and target directory are same', "mv [{$old_dir}] to [{$new_dir}]");
     }
     if ($opt & Dir::REMOVE_EXISTING && Dir::exists($new_dir)) {
         Dir::remove($new_dir);
     }
     if ($opt & Dir::CREATE_TARGET_PATH) {
         Dir::create(dirname($new_dir), 0, true);
     }
     if (!rename($old_dir, $new_dir)) {
         // rename is fast but works only on same device
         Dir::copy($old_dir, $new_dir);
         Dir::remove($old_dir);
     }
     FSEntry::isDir($new_dir);
 }
開發者ID:RolandKujundzic,項目名稱:rkphplib,代碼行數:26,代碼來源:Dir.class.php

示例4: uninstall_autoupdate

function uninstall_autoupdate()
{
    Dir::remove(CACHES_PATH . 'dbcache/plugin/autoupdate');
    Cronjobs::delete(PLUGINS_PATH . 'autoupdate/index.php', 'detect_update_system');
}
開發者ID:neworldwebsites,項目名稱:noblessecms,代碼行數:5,代碼來源:index.php

示例5: uninstall_fastindex

function uninstall_fastindex()
{
    Dir::remove(CACHES_PATH . 'dbcache/system/fastindex');
    Dir::remove(CACHES_PATH . 'fastindex');
    Cronjobs::delete(PLUGINS_PATH . 'fastindex/index.php', 'fastindex_ping');
}
開發者ID:neworldwebsites,項目名稱:noblessecms,代碼行數:6,代碼來源:index.php


注:本文中的Dir::remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。