Skip to content

Instantly share code, notes, and snippets.

@exts
Last active December 4, 2017 23:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exts/720071e7cacc9fe8ada3e882d6261990 to your computer and use it in GitHub Desktop.
Save exts/720071e7cacc9fe8ada3e882d6261990 to your computer and use it in GitHub Desktop.
Symfony 4, Symfony Flex, Vagrant, Failed to remove directory (cache, de~, pools), Windows 10
<?php
class Kernel extends BaseKernel
{
use MicroKernelTrait;
const CONFIG_EXTS = '.{php,xml,yaml,yml}';
public function getCacheDir()
{
//add this when using vagrant to store cache in your vagrant temp folder
//there's a weird issue with guest machines & shared folders so some folders
//will exists locally on your windows machine, but not shared on your vm so this solves that issue
//fuck yeah
//shoutout to: https://stackoverflow.com/a/47296954
if ($this->environment === 'dev') {
return '/tmp/symfony/cache';
}
return $this->getProjectDir().'/var/cache/'.$this->environment;
}
//... other methods
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment