承接 leapt/cache-bundle 相关项目开发

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

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

leapt/cache-bundle

最新稳定版本:v2.0.1

Composer 安装命令:

composer require leapt/cache-bundle

包简介

Symfony LeaptCacheBundle

关键字:

README 文档

README

Note: this bundle is not maintained anymore, consider using symfony/cache directly.

Introduction

This bundle is used to provide access to cache drivers.

This is a work in progress with two drivers: Memcached and APC.

Installation

  1. Add this bundle to your vendor/ dir:

    Add the following line in your composer.json file:

     "leapt/cache-bundle": "~1.0",
    

    Run composer:

     composer update leapt/cache-bundle
    
  2. Add this bundle to your application's kernel:

     // app/ApplicationKernel.php
     public function registerBundles()
     {
         return array(
             // ...
             new Leapt\CacheBundle\LeaptCacheBundle(),
             // ...
         );
     }
    
  3. Add the configuration in your config.yml file

     leapt_cache:
         namespace: yournamespace
         caches:
             tweets:
                 type: memcached
                 options:
                     server: localhost
                     port: 11211
                     ttl: 86400
             flickr:
                 type: memcached
                 options:
                     server: localhost
                     port: 11211
                     ttl: 45632
    

Usage

    $cacheManager = $this->get('leapt_cache.manager');

    $cache = $cacheManager->getCache('tweets');

    if ($cache->isEnabled()) {
        if (false === $tweets = $cache->get('tweets')) {
            $tweets = $this->getTweets();
            $cache->set('tweets', $tweets);
        }
    } else {
        $tweets = $this->getTweets();
    }

Running the tests

Before running the tests, you will need to install the bundle dependencies. Do it using composer :

curl -s http://getcomposer.org/installer | php
php composer.phar --dev install

Then you can simply launch phpunit

phpunit

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-28