strontium/symfony-vagrant

Helpers for improve Symfony perfomance when working under Vagrant enviroment

dev-master / 0.3.x-dev 2017-03-21 13:03 UTC

This package is auto-updated.

Last update: 2020-06-26 12:15:09 UTC


README

Helpers for improve Symfony 2 performance when working under Vagrant environment.

Using Symfony2 inside Vagrant can be slow due to synchronisation delay incurred by NFS. To avoid this, both locations have been moved to a shared memory segment under /dev/shm/%your_app_name%.

To view the application logs, run the following commands:

$ tail -f /dev/shm/%your_app_name%/logs/prod.log
$ tail -f /dev/shm/%your_app_name%/logs/dev.log

Installation

Add to composer.json:

{
    "require": {
        "strontium/symfony-vagrant": "*"
    }
}

Usage

Extend yor Kernel from VagrantAwareKernel:

<?php
// app/AppKernel.php

use Strontium\SymfonyVagrant\Kernel\VagrantAwareKernel;

class AppKernel extends VagrantAwareKernel

If you using PHPStrorm and want to have copy of Symfony cache in your host machine, add next scripts to composer.json:

    "scripts": {
        "post-install-cmd": [
            "Strontium\\SymfonyVagrant\\Composer\\ScriptHandler::cacheWarmupOnVagrant"
        ],
        "post-update-cmd": [
            "Strontium\\SymfonyVagrant\\Composer\\ScriptHandler::cacheWarmupOnVagrant"
        ]
    }