当前位置: 首页>>代码示例>>PHP>>正文


PHP Filesystem::deleteDirectory方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:lehoikma,项目名称:tessst,代码行数:30,代码来源:PublishCommand.php

示例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.");
 }
开发者ID:xpressengine,项目名称:xpressengine,代码行数:36,代码来源:PluginMake.php

示例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);
     }
 }
开发者ID:ribrit,项目名称:laravel-elfinder,代码行数:31,代码来源:PublishCommand.php

示例4: delete

 public function delete()
 {
     if (!$this->filesystem->exists($this->path)) {
         return;
     }
     $this->filesystem->deleteDirectory($this->path);
 }
开发者ID:spatie,项目名称:laravel-backup,代码行数:7,代码来源:TemporaryDirectory.php

示例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();
 }
开发者ID:nwidart,项目名称:laravel-modules,代码行数:8,代码来源:ModuleGeneratorTest.php

示例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!');
 }
开发者ID:darrengopower,项目名称:framework,代码行数:11,代码来源:StaticClearCommand.php

示例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}/");
 }
开发者ID:masteramuk,项目名称:concrete5,代码行数:10,代码来源:FileRepositoryTest.php

示例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);
         }
     }
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:11,代码来源:FileLoaderTest.php

示例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);
     });
 }
开发者ID:recca0120,项目名称:laravel-terminal,代码行数:16,代码来源:Cleanup.php

示例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);
 }
开发者ID:denji,项目名称:rocketeer,代码行数:18,代码来源:Compiler.php

示例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), '/'));
 }
开发者ID:jaffle-be,项目名称:framework,代码行数:16,代码来源:RemoveSize.php

示例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.');
     }
 }
开发者ID:bokbok123,项目名称:ORS,代码行数:18,代码来源:ThemeDestroyCommand.php

示例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');
 }
开发者ID:jaffle-be,项目名称:framework,代码行数:14,代码来源:FreshApplication.php

示例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!');
 }
开发者ID:visualturk,项目名称:framework,代码行数:20,代码来源:FreshCommand.php

示例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;
 }
开发者ID:KodiComponents,项目名称:module-datasource,代码行数:11,代码来源:File.php


注:本文中的Illuminate\Filesystem\Filesystem::deleteDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。