pompdelux/phpredis-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

pompdelux/phpredis-bundle

Composer 安装命令:

composer require pompdelux/phpredis-bundle

包简介

Adds phpredis to symfony.

README 文档

README

This bundle brings phpredis to your Symfony2 app.

It allows you to easily create multiple clients pointing to different databases and/or servers.

Install:

  1. Add PHPRedisBundleBundle to your dependencies:

     // composer.json
     {
         // ...
         "require": {
             // ...
             "pompdelux/phpredis-bundle": "1.*"
         }
     }
    
  2. Use Composer to download and install the bundle:

     $ php composer.phar update pompdelux/phpredis-bundle
    
  3. Register the bundle in your application:

     // app/AppKernel.php
     class AppKernel extends Kernel
     {
         // ...
         public function registerBundles()
         {
             $bundles = array(
                 // ...
                 new Pompdelux\PHPRedisBundle\PHPRedisBundle(),
             );
         }
     }
    
  4. Add the configuration needed to use the bundle:

     // config.yml
     php_redis:
         class:
             service_name:
                 host:     127.0.0.1
                 port:     6379
                 prefix:   ''
                 database: 0
                 timeout:  0
                 auth:     null
                 skip_env: false
             some_other_service:
                 host:      localhost
                 port:      6379
                 ....
    

Two things to note:

  1. If skip_env is not set to false the environment will be part of the prefix for all keys.
  2. Redis::SERIALIZER_PHP will be used as serializer unless you override it via setOption()

Usage:

$redis = $this->container->get('pdl.phpredis.service_name');
$redis->set('key', 'value');
echo $redis->get('key');

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-06-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固