ocramius/ocra-cached-view-resolver

Cached view template path resolver to speed up the ZF2 view layer by avoiding stat calls

Installs: 8 365

Dependents: 3

Stars: 47

Watchers: 7

Forks: 10

Language: PHP

3.0.2 2015-03-24 00:55 UTC

README

OcraCachedViewResolver is performance-oriented Zend Framework 2 Module that increases performance in your application by caching the process of resolving template names to template paths.

In ZF2, the process of resolving template paths causes a lot of stat calls. This module adds a cache layer to avoid that.

Tests Releases Downloads Dependencies Build Status Code Coverage Scrutinizer Quality Score Latest Stable Version Latest Unstable Version Total Downloads Dependency Status

Installation

The recommended way to install ocramius/ocra-cached-view-resolver is through composer:

php composer.phar require ocramius/ocra-cached-view-resolver:3.0.*

If you use legacy/outdated PHP versions, such as 5.3.x and 5.4.x, you can use any 1.x version of ocramius/ocra-cached-view-resolver.

You can then enable the module in your config/application.config.php by adding 'OcraCachedViewResolver' to the 'modules' section.

Configuration

Default configurations are provided in config/ocra-cached-view-resolver.local.php.dist. You can copy it to your application's config/autoload directory and remove the .dist extension from the file name.

Note that without this file (or similar configuration), OcraCachedViewResolver will use a so-called "blackhole" cache that doesn't actually cache anything. The provided .dist config file assumes that you have the APC extension installed: if that is not the case, please tweak this file.