本文整理汇总了PHP中Illuminate\Filesystem\Filesystem::deleteDirectory方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::deleteDirectory方法的具体用法?PHP Filesystem::deleteDirectory怎么用?PHP Filesystem::deleteDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Filesystem\Filesystem
的用法示例。
在下文中一共展示了Filesystem::deleteDirectory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fire
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
$package = 'barryvdh/laravel-elfinder';
$destination = $this->publishPath . "/packages/{$package}";
if (!is_null($path = $this->getElfinderPath())) {
if (!$this->files->deleteDirectory($destination)) {
$this->error('Could not delete existing package folder');
}
$copyElfinder = $this->copyElfinderFiles($destination);
} else {
$copyElfinder = false;
$this->error('Could not find elfinder path');
}
if (!is_null($path = $this->getPath())) {
$copyPublic = $this->files->copyDirectory($path, $destination);
} else {
$copyPublic = false;
$this->error('Could not find public path');
}
if ($copyElfinder && $copyPublic) {
$this->info('Published assets for: ' . $package);
} else {
$this->error('Could not publish alles assets for ' . $package);
}
}
示例2: fire
/**
* Execute the console command.
*
* @return bool|null
*/
public function fire()
{
// get plugin name, namespace, path
$name = $this->getPluginName();
$namespace = $this->getNamespace();
$title = $this->getTitleInput();
$path = app('xe.plugin')->getPluginsDir() . '/' . $name;
if ($this->checkEnv($path, $name, $namespace, $title) === false) {
return false;
}
try {
// plugin.php 파일 생성
$this->makePluginClass($path, $name, $namespace, $title);
// composer.json 파일 생성
$this->makeComposerJson($path, $name, $namespace, $title);
// directory structure 생성
$this->makeDirectoryStructure($path);
// composer update
$this->runComposerDump($path);
// plugin activate
$this->activatePlugin($name);
} catch (\Exception $e) {
$this->files->deleteDirectory($path);
throw $e;
}
// print info
$url = trim(config('app.url'), '/') . '/' . config('xe.routing.fixedPrefix') . '/' . $name;
$this->info("Plugin is created and activated successfully.");
$this->info("See ./plugins/{$name} directory. And open {$url} in your browser.");
$this->info("Input and modify your plugin information in ./plugins/{$name}/composer.json file.");
}
示例3: fire
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
$package = 'ribrit/elfinder';
$destination = $this->publishPath . "/packages/{$package}";
if (!is_null($path = $this->getElfinderPath())) {
if ($this->files->exists($destination)) {
$this->files->deleteDirectory($destination);
$this->info('Old published Assets have been removed');
}
$copyElfinder = $this->copyElfinderFiles($destination);
} else {
$copyElfinder = false;
$this->error('Could not find elfinder path');
}
if (!is_null($path = $this->getPath())) {
$copyPublic = $this->files->copyDirectory($path, $destination);
} else {
$copyPublic = false;
$this->error('Could not find public path');
}
if ($copyElfinder && $copyPublic) {
$this->info('Published assets to: ' . $package);
} else {
$this->error('Could not publish alles assets for ' . $package);
}
}
示例4: delete
public function delete()
{
if (!$this->filesystem->exists($this->path)) {
return;
}
$this->filesystem->deleteDirectory($this->path);
}
示例5: tearDown
public function tearDown()
{
$this->finder->deleteDirectory($this->modulePath);
if ($this->finder->isDirectory(base_path('modules/ModuleName'))) {
$this->finder->deleteDirectory(base_path('modules/ModuleName'));
}
parent::tearDown();
}
示例6: fire
/**
* @return void
*/
public function fire()
{
$statics = $this->files->glob($this->notadd->publicPath() . DIRECTORY_SEPARATOR . 'cache' . '/*');
foreach ($statics as $static) {
$this->files->deleteDirectory($static);
}
$this->info('Static files cleared!');
}
示例7: testSaveNamespace
public function testSaveNamespace()
{
$namespace = md5(uniqid());
$group = md5(uniqid());
$item = 'test.item';
$key = "{$namespace}::{$group}.{$item}";
$this->repository->save($key, $namespace);
$this->assertEquals($namespace, $this->repository->get($key, false));
$this->files->deleteDirectory(DIR_APPLICATION . "/config/generated_overrides/{$namespace}/");
}
示例8: tearDown
public function tearDown()
{
$remove = array_reverse($this->to_remove);
foreach ($remove as $path) {
if ($this->files->isDirectory($path)) {
$this->files->deleteDirectory($path);
} else {
$this->files->delete($path);
}
}
}
示例9: fire
/**
* fire.
*
* @method fire
*/
public function fire()
{
$root = $this->getLaravel()->basePath();
$directories = ['.git', 'node_modules', 'vendor/**/**/.git', 'vendor/**/**/node_modules', 'vendor/**/**/vendor', 'vendor/**/**/Tests', 'vendor/**/**/tests', 'vendor/**/**/Test', 'vendor/**/**/test'];
(new Collection($directories))->map(function ($directory) use($root) {
return $this->filesystem->glob($root . '/' . $directory, GLOB_ONLYDIR);
})->collapse()->each(function ($directory) {
$this->filesystem->deleteDirectory($directory);
$this->error('delete directory: ' . $directory);
});
}
示例10: extract
/**
* Extract an existing Phar
*
* @param string $destination
*
* @return void
*/
public function extract($destination)
{
// Recompile phar archive
$this->compile();
// Remove any already extracted archive
if (file_exists($destination)) {
$this->files->deleteDirectory($destination);
}
$phar = new Phar($this->phar);
$phar->extractTo($destination);
}
示例11: handleOwner
/**
* $this
* @param StoresMedia $owner
* @param $size
*/
public function handleOwner(StoresMedia $owner, $size)
{
if ($owner->mediaStoresMultiple()) {
foreach ($owner->images as $image) {
$this->handleImage($image);
}
} elseif ($owner->images) {
$this->handleImage($owner->images);
}
$this->files->deleteDirectory(rtrim($this->config->getPublicPath($owner, 'images', $size), '/'));
}
示例12: fire
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
// The theme is not exists.
if (!$this->files->isDirectory($this->getPath(null))) {
return $this->error('Theme "' . $this->getTheme() . '" is not exists.');
}
$themePath = $this->getPath(null);
if ($this->confirm('Are you sure you want to permanently delete? [yes|no]')) {
// Delete permanent.
$this->files->deleteDirectory($themePath, false);
$this->info('Theme "' . $this->getTheme() . '" has been destroyed.');
}
}
示例13: handle
public function handle()
{
$this->files->deleteDirectory(public_path(config('media.path')));
$this->call('migrate:refresh');
$this->call('cache:clear');
$this->call('search:speed', ['speed' => '5m']);
$this->call('search:flush');
$this->call('search:settings');
$this->call('search:build');
if ($this->option('seed')) {
$this->call('db:seed');
}
$this->call('search:speed');
}
示例14: fire
/**
* Execute the console command.
*
* @return void
*/
public function fire()
{
foreach ($this->getFiles() as $file) {
$this->files->delete($file);
$this->line('<info>Removed File:</info> ' . $file);
}
foreach ($this->getDirectories() as $directory) {
$this->files->deleteDirectory($directory);
$this->line('<comment>Removed Directory:</comment> ' . $directory);
}
foreach ($this->getStubs() as $stub => $path) {
$this->files->put($path, $this->files->get(__DIR__ . '/stubs/fresh/' . $stub));
}
$this->info('Scaffolding Removed!');
}
示例15: deleteDirectory
/**
* @return bool
* @throws FieldException
*/
protected function deleteDirectory()
{
if (!$this->files->deleteDirectory($this->getFolder())) {
throw new FieldException("Can't delete directory [{$this->getFolder()}]");
}
return true;
}