netzdenke/phpmcached

PHP Memcached adapter with cache groups

v1.1.0 2015-09-21 12:57 UTC

This package is not auto-updated.

Last update: 2024-12-21 17:27:51 UTC


README

Latest Stable Version License

PHPMCached is a PHP Memcached adapter with support for cache groups.

Requirements

  • PHP 5.3 or later
  • PHP Memcached extension

Usage

Install the latest version with composer require netzdenke/phpmcached

<?php

$cache = \PHPMCached\PHPMCached::getInstance('application_name');
$cache->addServer('127.0.0.1');
$cacheKey = $cache->getCacheKey('foo');

$cache->set($cacheKey, 'value', 'cache_group', \PHPMCached\PHPMCached::EXPIRATION_HOUR);

$value = $cache->get($cacheKey);

$cache->deleteCacheGroup('cache_group');

License

PHPMCached is licensed under the MIT License - see the LICENSE file for details