dafiti / cache-service-provider
Doctrine Cache 的 Silex 服务提供者
此包的官方仓库似乎已不存在,因此已冻结该包。
0.0.3
2015-05-14 19:04 UTC
Requires
- php: >=5.4.0
- doctrine/cache: v1.4.0
- silex/silex: ~1.1
Requires (Dev)
- fabpot/php-cs-fixer: @stable
- phpunit/phpunit: @stable
This package is not auto-updated.
Last update: 2021-06-11 23:29:49 UTC
README
Silex 服务提供者,用于 Doctrine Cache。
安装
{ "require": { "dafiti/cache-service-provider": "dev-master" } }
可用的适配器
要使用 Memcache
sudo apt-get install php5-memcached
要使用 Memcached
sudo apt-get install php5-memcached
要使用 Redis 适配器,请安装 PHPRedis
git clone git@github.com:phpredis/phpredis.git
cd phpredis
phpize
./configure
make && make install
使用方法
use Silex\Application; use Dafiti\Silex\CacheServiceProvider; $app = new Application(); $app['config'] = [ 'cache' => [ 'adapter' => 'Memcache', 'host' => '127.0.0.1', 'port' => 11211, 'connectable' => true // If not need of one connection put FALSE ] ]; $app->register(new CacheServiceProvider()); $app['cache']->save('your-key', 'your-data'); $data = $app['cache']->fetch('your-key'); echo $data; // your-data
许可
MIT 许可证