Пример #1
0
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $bbapp = $this->getContainer()->get('bbapp');
     $output->writeln(sprintf('Clearing the cache for the <info>%s</info> environment with debug <info>%s</info>', $bbapp->getEnvironment(), var_export($bbapp->isDebugMode(), true)));
     $cacheDir = $this->getContainer()->getParameter("bbapp.cache.dir");
     $oldCacheDir = $cacheDir . '_old';
     if (file_exists($oldCacheDir)) {
         Dir::delete($oldCacheDir);
     }
     Dir::move($cacheDir, $oldCacheDir);
     mkdir($cacheDir);
     if (file_exists($oldCacheDir)) {
         Dir::delete($oldCacheDir);
     }
 }
Пример #2
0
 /**
  * {@inheritDoc}
  */
 public function tearDown()
 {
     $this->isInitialised = false;
     if ($this->getConfig('deleteExtracted')) {
         Dir::delete($this->getConfig('extractedDir'));
     }
 }
Пример #3
0
 public function testMove()
 {
     $directoryMode = 0777;
     mkdir($this->getFixturesFolder() . 'archive2');
     $this->assertTrue(Dir::move($this->getFixturesFolder() . 'archive2', $this->getFixturesFolder() . 'archive3', $directoryMode));
     Dir::delete($this->getFixturesFolder() . 'archive3');
 }