Skip to content

Commit

Permalink
Redis获取不同的实例,Master实例以及多个Slave实例
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinywan committed Oct 29, 2016
1 parent e1d7bb5 commit 7c7e7f4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
1 change: 1 addition & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions Backend/Home/Controller/DataBaseController.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,11 @@
class DataBaseController extends Controller
{
public function index(){
//根据当前控制器名来判断要执行那个城市的操作
$cityName = CONTROLLER_NAME;
$this->show($cityName);

}
//注意 city方法 本身是 protected 方法

public function show($name){
//和$name这个城市相关的处理
$this->name = $name;
$this->display('Index/show');

}

/**
Expand Down
2 changes: 0 additions & 2 deletions ThinkPHP/Library/Org/Util/RedisInstance.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ public static function getInstance()
{
if (!(static::$_instance instanceof \Redis)) {
static::$_instance = new \Redis();
self::getInstance()->connect('121.41.88.209', '63789');
self::getInstance()->auth('tinywanredis');
}
return static::$_instance;
}
Expand Down

0 comments on commit 7c7e7f4

Please sign in to comment.