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


PHP Filesystem::remove方法代码示例

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


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

示例1: cleanup

 /**
  * {@inheritDoc}
  */
 public function cleanup()
 {
     if (!is_null($this->path) && $this->path !== '/') {
         $this->filesystem->remove($this->path);
         $this->path = null;
     }
 }
开发者ID:fabschurt,项目名称:php-utils,代码行数:10,代码来源:TempDir.php

示例2: tearDownTestProject

 protected function tearDownTestProject()
 {
     $projectDir = self::ProjectDir();
     if (self::$fs->exists($projectDir)) {
         self::$fs->remove($projectDir);
     }
 }
开发者ID:kanzuka,项目名称:sculpin,代码行数:7,代码来源:FunctionalTestCase.php

示例3: clear

 /**
  * {@inheritdoc}
  */
 public function clear($cacheDir)
 {
     $this->filesystem->remove($cacheDir . '/contao/config');
     $this->filesystem->remove($cacheDir . '/contao/dca');
     $this->filesystem->remove($cacheDir . '/contao/languages');
     $this->filesystem->remove($cacheDir . '/contao/sql');
 }
开发者ID:Mozan,项目名称:core-bundle,代码行数:10,代码来源:ContaoCacheClearer.php

示例4: tearDown

 protected function tearDown()
 {
     if (PHP_VERSION_ID < 50400) {
         return;
     }
     $this->filesystem->remove($this->directory);
 }
开发者ID:Aryellix,项目名称:scrumator,代码行数:7,代码来源:JsonBundleWriterTest.php

示例5: tearDown

 public function tearDown()
 {
     // Delete local files
     $finder = new Finder();
     $fs = new Filesystem();
     $fs->remove($finder->files()->in($this->tmpDir . "/download"));
     $fs->remove($finder->files()->in($this->tmpDir));
     $fs->remove($this->tmpDir . "/download");
     $fs->remove($this->tmpDir);
     // Delete file uploads
     $options = new ListFilesOptions();
     $options->setTags(["docker-bundle-test"]);
     $files = $this->client->listFiles($options);
     foreach ($files as $file) {
         $this->client->deleteFile($file["id"]);
     }
     if ($this->client->bucketExists("in.c-docker-test")) {
         // Delete tables
         foreach ($this->client->listTables("in.c-docker-test") as $table) {
             $this->client->dropTable($table["id"]);
         }
         // Delete bucket
         $this->client->dropBucket("in.c-docker-test");
     }
     if ($this->client->bucketExists("in.c-docker-test-redshift")) {
         // Delete tables
         foreach ($this->client->listTables("in.c-docker-test-redshift") as $table) {
             $this->client->dropTable($table["id"]);
         }
         // Delete bucket
         $this->client->dropBucket("in.c-docker-test-redshift");
     }
 }
开发者ID:keboola,项目名称:input-mapping,代码行数:33,代码来源:StorageApiReaderTest.php

示例6: testBeforeSendPerformedWithInvalidPrivateKey

 /**
  * @expectedException \Sonatra\Bundle\MailerBundle\Exception\RuntimeException
  * @expectedExceptionMessageRegExp /Impossible to read the private key of the DKIM swiftmailer signer "([\w.~:\\\/]+)\/private_key"/
  */
 public function testBeforeSendPerformedWithInvalidPrivateKey()
 {
     $path = $this->cache . '/private_key';
     $this->fs->remove($path);
     $this->message->expects($this->never())->method('attachSigner');
     $this->plugin->beforeSendPerformed($this->event);
 }
开发者ID:sonatra,项目名称:SonatraMailerBundle,代码行数:11,代码来源:DkimSignerPluginTest.php

示例7: tearDown

 protected function tearDown()
 {
     parent::tearDown();
     $filesystem = new Filesystem();
     $filesystem->remove($this->getRootCacheDirectory());
     $filesystem->remove($this->builder->buildPrefix());
 }
开发者ID:yahoojapan,项目名称:ConfigCacheBundle,代码行数:7,代码来源:RestorablePhpFileCacheTest.php

示例8: tearDown

 protected function tearDown()
 {
     if (version_compare(PHP_VERSION, '5.4.0', '<')) {
         return;
     }
     $this->filesystem->remove($this->directory);
 }
开发者ID:vomasmic,项目名称:symfony,代码行数:7,代码来源:JsonBundleWriterTest.php

示例9: publish

 /**
  * @param string $targetPath
  * @param string $installPath
  * @param array $map
  * @param bool $isSymlink
  * @param bool $isRelative
  *
  * @throws IOException
  * @throws \InvalidArgumentException
  *
  * @api
  *
  * @quality:method [B]
  */
 public function publish($targetPath, $installPath, array $map, $isSymlink, $isRelative)
 {
     $targetPath = rtrim($targetPath, '/');
     $installPath = rtrim($installPath, '/');
     $this->filesystem->mkdir($targetPath, 0777);
     foreach ($map as $from => $to) {
         $targetDir = realpath($targetPath) . '/' . $to;
         $sourceDir = realpath($installPath) . '/' . $from;
         $this->filesystem->remove($targetDir);
         if ($isSymlink) {
             $this->io->write(sprintf('Trying to install AdminLTE %s assets as symbolic links.', $from));
             $originDir = $sourceDir;
             if ($isRelative) {
                 $originDir = $this->filesystem->makePathRelative($sourceDir, realpath($targetPath));
             }
             try {
                 $this->filesystem->symlink($originDir, $targetDir);
                 $this->io->write(sprintf('The AdminLTE %s assets were installed using symbolic links.', $from));
             } catch (IOException $e) {
                 $this->hardCopy($sourceDir, $targetDir);
                 $this->io->write(sprintf('It looks like your system doesn\'t support symbolic links,
                     so the AdminLTE %s assets were installed by copying them.', $from));
             }
         } else {
             $this->io->write(sprintf('Installing AdminLTE %s assets as <comment>hard copies</comment>.', $from));
             $this->hardCopy($sourceDir, $targetDir);
         }
     }
 }
开发者ID:kamilsk,项目名称:common,代码行数:43,代码来源:Processor.php

示例10: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $fs = new Filesystem();
     $fs->remove($this->cacheDirectory . '/app');
     $fs->remove($this->cacheDirectory . '/github');
     $output->writeln('Caches cleared');
 }
开发者ID:pborreli,项目名称:Maintained,代码行数:7,代码来源:ClearCacheCommand.php

示例11: create

 /**
  * @param Attachment $attachment
  * @param array      $dimensionIds
  *
  * @return ImageInstance
  */
 public function create(Attachment $attachment, DimensionContainer $dimensionContainer)
 {
     $validate = $this->constraints->getConstraints($attachment, $dimensionContainer);
     if ($validate) {
         $fs = new Filesystem();
         $fs->remove(sprintf('%s/%s', $this->tempPath, $attachment->getFile()));
         $fs->remove(sprintf('%s/%s', $this->uploadPath, $attachment->getFile()));
         $this->objectManager->remove($attachment);
         $this->objectManager->flush();
         return $validate;
     }
     $instance = new ImageInstance();
     $instance->setName($attachment->getName());
     $this->objectManager->persist($instance);
     foreach ($dimensionContainer->getDimensions() as $dimension) {
         $cropping = new ImageCropping();
         $cropping->setAttachment($attachment);
         $cropping->setInstance($instance);
         $cropping->setDimension($dimension);
         $cropping->setName($attachment->getName());
         $this->objectManager->persist($cropping);
     }
     $this->objectManager->flush();
     return $instance;
 }
开发者ID:bigfishcmf,项目名称:bigfishcmf,代码行数:31,代码来源:ImageManager.php

示例12: deploy

 /**
  *
  * @param Project $project
  * @return string
  * @throws DeployException
  */
 public function deploy(Project $project)
 {
     $path = sys_get_temp_dir() . '/AwesomeDeployer';
     $this->filesystem->mkdir($path);
     chdir($path);
     $process = new Process('git clone ' . $project->getRepo() . ' project');
     $process->mustRun();
     $out = $process->getOutput();
     $pathProject = $path . '/project';
     chdir($pathProject);
     $script = $project->getScript();
     if ($script !== null) {
         $script = new Process($script);
         $script->mustRun();
         $out .= $script->getOutput();
     }
     switch ($project->getStrategy()) {
         case Project::STRATEGY_FABRIC:
             $command = $project->getCommand();
             break;
         default:
             throw new DeployException('Strategy not supported');
     }
     $deployment = new Process($command);
     $deployment->mustRun();
     $this->filesystem->remove($path);
     $out .= $deployment->getOutput();
     return $out;
 }
开发者ID:valanz,项目名称:deploy,代码行数:35,代码来源:Deployer.php

示例13: setUp

 protected function setUp()
 {
     $this->previousCurrentDir = getcwd();
     chdir(__DIR__);
     $fs = new Filesystem();
     if ($fs->exists(static::$cacheDir)) {
         $fs->remove(static::$cacheDir);
     }
     if ($fs->exists(static::$dumpDir)) {
         $fs->remove(static::$dumpDir);
     }
     $app = new Application();
     $app->register(new ValidatorServiceProvider());
     $app['validator.mapping.class_metadata_factory'] = new ClassMetadataFactory(new YamlFilesLoader([static::$originalConfigDir . '/validation.yml']));
     //custom providers and services
     $app['fakery.faker.config'] = $app->share(function ($app) {
         return new FakerConfig(static::$configDir, 'faker.yml', static::$cacheDir . '/cache/', true);
     });
     $app['fakery.config_serializer'] = $app->share(function ($app) {
         return new ConfigSerializer(static::$cacheDir . '/cache/', static::$configDir, true);
     });
     $app['fakery.dumper_manager'] = $app->share(function ($app) {
         return new DumpManager($app['fakery.config_serializer']);
     });
     $app['fakery.console_dumper_manager'] = $app->share(function ($app) {
         return new ConsoleDumpManager($app['fakery.config_serializer']);
     });
     $this->silex = $app;
 }
开发者ID:csanquer,项目名称:fakery-generator,代码行数:29,代码来源:AbstractCommandTestCase.php

示例14: tearDown

 /**
  * {@inheritdoc}
  */
 public function tearDown()
 {
     $fs = new Filesystem();
     $fs->remove($this->getRootDir() . '/system/logs');
     $fs->remove($this->getRootDir() . '/system/themes');
     $fs->remove($this->getRootDir() . '/web');
 }
开发者ID:jamesdevine,项目名称:core-bundle,代码行数:10,代码来源:SymlinksCommandTest.php

示例15: clear

 /**
  * キャッシュを削除する.
  *
  * doctrine, profiler, twig によって生成されたキャッシュディレクトリを削除する.
  * キャッシュは $app['config']['root_dir'].'/app/cache' に生成されます.
  *
  * @param Application $app
  * @param boolean $isAll .gitkeep を残してすべてのファイル・ディレクトリを削除する場合 true, 各ディレクトリのみを削除する場合 false
  * @param boolean $isTwig Twigキャッシュファイルのみ削除する場合 true
  * @return boolean 削除に成功した場合 true
  */
 public static function clear($app, $isAll, $isTwig = false)
 {
     $cacheDir = $app['config']['root_dir'] . '/app/cache';
     $filesystem = new Filesystem();
     if ($isAll) {
         $finder = Finder::create()->in($cacheDir)->notName('.gitkeep');
         $filesystem->remove($finder);
     } elseif ($isTwig) {
         if (is_dir($cacheDir . '/twig')) {
             $finder = Finder::create()->in($cacheDir . '/twig');
             $filesystem->remove($finder);
         }
     } else {
         if (is_dir($cacheDir . '/doctrine')) {
             $finder = Finder::create()->in($cacheDir . '/doctrine');
             $filesystem->remove($finder);
         }
         if (is_dir($cacheDir . '/profiler')) {
             $finder = Finder::create()->in($cacheDir . '/profiler');
             $filesystem->remove($finder);
         }
         if (is_dir($cacheDir . '/twig')) {
             $finder = Finder::create()->in($cacheDir . '/twig');
             $filesystem->remove($finder);
         }
     }
     return true;
 }
开发者ID:naow9y,项目名称:ec-cube,代码行数:39,代码来源:Cache.php


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