本文整理汇总了PHP中Illuminate\Filesystem\Filesystem::cleanDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::cleanDirectory方法的具体用法?PHP Filesystem::cleanDirectory怎么用?PHP Filesystem::cleanDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Filesystem\Filesystem
的用法示例。
在下文中一共展示了Filesystem::cleanDirectory方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fire
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
$cacheDir = $this->laravel['http_cache.cache_dir'];
if ($this->files->cleanDirectory($cacheDir)) {
$this->info('HttpCache cleared!');
} else {
$this->error('Could not clear HttpCache');
}
}
示例2: handle
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$path = public_path(config('asset.public_cache_folder'));
$fileSystem = new Filesystem();
$fileSystem->cleanDirectory($path);
return $this->info("'{$path}' folder cleared. ");
}
示例3: emptyPath
/**
* Deletes all files and folders inside the given path
*
* @param string $path
*/
public function emptyPath($path)
{
// Remove all created folders inside output path
$fs = new Filesystem();
$fs->cleanDirectory($path);
// Not all files might have been removed by
// the delete directory method. Therefore, we
// search the dir for files and remove those as well.
$files = $fs->files($path);
$fs->delete($files);
}
示例4: cleanDirectory
/**
* Empty the specified directory of all files and folders.
*
* @param string $directory
* @return bool
* @static
*/
public static function cleanDirectory($directory)
{
return \Illuminate\Filesystem\Filesystem::cleanDirectory($directory);
}
示例5: clear
public function clear()
{
$this->filesystem->cleanDirectory($this->outputDir);
}
示例6: clearCompiled
/**
* Clear compiled schema.
*
* @return void
*/
public function clearCompiled()
{
if ($this->file->isDirectory($this->basePath)) {
$this->file->cleanDirectory($this->basePath);
}
}
示例7: clean
/**
* Clean model directory.
*
* @return void
*/
public function clean()
{
if ($this->files->exists($this->path)) {
$this->files->cleanDirectory($this->path);
}
}