2017 © Pedro Peláez
 

library phpfastcache

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

image

quietasice/phpfastcache

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  • Saturday, January 9, 2016
  • by nnikitchenko
  • Repository
  • 1 Watchers
  • 0 Stars
  • 270 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 398 Forks
  • 0 Open issues
  • 30 Versions
  • 2 % Grown

The README.md

Code Climate, (*1)


Simple Yet Powerful PHP Caching Class

More information at http://www.phpfastcache.com One Class uses for All Cache. You don't need to rewrite your code many times again., (*2)

Supported: Redis, Predis, Cookie, Files, MemCache, MemCached, APC, WinCache, X-Cache, PDO with SQLite, (*3)


Reduce Database Calls, (*4)

Your website have 10,000 visitors who are online, and your dynamic page have to send 10,000 same queries to database on every page load. With phpFastCache, your page only send 1 query to DB, and use the cache to serve 9,999 other visitors., (*5)

<?php
/*
 * Welcome to Learn Lesson
 * This is very Simple PHP Code of Caching
 */

// Require Library
// Keep it Auto or setup it as "files","sqlite","wincache" ,"apc","memcache","memcached", "xcache"
require_once("phpfastcache.php");
phpFastCache::setup("storage","auto");
// phpFastCache::setup("storage","files");
// OR open phpfastcache.php and edit your config value there

// simple Caching with:
$cache = phpFastCache();
// $cache = phpFastCache("redis");

// Try to get $products from Caching First
// product_page is "identity keyword";
$products = $cache->get("product_page");

if($products == null) {
    $products = "DB QUERIES | FUNCTION_GET_PRODUCTS | ARRAY | STRING | OBJECTS";
    // Write products to Cache in 10 minutes with same keyword
    $cache->set("product_page",$products , 600);
}

// use your products here or return it;
echo $products;

<?php

/*
 * List of function and example
 */
require_once("phpfastcache.php");
$cache = phpFastCache();

// Write into cache
$cache->set("keyword", "data | array | object", 300);
$cache->set("keyword", "data | array | object"); // <-- Non-Expired Objects without Time, until you delete the cache.

// Read from Cache | return "null" or "data"
$data = $cache->get("keyword");
echo $data;

// Temporary disabled phpFastCache
phpFastCache::$disabled = true;
$data = $cache->get("keyword");
echo $data; // ALWAYS RETURN NULL;

// Read object information | value | time from cache
$object = $cache->getInfo("keyword");
print_r($object);

// Delete from cache
$cache->delete("keyword");

// Clean up all cache
$cache->clean();

// Stats
$array = $cache->stats();
print_r($array);

// Increase and Decrease Cache value - Return  true | false
$cache->increment("keyword", 1);
$cache->decrement("keyword", 1);

// Extend expiring time - Return true | false;
$cache->touch("keyword", 1000);

// Check Existing or not - Return true | false;
$cache->isExisting("keyword");

// Get & Set Multiple Items
// Same as above, but input is array();

$list = $cache->getMulti(array("key1","key2","key3"));

$list = $cache->getInfoMulti(array("key1","key2","key3"));

$cache->setMulti(array("key1","value1", 300),
    array("key2","value2", 600),
    array("key3","value3", 1800));

$cache->deleteMulti(array("key1","key2","key3"));

$cache->isExistingMulti(array("key1","key2","key3"));

$cache->touchMulti(array(
                    array("key", 300),
                    array("key2", 400),
                   ));

$cache->incrementMulti(array(
                        array("key", 1),
                        array("key2", 2),
                    ));

$cache->decrementMulti(array(
                        array("key", 1),
                        array("key2", 2),
                    ));

The Versions

09/01 2016

dev-master

9999999-dev http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

09/01 2016

dev-final

dev-final http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

30/12 2015

3.0.24

3.0.24.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

28/12 2015

3.0.23

3.0.23.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

28/12 2015

3.0.22

3.0.22.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

27/12 2015

3.0.21

3.0.21.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

17/12 2015

3.0.20

3.0.20.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

19/11 2015

3.0.19

3.0.19.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

14/11 2015

3.0.18

3.0.18.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

14/11 2015

dev-revert-150-final

dev-revert-150-final http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

10/11 2015

3.0.17

3.0.17.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

28/10 2015

3.0.16

3.0.16.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

27/10 2015

3.0.15

3.0.15.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

03/10 2015

3.0.14

3.0.14.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

01/10 2015

3.0.13

3.0.13.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

01/10 2015

3.0.12

3.0.12.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

14/09 2015

3.0.11

3.0.11.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

25/08 2015

3.0.10

3.0.10.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

11/08 2015

3.0.9

3.0.9.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

02/08 2015

3.0.8

3.0.8.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

31/07 2015

3.0.7

3.0.7.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

28/06 2015

3.0.6

3.0.6.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

26/05 2015

3.0.5

3.0.5.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

04/04 2015

3.0.4

3.0.4.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

03/03 2015

3.0.3

3.0.3.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

01/03 2015

3.0.2

3.0.2.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

01/03 2015

3.0.1

3.0.1.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

25/02 2015

2.4.3

2.4.3.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

25/02 2015

3.0.0

3.0.0.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class

24/02 2015

2.4.2

2.4.2.0 http://www.phpfastcache.com

PHP Cache Class - Supported Redis, Cookie, Predis, APC, MemCached, WinCache, Files, PDO, Reduce mySQL Call by Caching

  Sources   Download

MIT

The Requires

  • php >=5.1.0

 

cache redis memcache predis apc caching memcached apc cache cookie wincache mysql cache php cache files cache pdo cache cache class