Skip to content

Instantly share code, notes, and snippets.

@dmitrybelyakov
Last active October 3, 2016 08:59
Show Gist options
  • Save dmitrybelyakov/b3d6c1d397c05291b7a8300fca5ead27 to your computer and use it in GitHub Desktop.
Save dmitrybelyakov/b3d6c1d397c05291b7a8300fca5ead27 to your computer and use it in GitHub Desktop.
Symfony write cache and logs to memory
<?php
public function getCacheDir()
{
if (in_array($this->environment, array('dev', 'test'))) {
return '/dev/shm/appname/cache/' . $this->environment;
}
return parent::getCacheDir();
}
public function getLogDir()
{
if (in_array($this->environment, array('dev', 'test'))) {
return '/dev/shm/appname/logs';
}
return parent::getLogDir();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment