2017 © Pedro Peláez
 

library metadata-doctrine-cache

Doctrine Cache adapter for the Rollerworks Metadata Component

image

rollerworks/metadata-doctrine-cache

Doctrine Cache adapter for the Rollerworks Metadata Component

  • Friday, January 1, 2016
  • by sstok
  • Repository
  • 1 Watchers
  • 0 Stars
  • 621 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Doctrine Cache adapter for the Rollerworks Metadata Component

Build Status, (*1)

This package provides a Doctrine Cache adapter for the [Rollerworks Metadata Component][1]., (*2)

Installation

To install this package, add rollerworks/metadata-doctrine-cache to your composer.json, (*3)

$ php composer.phar require rollerworks/metadata-doctrine-cache

Then, you can install the new dependencies by running Composer's update command from the directory where your composer.json file is located:, (*4)

$ php composer update rollerworks/metadata-doctrine-cache

Now, Composer will automatically download all required files, and install them for you., (*5)

Usage


require 'vendor/autoload.php'; use Doctrine\Common\Cache\ArrayCache; use Doctrine\Common\Cache\ChainCache; use Doctrine\Common\Cache\FilesystemCache; use Rollerworks\Component\Metadata\CacheableMetadataFactory; use Rollerworks\Component\Metadata\Cache\Validator\AlwaysFreshValidator; use Rollerworks\Component\Metadata\Cache\ArrayCache; $cacheDirectory = ...; // The Doctrine cache library. $doctrineCache = new ChainCache( [ // Include the ArrayCache as the ChainCache will populate all the previous cache layers. // So if the `FilesystemCache` has a match it will populate the faster ArrayCache. new ArrayCache(), // Saves the cache in the filestem. new FilesystemCache($cacheDirectory), ] ); // Rollerworks\Component\Metadata\Cache\CacheProvider $cache = Rollerworks\Component\Metadata\Driver\Cache\DoctrineCache($doctrineCache); // Rollerworks\Component\Metadata\Driver\MappingDriver $driver = ...; // Rollerworks\Component\Metadata\Cache\FreshnessValidator $freshnessValidator = ...; $metadataFactory = new CacheableMetadataFactory($driver, $doctrineCache, $freshnessValidator);

That's it., (*6)

Running test

Whenever you open a pull-request tests are already run by Travis-CI., (*7)

Tests can be run with PHPUnit, make sure you use the --prefer-source option when running Composer as some classes for testing are not available in the archive package., (*8)

The Versions

01/01 2016

dev-master

9999999-dev

Doctrine Cache adapter for the Rollerworks Metadata Component

  Sources   Download

MIT

The Requires

 

by Sebastiaan Stok

cache doctrine metadata rollerworks

17/09 2015

v0.2

0.2.0.0

Doctrine Cache adapter for the Rollerworks Metadata Component

  Sources   Download

MIT

The Requires

 

by Sebastiaan Stok

cache doctrine metadata rollerworks

17/09 2015

v0.1

0.1.0.0

Doctrine Cache adapter for the Rollerworks Metadata Component

  Sources   Download

MIT

The Requires

 

by Sebastiaan Stok

cache doctrine metadata rollerworks