Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
namespace TargetLiu\PHPRedis;

use Illuminate\Support\Arr;
use Illuminate\Contracts\Redis\Database as DatabaseContract;

class Database
class Database implements DatabaseContract
{
/**
* The host address of the database.
Expand Down
24 changes: 24 additions & 0 deletions src/PHPRedis.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
namespace TargetLiu\PHPRedis;

use Illuminate\Support\Facades\Facade;

/**
*
*
* User: jileilei
* Date: 2016/10/21
* Time: 下午5:24
*/
class PHPRedis extends Facade
{
/**
* Get the registered name of the component.
*
* @return string
*/
protected static function getFacadeAccessor()
{
return 'phpredis';
}
}
1 change: 1 addition & 0 deletions src/PHPRedisServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class PHPRedisServiceProvider extends ServiceProvider
*/
public function register()
{
class_alias('TargetLiu\PHPRedis\PHPRedis', 'PHPRedis');
$this->app->singleton('phpredis', function ($app) {
$app->configure('database');
return new Database($app->config['database.redis']);
Expand Down