[李景山php]每天laravel-20160922|RedisServicProvider.php
2016-07-23 08:11
579 查看
<?php namespace Illuminate\Redis; use Illuminate\Support\ServiceProvider; // this namespace class RedisServiceProvider extends ServiceProvider { /** * Indicates if loading of the provider is deferred. * * @var bool */ protected $defer = true;// a instance of Service Provider // a Redis Service Provider // Indicates if loading of the provider is deferred. /** * Register the service provider. * * @return void */ public function register() { $this->app->singleton('redis', function ($app) { return new Database($app['config']['database.redis']); }); }//Register the service provider // a good redis register // one parameter is redis // other is a Database class /** * Get the services provided by the provider. * * @return array */ public function provides() { return ['redis']; }// a big redis //Get the services provided by the provider }
本文出自 “专注php” 博客,请务必保留此出处http://jingshanls.blog.51cto.com/3357095/1829002
相关文章推荐
- [李景山php]每天laravel-20160922|RedisServicProvider.php
- Redis集群搭建
- redis配置安装和使用
- 【学习笔记】Redis(2)-数据对象
- session入redis
- LINUX下安装Redis
- PHP 使用 Redis
- 初识Redis
- 新的管理门户 ibiza 中管理azure redis
- 1. 使用azure powershell 管理azure redis
- linux安装redis以及php操作redis
- redis 数据类型详解 以及 redis适用场景场合
- Redis 复制原理及分析
- redisson的理解和使用-调用流程
- redis介绍以及安装
- redis中关于config get、config set与config rewrite
- linux下redis的安装与使用
- linux & windows 安装redis
- 负载均衡的常用算法
- nginx + lua + redis 防刷和限流