本文整理汇总了PHP中FileUtils::removeDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP FileUtils::removeDirectory方法的具体用法?PHP FileUtils::removeDirectory怎么用?PHP FileUtils::removeDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileUtils
的用法示例。
在下文中一共展示了FileUtils::removeDirectory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __destruct
public function __destruct()
{
try {
FileUtils::removeDirectory($this->path, true);
} catch (BaseException $e) {
// boo! deal with garbage yourself.
}
}
示例2: drop
public function drop()
{
// removed, but not created yet
if (!is_writable($this->path)) {
return true;
}
$toRemove = realpath($this->path) . '.' . microtime(true) . getmypid() . '.' . '.removing';
try {
rename($this->path, $toRemove);
} catch (BaseException $e) {
// already removed during race
return true;
}
FileUtils::removeDirectory($toRemove, true);
return true;
}
示例3: spawnCacheDir
private function spawnCacheDir()
{
$cachePath = ONPHP_CLASS_CACHE . 'testCache/';
if (file_exists($cachePath)) {
if (is_file($cachePath)) {
unlink($cachePath);
} elseif (is_dir($cachePath)) {
FileUtils::removeDirectory($cachePath, true);
}
}
mkdir($cachePath, 0777, true);
return $cachePath;
}
示例4: clean
/**
* @return RubberFileSystem
**/
public function clean()
{
// just to return 'true'
FileUtils::removeDirectory($this->directory, true);
return parent::clean();
}