2017 © Pedro Peláez
 

library simple-cache

Simple PHP object caching base on temp file

image

jaredchu/simple-cache

Simple PHP object caching base on temp file

  • Wednesday, October 11, 2017
  • by jaredchu
  • Repository
  • 1 Watchers
  • 1 Stars
  • 724 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 2 Open issues
  • 9 Versions
  • 9 % Grown

The README.md

simple-cache

Simple PHP object caching base on temp file, (*1)

Packagist Packagist Travis Scrutinizer Codecov Packagist FOSSA Status, (*2)

Installation

$ composer require jaredchu/simple-cache, (*3)

Usage

Quick start

use JC\Cache\SimpleCache;

// store your object
SimpleCache::add('your-key', new Person('Jared', 27));

// check if exists
SimpleCache::exists('your-key');

// fetch your object
$person = SimpleCache::fetch('your-key', Person::class);

// remove your cache
SimpleCache::remove('your-key');

Add

// cache object Person with lifetime 1000 seconds (default is 0, not expire)
SimpleCache::add('your-key', new Person('Jared', 27), 1000);

Fetch

if(SimpleCache::exists('your-key')){
  $person = SimpleCache::fetch('your-key', Person::class);
  $person->sayHi();
}

Remove

SimpleCache::remove('your-key');

Security

// your data is already encrypt but you can set your own encrypt key
SimpleCache::setEncryptKey('your unique string');
SimpleCache::add('your-key', new Person('Jared', 27));

// you must set encrypt key again if you want to call fetch in another session
SimpleCache::setEncryptKey('your unique string');
$person = SimpleCache::fetch('your-key', Person::class);

Contributing

  1. Fork it!
  2. Create your feature branch: $ git checkout -b feature/your-new-feature
  3. Commit your changes: $ git commit -am 'Add some feature'
  4. Push to the branch: $ git push origin feature/your-new-feature
  5. Submit a pull request.

License

MIT License, (*4)

FOSSA Status, (*5)

The Versions

11/10 2017

dev-master

9999999-dev

Simple PHP object caching base on temp file

  Sources   Download

MIT

The Requires

 

The Development Requires

cache php

11/10 2017

v1.1.1

1.1.1.0

Simple PHP object caching base on temp file

  Sources   Download

MIT

The Requires

 

The Development Requires

cache php

18/09 2017

v1.1.0

1.1.0.0

Simple PHP object caching base on temp file

  Sources   Download

MIT

The Requires

 

The Development Requires

cache php

18/08 2017

dev-feature/update-jsonmapper

dev-feature/update-jsonmapper

Simple PHP object caching base on temp file

  Sources   Download

MIT

The Requires

 

The Development Requires

cache php

18/08 2017

v1.0.3

1.0.3.0

Simple PHP object caching base on temp file

  Sources   Download

MIT

The Requires

 

The Development Requires

cache php

11/08 2017

v1.0.2

1.0.2.0

Simple PHP object caching base on temp file

  Sources   Download

MIT

The Requires

 

The Development Requires

cache php

10/08 2017

v1.0.1

1.0.1.0

Simple PHP object caching base on temp file

  Sources   Download

MIT

The Requires

 

The Development Requires

cache php

10/08 2017

v1.0.0

1.0.0.0

Simple PHP object caching base on temp file

  Sources   Download

MIT

The Requires

 

The Development Requires

cache php

09/08 2017

v0.1-alpha

0.1.0.0-alpha

Simple PHP object caching base on temp file

  Sources   Download

MIT

The Requires

 

The Development Requires

cache php