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


PHP Filesystem::deleteDir方法代码示例

本文整理汇总了PHP中League\Flysystem\Filesystem::deleteDir方法的典型用法代码示例。如果您正苦于以下问题:PHP Filesystem::deleteDir方法的具体用法?PHP Filesystem::deleteDir怎么用?PHP Filesystem::deleteDir使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在League\Flysystem\Filesystem的用法示例。


在下文中一共展示了Filesystem::deleteDir方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: remove

 /**
  * Remove file or a directory
  *
  * @param $path
  * @return void
  */
 public function remove($path)
 {
     if (!$this->filesystem->has($path)) {
         return;
     }
     $meta = $this->filesystem->getMetadata($path);
     if ($meta['type'] === 'file') {
         $this->filesystem->delete($path);
     } else {
         $this->filesystem->deleteDir($path);
     }
 }
开发者ID:karion,项目名称:mydrinks,代码行数:18,代码来源:FlySystemAdapter.php

示例2: execute

 /**
  * @return bool
  */
 public function execute()
 {
     if ($this->filesystem->getMimetype($this->filePath) == 'application/x-gzip') {
         if ($this->filesystem->getMimetype(str_replace('.tar.gz', '', $this->filePath)) == 'directory') {
             $this->filesystem->deleteDir(str_replace('.tar.gz', '', $this->filePath));
         }
     }
     if ($this->filesystem->getMimetype($this->filePath) == 'directory') {
         return $this->filesystem->deleteDir($this->filePath);
     } else {
         return $this->filesystem->delete($this->filePath);
     }
 }
开发者ID:sakalauskas,项目名称:backup-manager,代码行数:16,代码来源:DeleteFile.php

示例3: rmdir

	/**
	 * {@inheritdoc}
	 */
	public function rmdir($path) {
		try {
			return @$this->flysystem->deleteDir($this->buildPath($path));
		} catch (FileNotFoundException $e) {
			return false;
		}
	}
开发者ID:ninjasilicon,项目名称:core,代码行数:10,代码来源:flysystem.php

示例4: deleteDir

 /**
  * Delete a directory.
  *
  * @param string $dirname
  *
  * @throws RootViolationException Thrown if $dirname is empty.
  *
  * @return bool True on success, false on failure.
  */
 public function deleteDir($dirname)
 {
     try {
         return $this->filesystem->deleteDir($dirname);
     } catch (FlysystemRootViolationException $e) {
         RootViolationException::rootViolation();
     }
 }
开发者ID:da-vinci-studio,项目名称:file-bundle,代码行数:17,代码来源:Local.php

示例5: cleanCache

 /**
  * Clean the cache dir.
  *
  * @throws \DomainException
  * @return void
  */
 public static function cleanCache()
 {
     $filesystem = new Filesystem(new Local(self::$cacheDir));
     foreach ($filesystem->listContents() as $path) {
         if ('dir' == $path['type']) {
             if (false == $filesystem->deleteDir($path['path'])) {
                 throw new \DomainException('Can not clean the cache.');
             }
         }
     }
 }
开发者ID:elkuku,项目名称:g11n,代码行数:17,代码来源:ExtensionHelper.php

示例6: deleteDir

 /**
  * @inheritdoc
  */
 public function deleteDir($dirname)
 {
     $innerDirname = $this->getInnerPath($dirname);
     try {
         $return = $this->fileSystem->deleteDir($innerDirname);
     } catch (RootViolationException $e) {
         throw $this->exceptionWrapper($e, $dirname);
     }
     if ($return !== false) {
         $this->invokePlugin("removePathFromIndex", [$dirname, $innerDirname], $this);
     }
     return $return;
 }
开发者ID:petrknap,项目名称:php-filestorage,代码行数:16,代码来源:FileSystem.php

示例7: cleanupRemote

 /**
  * Clean up remote files.
  *
  * @return void
  */
 public function cleanupRemote()
 {
     if (isset($this->config->keepfor)) {
         $remotePath = './' . $this->dump_folder;
         $directories = $this->remoteAdapter->listContents($remotePath);
         $timestamp = date('YmdHi', time() - (time() - strtotime($this->config->keepfor . ' ago')));
         foreach ($directories as $dir) {
             if ($dir['filename'] < $timestamp) {
                 $this->remoteAdapter->deleteDir($dir['path']);
             }
         }
     }
 }
开发者ID:JayBizzle,项目名称:mysqldumper,代码行数:18,代码来源:MySQLDumperCommand.php

示例8: handleOptions

 private function handleOptions()
 {
     if ($this->delete) {
         $this->getItemsToDelete()->each(function ($item) {
             if ($item['type'] === 'dir') {
                 dump($item);
                 $this->filesystem->deleteDir($item['path']);
                 return true;
             }
             $this->filesystem->delete($item['path']);
             return true;
         });
     }
 }
开发者ID:ValentinGot,项目名称:trakt-api-wrapper,代码行数:14,代码来源:EndpointGenerator.php

示例9: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $path = $input->getArgument('path');
     if ($this->abortDeletion($path, $output)) {
         $output->writeln("<comment>Aborted.</comment>");
         return;
     }
     $package = Package::fromFolder($path);
     $this->config->removePackage($package);
     $output->writeln("<comment>Removing package...</comment>");
     $filesystem = new Filesystem(new Local(getcwd()));
     $filesystem->deleteDir($path);
     $output->writeln("<info>Package successfully removed.</info>");
     $output->writeln("<comment>Dumping autoloads...</comment>");
     Shell::run('composer dump-autoload');
     $output->writeln("<info>Autoloads successfully generated.</info>");
 }
开发者ID:sethathay,项目名称:PPBakery,代码行数:17,代码来源:ScrapCommand.php

示例10: testConvertCommandWithNamespaceOption

 public function testConvertCommandWithNamespaceOption()
 {
     $codeLocation = __DIR__ . '/mock/src/VendorName/ProjectName/Category/ProductName/v123456/';
     $codeLocationArray = explode('/', $codeLocation);
     $codeLocationArray = array_splice($codeLocationArray, 6, 4);
     $directory = $codeLocationArray[0];
     $destinationLocation = implode('/', $codeLocationArray);
     $codeDestination = '/tmp/';
     $input = new ArrayInput(['convert', 'code-location' => $codeLocation, '--code-destination' => '/tmp', '--create-namespace' => true, '--offset' => 6, '--length' => 4]);
     $output = new BufferedOutput();
     $app = new Application();
     $app->get('convert')->run($input, $output);
     $this->assertFileExists(sprintf('/%s/%s/Date.php', $codeDestination, $destinationLocation));
     $this->assertFileExists(sprintf('/%s/%s/DateRange.php', $codeDestination, $destinationLocation));
     $this->assertFileExists(sprintf('/%s/%s/OrderBy.php', $codeDestination, $destinationLocation));
     // Delete all files/
     $filesystem = new Filesystem(new Local($codeDestination));
     $filesystem->deleteDir($directory);
 }
开发者ID:onema,项目名称:classyfile,代码行数:19,代码来源:ApplicationTest.php

示例11: remove

 /**
  * @param string[] $paths   The paths where the original files are expected to be.
  * @param string[] $filters The imagine filters in effect.
  */
 public function remove(array $paths, array $filters)
 {
     if (empty($paths) && empty($filters)) {
         return;
     }
     if (empty($paths)) {
         foreach ($filters as $filter) {
             $filterCacheDir = $this->cacheRoot . '/' . $filter;
             $this->flysystem->deleteDir($filterCacheDir);
         }
         return;
     }
     foreach ($paths as $path) {
         foreach ($filters as $filter) {
             if ($this->flysystem->has($this->getFilePath($path, $filter))) {
                 $this->flysystem->delete($this->getFilePath($path, $filter));
             }
         }
     }
 }
开发者ID:aminin,项目名称:LiipImagineBundle,代码行数:24,代码来源:FlysystemResolver.php

示例12: deleteDir

 public function deleteDir($directory)
 {
     $this->flysystem->deleteDir($directory);
 }
开发者ID:anavel,项目名称:uploads,代码行数:4,代码来源:Filesystem.php

示例13: deleteFiles

 private function deleteFiles($codeDestination, $directory)
 {
     // Delete all files/
     $filesystem = new Filesystem(new Local($codeDestination));
     $filesystem->deleteDir($directory);
 }
开发者ID:onema,项目名称:classyfile,代码行数:6,代码来源:ClassyFileTest.php

示例14: destroyCMS

 public function destroyCMS($identifier)
 {
     $adapter = new Local($this->container_path);
     $filesystem = new Filesystem($adapter);
     if ($this->checkExistance($identifier)) {
         if ($this->saveAsZip($identifier)) {
             $filesystem->deleteDir($identifier);
             return true;
         }
     }
     return false;
 }
开发者ID:iris-it,项目名称:irispass-webapp-laravel,代码行数:12,代码来源:FlatCmService.php

示例15: testDeleteDir

 /**
  * 3.txt
  * 2.txt.
  */
 public function testDeleteDir()
 {
     $this->assertTrue($this->filesystem->deleteDir('test'));
     $this->assertFalse($this->filesystem->has('test/'));
 }
开发者ID:apollopy,项目名称:flysystem-aliyun-oss,代码行数:9,代码来源:AliyunOssAdapterTest.php


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