library cache
Mozart Cache Providers
mozart/cache
Mozart Cache Providers
- Saturday, June 29, 2013
- by faizalpribadi
- Repository
- 0 Watchers
- 0 Stars
- 22 Installations
- PHP
- 1 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 3 Versions
- 0 % Grown
, (*1)
Mozart - Cache
installation with composer
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar require mozart/cache // next typing "dev-master"
installation with git
$ git clone https://github.com/FaizalPribadi/Cache.git /path/to/your-vendor/Cache
usage
set('my.cache', 'im cache', CacheFlags::CACHE_LIFETIME );
$data = $cache->get('apc.cache');
if ($data) {
$cache->remove($id);
echo $status->getDropCache()->getStatus();
}
```
usage : cache support with event
============================
```php
getCache()->getStatus();
$event->stopPropagation();
echo $event->getEvent();
}
}
class DropCacheListenr
{
protected $dispatcher;
/**
* @param EventDispatcher $dispatcher
*/
public function __construct(EventDispatcher $dispatcher = null)
{
if (null === $dispatcher) {
$dispatcher = new EventDispatcher();
$this->dispatcher = $dispatcher;
}
$listener = new DropListener();
$listener->onDropCacheEvent(new DropCacheEvent());
$this->dispatcher->addListener(CacheStatusEvent::CACHE_DROP_EVENT, array($listener, 'onDropCacheEvent'));
}
public function send()
{
$dropCache = new DropCacheEvent();
return $this->dispatcher->dispatch(CacheStatusEvent::CACHE_DROP_EVENT, $dropCache);
}
}
$listener = new DropCacheListenr();
var_dump($listener->send());
```
_For full details usage, see [Docs](https://github.com/FaizalPribadi/Cache/blob/master/Docs/Documentation.md)_
You're own customize
====================
```php