escapework / cache
Library pra controle de cache
Installs: 68
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 7
Forks: 0
Open Issues: 0
pkg:composer/escapework/cache
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is auto-updated.
Last update: 2025-09-29 01:44:25 UTC
README
Em construção.
Exemplos
use EscapeWork\Cache\Facade as Cache; # setting Cache::set('key', 'value', 'namespace'); # namespace é opcional # getting # if the value don't exists in cache, the closure is called Cache::get('key', function() { return 'your function to get data'; }, 'namespace'); # deleting Cache::delete('key'); # flush namespace Cache::flushNamespace('namespace'); # flush all cache Cache::flush();
Tipos de cache disponíveis
- Memcached
- APC
- File
- Array (Para testes unitários)
Configuração
use EscapeWork\Cache\Facade as Cache; Cache::driver(array( 'driver' => 'memcached', 'memcached' => array( array('host' => 'your-host', 'port' => 11211) # server settings ), )); Cache::driver(array( 'driver' => 'file', 'path' => '/path/to/your/cache/dir/', ));
Instalação
A instalação está disponível via Composer. Autoload compátivel com a PSR-0.
{
"require": {
"escapework/cache": "0.1.*"
}
}