getCacheDir() public méthode

public getCacheDir ( )
 /**
  * @Given the following acme_php configuration:
  */
 public function theFollowingAcmePhpConfiguration(PyStringNode $rawConfig)
 {
     $yaml = new Yaml();
     $config = ['acme_php' => array_merge($this->getDefaultConfig(), $yaml->parse($rawConfig->getRaw()))];
     $this->filesystem->dumpFile($this->acmeConfigPath, $yaml->dump($config, 4));
     $this->kernel->shutdown();
     $this->filesystem->remove($this->kernel->getCacheDir());
     $this->kernel->boot();
 }
Exemple #2
0
 public function getCacheDir()
 {
     if (in_array($this->environment, ['dev', 'test']) && $this->cacheDir) {
         return $this->cacheDir;
     }
     return parent::getCacheDir();
 }
 public function getCacheDir()
 {
     if (in_array($this->getEnvironment(), array('dev', 'ci'))) {
         return '/dev/shm/' . $this->getEnvironment() . '/cache/';
     }
     return parent::getCacheDir();
 }
 public function getCacheDir()
 {
     if (in_array($this->getEnvironment(), array('dev', 'test'), true)) {
         return sprintf('/tmp/symfony/music/cache/%s', $this->environment);
     }
     return parent::getCacheDir();
 }
 public function getCacheDir()
 {
     if (array_key_exists('CACHE_DIR', $_ENV)) {
         return $_ENV['CACHE_DIR'] . DIRECTORY_SEPARATOR . $this->environment;
     }
     return parent::getCacheDir();
 }
Exemple #6
0
 /**
  * {@inheritdoc}
  */
 public function getCacheDir()
 {
     if ($this->isVagrantEnvironment()) {
         return '/dev/shm/park-manager/cache/' . $this->getEnvironment();
     }
     return parent::getCacheDir();
 }
Exemple #7
0
 /**
  * @see \Symfony\Component\HttpKernel\Kernel::getCacheDir()
  */
 public function getCacheDir()
 {
     if (in_array($this->environment, ['dev', 'test'])) {
         return '/dev/shm/librarian/cache/' . $this->environment;
     }
     return parent::getCacheDir();
 }
Exemple #8
0
 public function getCacheDir()
 {
     if ($this->getRootDir() === '/vagrant/app' && in_array($this->environment, ['dev', 'test'])) {
         return '/dev/shm/appname/cache/' . $this->environment;
     }
     return parent::getCacheDir();
 }
Exemple #9
0
 public function getCacheDir()
 {
     if (in_array($this->environment, array('dev', 'test'))) {
         return $this->getRootDir() . '/cache/' . $this->environment;
     }
     return parent::getCacheDir();
 }
Exemple #10
0
 public function getCacheDir()
 {
     if (in_array($this->environment, array('dev', 'test'))) {
         return sys_get_temp_dir() . '/jumph/cache/' . $this->environment;
     }
     return parent::getCacheDir();
 }
Exemple #11
0
 public function getCacheDir()
 {
     if (in_array($this->environment, array('dev', 'test'))) {
         return '/home/vagrant/stecnico/cache/' . $this->environment;
     }
     return parent::getCacheDir();
 }
 public function getCacheDir()
 {
     if (in_array($this->environment, array('dev', 'test'))) {
         return '/dev/shm/symfony/cache/' . $this->environment;
     }
     return parent::getCacheDir();
 }
Exemple #13
0
 /**
  * {@inheritdoc}
  */
 public function getCacheDir()
 {
     if ($this->isVagrantEnvironment()) {
         return '/dev/shm/sylius/cache/' . $this->environment;
     }
     return parent::getCacheDir();
 }
 public function getCacheDir()
 {
     if ($this->gcsBucketName) {
         return sprintf('gs://%s/symfony/cache%s', $this->gcsBucketName, $this->getVersionSuffix());
     }
     return parent::getCacheDir();
 }
Exemple #15
0
 public function getCacheDir()
 {
     if ($this->vagrant) {
         return '/dev/shm/sages/cache/' . $this->environment;
     }
     return parent::getCacheDir();
 }
 /**
  * {@inheritdoc}
  */
 public function getCacheDir()
 {
     return parent::getCacheDir();
     //        $environment = getenv("PLATFORM_ENVIRONMENT");
     //
     //        if (!$environment) {
     //            return parent::getCacheDir();
     //        }
     //        return $this->rootDir . '/cache/' . $environment . '/' . $this->environment;
 }
 public function getCacheDir()
 {
     if ($this->getEnvironment() == 'prod') {
         if (!is_dir(sys_get_temp_dir() . '/sf2standard/cache')) {
             mkdir(sys_get_temp_dir() . '/sf2standard/cache', 0777, true);
         }
         return sys_get_temp_dir() . '/sf2standard/cache';
     }
     return parent::getCacheDir();
 }
Exemple #18
0
 /**
  * PostManager constructor.
  *
  * @param Kernel       $kernel
  * @param RequestStack $requestStack
  */
 public function __construct(Kernel $kernel, RequestStack $requestStack)
 {
     $this->kernel = $kernel;
     $this->file = $kernel->getCacheDir() . DIRECTORY_SEPARATOR . 'api_bundle_posts';
     $this->request = $requestStack->getCurrentRequest();
     if (!file_exists($this->file)) {
         $fs = new Filesystem();
         $fs->touch($this->file);
         file_put_contents($this->file, serialize(array()));
     }
     $this->data = unserialize(file_get_contents($this->file));
 }
 private function configurePheal(Kernel $kernel, $userAgent, LoggerInterface $logger)
 {
     $config = Config::getInstance();
     $cacheDir = $kernel->getCacheDir() . '/pheal/';
     if (!is_dir($cacheDir)) {
         if (false === @mkdir($cacheDir, 0777, true)) {
             throw new \RuntimeException(sprintf('Could not create cache directory "%s".', $cacheDir));
         }
     }
     $config->cache = new HashedNameFileStorage($cacheDir);
     $config->access = new StaticCheck();
     $config->rateLimiter = new FileLockRateLimiter($cacheDir);
     $config->log = new PsrLogger($logger);
     $config->http_user_agent = $userAgent;
 }
Exemple #20
0
 /**
  * Returns path to cache dir.
  *
  * See README on how to override this
  *
  * @return string
  * @throws RuntimeException
  */
 public function getCacheDir()
 {
     static $s_dir;
     if ($s_dir) {
         return $s_dir;
     }
     if (self::DEFAULT_CACHE_DIR && (is_dir(self::DEFAULT_CACHE_DIR) || @mkdir(self::DEFAULT_CACHE_DIR, 0777, true)) && is_writable(self::DEFAULT_CACHE_DIR)) {
         return $s_dir = self::DEFAULT_CACHE_DIR;
     }
     $symfonyDefaultDir = parent::getCacheDir();
     $mainCacheDir = dirname($symfonyDefaultDir);
     if (is_dir($symfonyDefaultDir) && is_writable($symfonyDefaultDir) || is_dir($mainCacheDir) && is_writable($mainCacheDir)) {
         return $s_dir = $symfonyDefaultDir;
     }
     throw new \RuntimeException("Unable to write cache files!" . PHP_EOL . "This is because:" . PHP_EOL . "* The prefered directory '" . self::DEFAULT_CACHE_DIR . "' does not exist, can not be created or is not writable for the current user." . PHP_EOL . "* And default cache dir '{$symfonyDefaultDir}' does not exist, is not a softlink, or is not writable for the current user.");
 }
Exemple #21
0
 public function getCacheDir()
 {
     if (static::$cacheDir) {
         return static::$cacheDir;
     }
     $yaml = new Yaml();
     $env = $this->getEnvironment();
     $parameters = $yaml::parse(file_get_contents(__DIR__ . '/config/parameters.yml'));
     $config = $yaml::parse(file_get_contents(__DIR__ . "/config/config_{$env}.yml"));
     if (!empty($parameters['parameters']['cache_dir'])) {
         static::$cacheDir = $parameters['parameters']['cache_dir'];
     } elseif (!empty($config['parameters']['cache_dir'])) {
         static::$cacheDir = $config['parameters']['cache_dir'];
     } else {
         static::$cacheDir = parent::getCacheDir();
     }
     if (!is_dir(static::$cacheDir)) {
         @mkdir(static::$cacheDir, 0774, true);
         @chgrp(static::$cacheDir, 'www-data');
     }
     return static::$cacheDir;
 }
Exemple #22
0
 /**
  * {@inheritdoc}
  *
  * @api
  */
 public function getCacheDir()
 {
     $parameters = $this->getLocalParams();
     if (isset($parameters['cache_path'])) {
         $envFolder = strpos($parameters['cache_path'], -1) != '/' ? '/' . $this->environment : $this->environment;
         return str_replace('%kernel.root_dir%', $this->getRootDir(), $parameters['cache_path'] . $envFolder);
     } else {
         return parent::getCacheDir();
     }
 }
Exemple #23
0
 /**
  * Gets the cache directory.
  *
  * @return string The cache directory
  *
  * @api
  */
 public function getCacheDir()
 {
     if (defined('THELIA_ROOT')) {
         return THELIA_CACHE_DIR . DS . $this->environment;
     } else {
         return parent::getCacheDir();
     }
 }
Exemple #24
0
 /**
  * Vagrant optimisation: set cache directory in the vm
  *
  * @return string
  */
 public function getCacheDir()
 {
     $envParameters = $this->getEnvParameters();
     if (isset($envParameters['vagrant']) && $envParameters['vagrant'] === "1") {
         return '/dev/shm/vagrant/cache/' . $this->environment;
     }
     return parent::getCacheDir();
 }
 /**
  * Set kerrnel
  * 
  * Set the application
  * kernel
  * 
  * @param Kernel $kernel - the application kernel
  * 
  * @return CacheProviderInterface
  *
  * @see \Cscfa\Bundle\CacheSystemBundle\Object\provider\CacheProviderInterface::setKernel()
  */
 public function setKernel(Kernel $kernel)
 {
     $this->cacheDir = $kernel->getCacheDir() . '/';
     return $this;
 }
Exemple #26
0
 /**
  * @inheritDoc
  *
  * contains some experimental code for custom cache directories
  * for multiple sites.
  * @todo find something that works for both console and web
  * @todo don't cache non site specific resources.
  */
 public function getCacheDir()
 {
     if (isset($_SERVER[self::EXTERNAL_CACHE_BASE_TOGGLE])) {
         return sprintf('/var/zenmagick/%s/%s/cache/%s', $_SERVER[self::EXTERNAL_USER_DIR_KEY], $_SERVER[self::EXTERNAL_HOST_DIR_KEY], $this->environment);
     }
     return parent::getCacheDir();
 }
 /**
  * Return the cache directory.
  * @return string
  */
 protected function getKernelCacheDir()
 {
     return $this->kernel->getCacheDir();
 }
 /**
  * Collects information about the Symfony kernel.
  *
  * @return Value\SymfonyKernelSystemInfo
  */
 public function collect()
 {
     ksort($this->bundles, SORT_FLAG_CASE | SORT_STRING);
     return new Value\SymfonyKernelSystemInfo(['environment' => $this->kernel->getEnvironment(), 'debugMode' => $this->kernel->isDebug(), 'version' => Kernel::VERSION, 'bundles' => $this->bundles, 'rootDir' => $this->kernel->getRootDir(), 'name' => $this->kernel->getName(), 'cacheDir' => $this->kernel->getCacheDir(), 'logDir' => $this->kernel->getLogDir(), 'charset' => $this->kernel->getCharset()]);
 }
 /**
  * {@inheritdoc}
  */
 public function getCacheDir()
 {
     return parent::getCacheDir();
     return "/tmp/cache/{$this->getName()}/{$this->getEnvironment()}";
 }
 public function getCacheDir()
 {
     return parent::getCacheDir() . '/cache';
 }