承接 rollerworks/cache 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rollerworks/cache

最新稳定版本:v1.2.0

Composer 安装命令:

composer require rollerworks/cache

包简介

Rollerworks Cache Component

README 文档

README

SensioLabsInsight Build Status

The Rollerworks Cache component provides a Session based cache-driver for Doctrine Common. (Cache data is stored in a session).

Installation

This Component uses Composer to manage its dependencies.

If you don't have Composer yet, download it following the instructions on http://getcomposer.org/ or just run the following command:

curl -s http://getcomposer.org/installer | php

Then add the following to your composer.json file:

// composer.json
{
    // ...
    require: {
        // ...
        "rollerworks/cache": "~1.0"
    }
}

Then, you can install the new dependencies by running Composer's update command from the directory where your composer.json file is located:

$ php composer.phar update rollerworks/cache

Now, Composer will automatically download all required files, and install them for you.

That's it! You can now use the Rollerworks Cache Component.

Usage

This component depends on the Symfony HttpFoundation Component and Doctrine Common. Usage is very simple.

use Symfony\Component\HttpFoundation\Session\Session;
use Rollerworks\Component\Cache\SessionCache;

$session = new Session();
$session->start();

// ...

// The first parameter of the SessionCache must be a `Symfony\Component\HttpFoundation\Session\Session` object.
// The second parameter is an optional session storageKey that used for storing the session, default is '_rollerworks_cache'.
// The third parameter is an optional SessionCacheBag object

// When a SessionCacheBag is provided, it must be registered at the session by calling registerBag() on the $session object.
$sessionCacheDriver = new SessionCache($session, '_my_cache');

// Now you can use the $sessionCacheDriver object for any Doctrine Caching.
// See the resources below for more information.

Resources

Doctrine Caching http://docs.doctrine-project.org/en/2.0.x/reference/caching.html

This Component is released under MIT license.

You can run the unit tests with the following command:

phpunit

统计信息

  • 总下载量: 2.1k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-11-14