2017 © Pedro Peláez
 

library cache

A collection of caching classes with a common interface

image

vakata/cache

A collection of caching classes with a common interface

  • Friday, July 27, 2018
  • by vakata
  • Repository
  • 1 Watchers
  • 0 Stars
  • 718 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 11 % Grown

The README.md

cache

Latest Version on Packagist ![Software License][ico-license] Build Status Code Climate ![Tests Coverage][ico-cc-coverage], (*1)

A collection of caching classes with a common interface (currently file cache and memcached are supported)., (*2)

Install

Via Composer, (*3)

``` bash $ composer require vakata/cache, (*4)


## Usage ``` php // create an instance (with file based cache) // caches will be stored in the dir specified by the first argument $cache = new \vakata\cache\Filecache(__DIR__ . '/cache'); // to use Memcached instead simply create a memcached instance: // $cache = new \vakata\cache\Memcache(); // by default connects to 127.0.0.1 // simple get / set $cache->set('key', 'value'); // key is stored and "value" is returned $cache->get('key'); // "value" // using prepare ensures that a single client updates the cache at any given moment $cache->prepare('long-running-operation'); $data = long_running_operation(); $cache->set('long-running-operation', $data); // there is a special getSet method which gets the current key value and if it does not exist - invokes a callable, stores the result and returns it: $cache->getSet('some-key', function () { return some_long_running_operation(); });

Read more in the API docs, (*5)

Testing

bash $ composer test, (*6)

Contributing

Please see CONTRIBUTING for details., (*7)

Security

If you discover any security related issues, please email github@vakata.com instead of using the issue tracker., (*8)

Credits

License

The MIT License (MIT). Please see License File for more information., (*9)

The Versions

27/07 2018

dev-master

9999999-dev https://github.com/vakata/cache

A collection of caching classes with a common interface

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

cache vakata

27/07 2018

2.1.1

2.1.1.0 https://github.com/vakata/cache

A collection of caching classes with a common interface

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

cache vakata

27/07 2018

2.1.0

2.1.0.0 https://github.com/vakata/cache

A collection of caching classes with a common interface

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

cache vakata

28/10 2016

2.0.3

2.0.3.0 https://github.com/vakata/cache

A collection of caching classes with a common interface

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

cache vakata

27/10 2016

2.0.2

2.0.2.0 https://github.com/vakata/cache

A collection of caching classes with a common interface

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

cache vakata

08/04 2016

2.0.1

2.0.1.0 https://github.com/vakata/cache

A collection of caching classes with a common interface

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

cache vakata

07/04 2016

2.0.0

2.0.0.0 https://github.com/vakata/cache

A collection of caching classes with a common interface

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

cache vakata

03/12 2015

1.0.0

1.0.0.0 https://github.com/vakata/cache

A collection of caching classes with a common interface

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

cache vakata