Skip to content

Instantly share code, notes, and snippets.

@exts

exts/Kernel.php

Last active Dec 4, 2017
Embed
What would you like to do?
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