本文整理匯總了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);
}
}