kktsvetkov / kacho

File-based PHP caching library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kacho

Very basic and simple file-based PHP5 caching library

The "Kacho" library is designed to cache data "as is" using compiled PHP files; "compiled" means that the data inside them is just declared, similar to just how the JSON works, but in native PHP ;)

In other words you can store various type of data (not just scalars) in PHP files generated by Kacho: that's why you can think of this as the PHP version of JSON.

Here is an example of how to use it:

/* Cache current $_SERVER array for one hour */
echo Kacho::open('/tmp/proba.php')->write($_SERVER, 3600)
	? 'Kacho caching is OK :)'
	: 'Kacho caching failed :(';

/* Read the cached $_SERVER array */
echo Kacho::open('/tmp/proba.php')->read($_SERVER);

Make sure that the locations that you provide for the cache files are writable, e.g. you can create new files there.

Migrated from https://code.google.com/archive/p/kacho/

About

File-based PHP caching library

License:GNU Lesser General Public License v3.0


Languages

Language:PHP 100.0%