starter-kit/cache
最新稳定版本:1.2.0
Composer 安装命令:
composer require starter-kit/cache
包简介
PHP singleton for Memcached/Redis
README 文档
README
PHP singleton for Memcached/Redis
Requirements
- PHP >= 5.3
Suggestions
- PHP Memcached extension
- PHP Redis extension
Installation
Install directly via Composer:
$ composer require starter-kit/cache
Basic Usage
Memcached
<?php // Require your autoloading script (Composer autoload here) to use namespaces require_once 'vendor/autoload.php'; use StarterKit\Cache\Memcached; // First instanciation : pass your Memcached parameters $mc = Memcached::getInstance('YOUR_SERVER_NAME', 'YOUR_SERVER_PORT'); // Later in your code : you can retrieve your instance at any time, without creating new Memcached connection $res = Memcached::getInstance()->set('yolo', 'swag');
Redis
<?php // Require your autoloading script (Composer autoload here) to use namespaces require_once 'vendor/autoload.php'; use StarterKit\Cache\Redis; // First instanciation : pass your Redis parameters $mc = Redis::getInstance('YOUR_SERVER_NAME', 'YOUR_SERVER_PORT'); // Later in your code : you can retrieve your instance at any time, without creating new Redis connection $res = Redis::getInstance()->set('yolo', 'swag');
统计信息
- 总下载量: 3.05k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-22