Doing Symfony2 in Vagrant and VirtualBox? Truth is that vboxfs is so called "network" filesystem and performance is poor. From time to time Symfony2 also experiences issues with cache:clear because of file locking. One solution for this is to move tmp folder outside the project to system temporary file folder.
Last active
August 29, 2015 14:00
-
-
Save tadas-s/4d9fe00d099d907af8fe to your computer and use it in GitHub Desktop.
Relocate tmp folder on Symfony2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Symfony\Component\HttpKernel\Kernel; | |
class AppKernel extends Kernel | |
{ | |
/* ... everything else is skipped ... */ | |
public function getCacheDir() | |
{ | |
if ($this->environment == 'dev') { | |
// use md5 of app root to avoid clashes with other Symfony2 apps | |
return '/tmp/'.md5($this->rootDir).'/cache/'.$this->environment; | |
} else { | |
return parent::getCacheDir(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this case we can't use Symfony IDE autocomplete (for example on PHPStorm)