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


PHP FileSystem::remove方法代码示例

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


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

示例1: clear

 /**
  * Clear destination folder
  */
 public function clear()
 {
     if ($this->files->exists($this->destination)) {
         $this->files->remove($this->destination);
     }
     $this->files->mkdir($this->destination);
 }
开发者ID:phpillip,项目名称:phpillip,代码行数:10,代码来源:Builder.php

示例2: clearDrupal

 public static function clearDrupal()
 {
     if (FALSE === is_dir(self::$drupalPath)) {
         return;
     }
     self::$filesystem->chmod(self::$drupalPath, 0777, 00, TRUE);
     self::$filesystem->remove(self::$drupalPath);
 }
开发者ID:ucam-dar,项目名称:drupal-raven,代码行数:8,代码来源:FeatureContext.php

示例3: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln("<error>Be carreful, you might removes files you don't want to. You should backup your files beforehand to be sure everything still works as intended.</error>");
     $force = $input->getOption('force');
     $container = $this->getContainer();
     $fs = new FileSystem();
     $helper = $this->getHelper('question');
     //Parse the file directory and fetch the other directories
     //We should find Workspaces and Users. Workspaces being formatted like "WORKSPACE_[ID]
     $fileDir = $container->getParameter('claroline.param.files_directory');
     $iterator = new \DirectoryIterator($fileDir);
     foreach ($iterator as $pathinfo) {
         if ($pathinfo->isDir()) {
             $name = $pathinfo->getBasename();
             //look for workspaces
             if (strpos('_' . $name, 'WORKSPACE')) {
                 $parts = explode('_', $name);
                 $id = $parts[1];
                 $workspace = $container->get('claroline.manager.workspace_manager')->getWorkspaceById($id);
                 if (!$workspace) {
                     $continue = false;
                     if (!$force) {
                         $question = new ConfirmationQuestion('Do you really want to remove the directory ' . $pathinfo->getPathname() . ' [y/n] y ', true);
                         $continue = $helper->ask($input, $output, $question);
                     }
                     if ($continue || $force) {
                         $fs->remove($pathinfo->getPathname());
                     }
                 }
             }
         }
     }
 }
开发者ID:claroline,项目名称:distribution,代码行数:33,代码来源:RemoveFilesFromUnusedWorkspaceCommand.php

示例4: connect

 public function connect(Application $app)
 {
     // creates a new controller based on the default route
     $controllers = $app['controllers_factory'];
     $names = [];
     foreach ($this->faculty->professors as $professor) {
         $names[] = $professor->name;
     }
     $fs = new FileSystem();
     $fs->remove($this->faculty->baseCacheDestination);
     $names = '(' . implode('|', $names) . ')';
     $faculty = $this->faculty;
     $controllers->get('/{processor}/{path}', function (Application $app, $processor, $path) use($faculty) {
         $exten = [];
         preg_match($faculty->extenstions, $path, $exten);
         $exten = ltrim($exten[0], '.');
         if (empty($exten)) {
             return $app->abort(404);
         }
         $faculty->process($processor, $path);
         $imagePath = $faculty->getLastProcessed()[0];
         return $app->sendFile($imagePath, 200, array('Content-Type' => 'image/' . $exten));
     })->assert('path', $this->faculty->extenstions);
     return $controllers;
 }
开发者ID:maciekpaprocki,项目名称:imageprofessor,代码行数:25,代码来源:SilexProvider.php

示例5: cleanupClientSpec

 public function cleanupClientSpec()
 {
     $client = $this->getClient();
     $command = 'p4 client -d $client';
     $this->executeCommand($command);
     $clientSpec = $this->getP4ClientSpec();
     $fileSystem = new FileSystem($this->process);
     $fileSystem->remove($clientSpec);
 }
开发者ID:itillawarra,项目名称:cmfive,代码行数:9,代码来源:Perforce.php

示例6: onKernelTerminate

 /**
  * @DI\Observe("kernel.terminate")
  */
 public function onKernelTerminate(PostResponseEvent $event)
 {
     if (count($this->elementsToRemove) > 0) {
         $fs = new FileSystem();
         foreach ($this->elementsToRemove as $element) {
             $fs->remove($element);
         }
     }
 }
开发者ID:claroline,项目名称:distribution,代码行数:12,代码来源:KernelTerminateListener.php

示例7: removeModuleFromDisk

 public function removeModuleFromDisk($name)
 {
     $fs = new FileSystem();
     try {
         $fs->remove(_PS_MODULE_DIR_ . '/' . $name);
         return true;
     } catch (IOException $e) {
         return false;
     }
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:10,代码来源:ModuleDataUpdater.php

示例8: emptyDir

 public static function emptyDir($dirPath, $includeDir = false)
 {
     $fileSystem = new FileSystem();
     if (!$fileSystem->exists($dirPath)) {
         return;
     }
     foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dirPath, \FilesystemIterator::SKIP_DOTS), \RecursiveIteratorIterator::CHILD_FIRST) as $path) {
         $path->isFile() ? $fileSystem->remove($path->getPathname()) : rmdir($path->getPathname());
     }
     if ($includeDir) {
         rmdir($dirPath);
     }
 }
开发者ID:ccq18,项目名称:EduSoho,代码行数:13,代码来源:FileUtil.php

示例9: writeConfig

 /**
  * Write the docker-compose.yml file.
  *
  * @return bool
  */
 public function writeConfig()
 {
     // Create the app/environment folder
     $fs = new FileSystem();
     try {
         $fs->mkdir($this->getDockerComposePath());
     } catch (IOExceptionInterface $e) {
         return false;
     }
     // Create the environments docker-compose file.
     $dumper = new Dumper();
     try {
         $fs->remove($this->getDockerComposePath() . '/docker-compose.yml');
         $fs->dumpFile($this->getDockerComposePath() . '/docker-compose.yml', $dumper->dump($this->getDockerComposeArray(), 10));
         return true;
     } catch (IOExceptionInterface $e) {
         return false;
     }
 }
开发者ID:EclipseGc,项目名称:terra-app,代码行数:24,代码来源:EnvironmentFactory.php

示例10: tearDown

 public function tearDown()
 {
     $fs = new FileSystem();
     $fs->remove($this->tmpDir);
 }
开发者ID:spress,项目名称:spress,代码行数:5,代码来源:PostGeneratorTest.php

示例11: removeTemplate

 public function removeTemplate(File $file)
 {
     $fileName = $file->getBasename();
     $extractPath = $this->templateDirectory . DIRECTORY_SEPARATOR . $fileName;
     $fs = new FileSystem();
     $fs->remove($extractPath);
 }
开发者ID:claroline,项目名称:distribution,代码行数:7,代码来源:WorkspaceManager.php

示例12: deleteFile

 /**
  * @param $file
  * @return StandardResponseInterface
  */
 public function deleteFile($file)
 {
     $fullPath = $this->getRealPath($file);
     $this->fs->remove($fullPath);
     return new StandardResponse();
 }
开发者ID:tamcy,项目名称:ElendevRoxyFilemanBundle,代码行数:10,代码来源:LocalFileSystem.php

示例13: removeFile

 /**
  * Remove a file from the filesystem by hash
  * @param  [string] $relativePath
  */
 public function removeFile($relativePath)
 {
     $this->fileSystem->remove($this->getPath($relativePath));
 }
开发者ID:stopfstedt,项目名称:ilios,代码行数:8,代码来源:IliosFileSystem.php

示例14: removeFile

 /**
  * Remove a file from the file system by hash
  * @param string $hash
  */
 public function removeFile($hash)
 {
     $this->fileSystem->remove($this->getPath($hash));
 }
开发者ID:stopfstedt,项目名称:ilios,代码行数:8,代码来源:TemporaryFileSystem.php


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