本文整理汇总了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);
}
示例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">
示例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);
}
示例4: uninstall_autoupdate
function uninstall_autoupdate()
{
Dir::remove(CACHES_PATH . 'dbcache/plugin/autoupdate');
Cronjobs::delete(PLUGINS_PATH . 'autoupdate/index.php', 'detect_update_system');
}
示例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');
}