Prerequisites:
http://box.scotch.io/ vagrant box
# -*- mode: ruby -
In order to make it work faster in vagrant in case your host OS is Win (Windows 7 x64 in my case), you need to:
public function getCacheDir()
{
if (in_array($this->environment, array('dev', 'test', 'prod'))) {
return '/dev/shm/project/cache/' . $this->environment;
}
return parent::getCacheDir();
}
public function getLogDir()
{
if (in_array($this->environment, array('dev', 'test', 'prod'))) {
return '/dev/shm/project/logs';
}
return parent::getLogDir();
}
Also, mounting with synced_folder did not work for me, as NFS server was only listening on specific IP address, so I had to comment out this:
config.vm.synced_folder "../../../project", "/var/www", type: "nfs",:nfs => true
and put this instead:
$script = <<SCRIPT
sudo mount 192.168.178.40:/d/project /var/www/ && sudo mount 192.168.178.40:/d/project/_conf /etc/apache2/sites-enabled && sudo service apache2 restart
SCRIPT
config.vm.provision "shell", inline: $script, privileged: false, run: "always"
,where 192.168.178.40 is the IP where NFS ports are open. You can scan it from yout gurest OS with, e.g. nmap.
vagrant plugin install vagrant-winnfsd
I think it's not a problem with twig performance but directory sharing in VirtualBox/vagrant. Try to enable I/O caching in VirtualBox.