2017 © Pedro Peláez
 

library uri-encoder-doctrine-cache

Provides a Doctrine Cache adapter for the Rollerworks URIEncoder Component

image

rollerworks/uri-encoder-doctrine-cache

Provides a Doctrine Cache adapter for the Rollerworks URIEncoder Component

  • Saturday, September 19, 2015
  • by sstok
  • Repository
  • 1 Watchers
  • 0 Stars
  • 227 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Doctrine Cache adapter for the Rollerworks URIEncoder Component

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

Installation

To install this package, add rollerworks/uri-encoder-doctrine-cache to your composer.json, (*2)

$ php composer.phar require rollerworks/uri-encoder-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:, (*3)

$ php composer update rollerworks/uri-encoder-doctrine-cache

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

Usage


require 'vendor/autoload.php'; use Doctrine\Common\Cache\ArrayCache; use Doctrine\Common\Cache\ChainCache; use Rollerworks\Component\UriEncoder\Encoder as UriEncoder; use Rollerworks\Component\UriEncoder\Cache\DoctrineCache; // 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(), // Add an simple cache for fast access, eg. the rollerworks session-cache library. // https://github.com/rollerworks/Cache ] ); // Rollerworks\Component\UriEncoder\CacheAdapterInterface $cacheDriver = new DoctrineCache($doctrineCache); $stringEncode = 'This string is not safe, for direct usage & must encoded'; $base64Encoder = new UriEncoder\Base64UriEncoder(); $cacheEncoder = new UriEncoder\CacheEncoderDecorator($cacheDriver, $base64Encoder); $safeValue = $cacheEncoder->encodeUri($stringEncode); // $safeString now contains a base64 encoded string // and the result is cached using the cacheDriver. $originalValue = $cacheEncoder->decodeUri($safeValue);

The Versions

19/09 2015

dev-master

9999999-dev

Provides a Doctrine Cache adapter for the Rollerworks URIEncoder Component

  Sources   Download

MIT

The Requires

 

by Sebastiaan Stok

rollerworks

19/09 2015

v1.0.0

1.0.0.0

Provides a Doctrine Cache adapter for the Rollerworks URIEncoder Component

  Sources   Download

MIT

The Requires

 

by Sebastiaan Stok

rollerworks