Exemplo n.º 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);
     }
 }
Exemplo n.º 2
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');
 }