/**
  * Removes all cache entries of this cache.
  *
  * @return void
  * @api
  */
 public function flush()
 {
     \TYPO3\Flow\Utility\Files::emptyDirectoryRecursively($this->cacheDirectory);
 }
 /**
  * Compiles the Doctrine proxy class code using the Doctrine ProxyFactory.
  *
  * @return void
  */
 public function compileProxies()
 {
     Files::emptyDirectoryRecursively(Files::concatenatePaths(array($this->environment->getPathToTemporaryDirectory(), 'Doctrine/Proxies')));
     $proxyFactory = $this->entityManager->getProxyFactory();
     $proxyFactory->generateProxyClasses($this->entityManager->getMetadataFactory()->getAllMetadata());
 }
 /**
  * @test
  * @expectedException \TYPO3\Flow\Utility\Exception
  */
 public function emptyDirectoryRecursivelyThrowsExceptionIfSpecifiedPathDoesNotExist()
 {
     Files::emptyDirectoryRecursively('NonExistingPath');
 }
 /**
  * Removes all cache entries of this cache and sets the frozen flag to FALSE.
  *
  * @return void
  * @api
  */
 public function flush()
 {
     Files::emptyDirectoryRecursively($this->cacheDirectory);
     if ($this->frozen === TRUE) {
         @unlink($this->cacheDirectory . 'FrozenCache.data');
         $this->frozen = FALSE;
     }
 }
 /**
  * Does some emergency, forced, low level flush caches if the user told to do
  * so through the command line.
  *
  * @param Bootstrap $bootstrap
  * @return void
  */
 public static function forceFlushCachesIfNecessary(Bootstrap $bootstrap)
 {
     if (!isset($_SERVER['argv']) || !isset($_SERVER['argv'][1]) || !isset($_SERVER['argv'][2]) || !in_array($_SERVER['argv'][1], array('typo3.flow:cache:flush', 'flow:cache:flush')) || !in_array($_SERVER['argv'][2], array('--force', '-f'))) {
         return;
     }
     $bootstrap->getEarlyInstance('TYPO3\\Flow\\Cache\\CacheManager')->flushCaches();
     $environment = $bootstrap->getEarlyInstance('TYPO3\\Flow\\Utility\\Environment');
     \TYPO3\Flow\Utility\Files::emptyDirectoryRecursively($environment->getPathToTemporaryDirectory());
     echo 'Force-flushed caches for "' . $bootstrap->getContext() . '" context.' . PHP_EOL;
     exit(0);
 }
 /**
  * Does some emergency, forced, low level flush caches if the user told to do
  * so through the command line.
  *
  * @param Bootstrap $bootstrap
  * @return void
  */
 public static function forceFlushCachesIfNecessary(Bootstrap $bootstrap)
 {
     if (!isset($_SERVER['argv']) || !isset($_SERVER['argv'][1]) || !isset($_SERVER['argv'][2]) || !in_array($_SERVER['argv'][1], array('typo3.flow:cache:flush', 'flow:cache:flush')) || !in_array($_SERVER['argv'][2], array('--force', '-f'))) {
         return;
     }
     $bootstrap->getEarlyInstance(\TYPO3\Flow\Cache\CacheManager::class)->flushCaches();
     $environment = $bootstrap->getEarlyInstance(\TYPO3\Flow\Utility\Environment::class);
     \TYPO3\Flow\Utility\Files::emptyDirectoryRecursively($environment->getPathToTemporaryDirectory());
     echo 'Force-flushed caches for "' . $bootstrap->getContext() . '" context.' . PHP_EOL;
     // In production the site will be locked as this is a compiletime request so we need to take care to remove that lock again.
     if ($bootstrap->getContext()->isProduction()) {
         $bootstrap->getEarlyInstance(\TYPO3\Flow\Core\LockManager::class)->unlockSite();
     }
     exit(0);
 }
 /**
  * Removes all cache entries of this cache.
  *
  * @return void
  * @api
  */
 public function flush()
 {
     Files::emptyDirectoryRecursively($this->cacheDirectory);
 }