PHPackages                             cs/symfony-vagrant-kernel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. cs/symfony-vagrant-kernel

ActiveLibrary[Caching](/categories/caching)

cs/symfony-vagrant-kernel
=========================

Speeds up Symfony when host source dir is shared over network with Vagrant box.

v1.0.0(11y ago)132MITPHPPHP &gt;=5.4

Since Oct 4Pushed 11y ago5 watchersCompare

[ Source](https://github.com/creativestyle/symfony-vagrant-kernel)[ Packagist](https://packagist.org/packages/cs/symfony-vagrant-kernel)[ RSS](/packages/cs-symfony-vagrant-kernel/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

Symfony Vagrant Kernel
======================

[](#symfony-vagrant-kernel)

This package can speed up your Symfony dev installation when you're using Vagrant.

If your application is residing on your host os' drive and it's shared with Vagrant box over network then symfony cache and logs IO will kill your performance. This kernel extension configures your application to store cache and logs in /dev/shm.

The only drawback I can think of is that the whole cache (possible including sessions) will be lost once you power down the Vagrant box. Oh, and /dev/shm was probably designed for sharing...

WARNING! This is not for production. Use at your own risk! WARNING! The logs will be in /dev/shm/(symfony2|projectname)/logs.

Installation
------------

[](#installation)

Add `"cs/symfony-vagrant-kernel": "1.0",` to your `composer.json`.

Change the line `use Symfony\Component\HttpKernel\Kernel;` to `use CS\Vagrant\Kernel;` in your `app/AppKernel.php`.

### Multiple projects on the same Vagrant box

[](#multiple-projects-on-the-same-vagrant-box)

If you have multiple projects running on the same vagrant box then you should define your "project name" which is basically the name of `/dev/shm` subdirectory which will be used to store your cache. If you don't do this then prepare for chaos to ensue.

Override the method `getProjectName`, so it looks sth like this:

```
protected function getProjectName()
{
    return 'some_unique_string_preferably_the_name_of_your_project';
}
```

### Configure when to attempt to use the memory cache.

[](#configure-when-to-attempt-to-use-the-memory-cache)

By default the kernel will enable `/dev/shm` caching when following conditions are met:

- You have a writable `/dev/shm` directory.
- `/home/vagrant` exists in your filesystem.

You can change the last condition by overriding the method `useMemoryCaching` in your kernel. For example if you want this feature to be used always in your dev environment do sth like this:

```
protected function useMemoryCaching()
{
    return $this->getEnvironment() === 'dev';
}
```

Other considerations
--------------------

[](#other-considerations)

I suppose you could use `/tmp` but doesn't memory cache sound better?

Acknowledgment
--------------

[](#acknowledgment)

This code is based on the idea presented by [Benjamin Eberlei](http://www.whitewashing.de/2013/08/19/speedup_symfony2_on_vagrant_boxes.html) and later expanded by [Jakub Kanclerz](https://gist.github.com/jkanclerz/d97bc7fd7e395688240a).

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4289d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/852691f2c0476ae46e9bc0751fb11a6bf27092e34f5e35e2a70e2d003787670c?d=identicon)[pinkeen](/maintainers/pinkeen)

---

Top Contributors

[![pinkeen](https://avatars.githubusercontent.com/u/2019132?v=4)](https://github.com/pinkeen "pinkeen (1 commits)")

---

Tags

symfonycachevagrantspeedup

### Embed Badge

![Health badge](/badges/cs-symfony-vagrant-kernel/health.svg)

```
[![Health](https://phpackages.com/badges/cs-symfony-vagrant-kernel/health.svg)](https://phpackages.com/packages/cs-symfony-vagrant-kernel)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
