Skip to content

v3.0

Compare
Choose a tag to compare
@ve3 ve3 released this 21 Jun 07:27
· 12 commits to version3 since this release
0fd3fb4
  • Implemented PSR-16.
  • APC deprecated and will be removed in next major version.
  • Add Memory cache (or PHP array cache) that will be stay only one session and object must not unset.
  • Allow to cache boolean data that is false.

Upgrade guide.

Changed method.

save()

save() is now set(). The method argument will be same.

get()

get() is now add second argument to get default value if cache is not exists.

Previous version example:

$getResult = $SimpleCache->get('cache_id');
if ($getResult === false) {
    $getResult = 'some default data.';
}

Current version example:

$getResult = $SimpleCache->get('cache_id', 'some default data.');

Interfaces removed.

The interface name \Rundiz\SimpleCache\SimpleCacheInterface was removed due to it is implemented PSR-16 and changed to \Psr\SimpleCache\CacheInterface instead.
If you check the class instance using instanceof, please rewrite it.

Method argument renamed.

The method argument $id in delete($id), get($id), save($id) is now $key.

The method argument $data and $lifetime in save($id, $data, $lifetime) is now $value, $ttl in set($key, $value, $ttl).

These are not affect anything in your code but just notice.