Skip to content

Commit

Permalink
把strategy文件夹名恢复成adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
cmpan committed Sep 7, 2017
1 parent 39e193a commit 4249140
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ $dbCfgs = [
'debug' => 0,
'class' => 'PDOMySQL', // MySQLi|PDOMySQL
];
$class = "\\wf\\db\\strategy\\{$dbCfg['class']}";
$class = "\\wf\\db\\adapter\\{$dbCfg['class']}";
$db = new $class($dbCfgs);
// 获取所有记录
Expand Down Expand Up @@ -167,7 +167,7 @@ try {
return [
// 主数据库
'default' => [
'class' => '\\wf\\db\\strategy\\PDOMySQL', // MySQLi/PDOMySQL
'class' => '\\wf\\db\\adapter\\PDOMySQL', // MySQLi/PDOMySQL
'host' => '127.0.0.1', // 本机测试
'port' => '3306', // 数据库服务器端口
'name' => 'windworkdb', // 数据库名
Expand All @@ -181,7 +181,7 @@ return [
/*
'slave' => array(
// 数据库设置
'class' => '\\wf\\db\\strategy\\PDOMySQL',
'class' => '\\wf\\db\\adapter\\PDOMySQL',
'host' => '127.0.0.1', // 本机测试
'port' => '3306', // 数据库服务器端口
'name' => 'windworkdb', // 数据库名
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "windwork/db",
"description" : "windwork db component.Windwork MySQL数据库访问组件",
"version" : "0.6.0",
"version" : "0.7.0",
"time" : "2017-06-26 17:30:00",
"require" : {
"php" : ">=5.5.0",
Expand Down
4 changes: 2 additions & 2 deletions lib/strategy/MySQLi.php → lib/adapter/MySQLi.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
* @copyright Copyright (c) 2008-2017 Windwork Team. (http://www.windwork.org)
* @license http://opensource.org/licenses/MIT
*/
namespace wf\db\strategy;
namespace wf\db\adapter;

/**
* 使用 PDO扩展对MySQL数据库进行操作
* 如果是自己写sql语句的时候,请不要忘了防注入,只是在您不输入sql的情况下帮您过滤MySQL注入了
*
* @package wf.db.strategy
* @package wf.db.adapter
* @author cm <cmpan@qq.com>
* @link http://docs.windwork.org/manual/wf.db.html
* @since 0.1.0
Expand Down
4 changes: 2 additions & 2 deletions lib/strategy/PDOMySQL.php → lib/adapter/PDOMySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
* @copyright Copyright (c) 2008-2017 Windwork Team. (http://www.windwork.org)
* @license http://opensource.org/licenses/MIT
*/
namespace wf\db\strategy;
namespace wf\db\adapter;

/**
* 使用 PDO扩展对MySQL数据库进行操作
* 如果是自己写sql语句的时候,请不要忘了防注入,只是在您不输入sql的情况下帮您过滤MySQL注入了
*
* @package wf.db.strategy
* @package wf.db.adapter
* @author cm <cmpan@qq.com>
* @link http://docs.windwork.org/manual/wf.db.html
* @since 0.1.0
Expand Down
6 changes: 3 additions & 3 deletions test/MySQLiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
require_once __DIR__ . '/../lib/DBAbstract.php';
require_once __DIR__ . '/../lib/Exception.php';
require_once __DIR__ . '/../lib/QueryBuilder.php';
require_once __DIR__ . '/../lib/strategy/MySQLi.php';
require_once __DIR__ . '/../lib/adapter/MySQLi.php';

use wf\db\QueryBuilder;

Expand All @@ -32,7 +32,7 @@ protected function setUp()
$cfg = array(
//
'default' => array(
'class' => '\\wf\\db\\strategy\\MySQLi', // MySQLi|PDOMySQL
'class' => '\\wf\\db\\adapter\\MySQLi', // MySQLi|PDOMySQL
'host' => '127.0.0.1', // 本机测试
'port' => '3306', // 数据库服务器端口
'name' => 'test', // 数据库名
Expand All @@ -43,7 +43,7 @@ protected function setUp()
),
// 可主从分离
'slave' => array(
'class' => '\\wf\\db\\strategy\\MySQLi', // MySQLi|PDOMySQL
'class' => '\\wf\\db\\adapter\\MySQLi', // MySQLi|PDOMySQL
'host' => '127.0.0.1', // 本机测试
'port' => '3306', // 数据库服务器端口
'name' => 'test', // 数据库名
Expand Down
8 changes: 4 additions & 4 deletions test/PDOMySQLTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
require_once __DIR__ . '/../lib/DBAbstract.php';
require_once __DIR__ . '/../lib/Exception.php';
require_once __DIR__ . '/../lib/QueryBuilder.php';
require_once __DIR__ . '/../lib/strategy/PDOMySQL.php';
require_once __DIR__ . '/../lib/adapter/PDOMySQL.php';

use \wf\db\strategy\PDOMySQL;
use \wf\db\adapter\PDOMySQL;

/**
* PDOMySQL test case.
Expand All @@ -32,7 +32,7 @@ protected function setUp()
$cfg = array(
//
'default' => array(
'class' => '\\wf\\db\\strategy\\PDOMySQL', // MySQLi|PDOMySQL
'class' => '\\wf\\db\\adapter\\PDOMySQL', // MySQLi|PDOMySQL
'host' => '127.0.0.1', // 本机测试
'port' => '3306', // 数据库服务器端口
'name' => 'test', // 数据库名
Expand All @@ -43,7 +43,7 @@ protected function setUp()
),
// 可主从分离
'slave' => array(
'class' => '\\wf\\db\\strategy\\PDOMySQL', // MySQLi|PDOMySQL
'class' => '\\wf\\db\\adapter\\PDOMySQL', // MySQLi|PDOMySQL
'host' => '127.0.0.1', // 本机测试
'port' => '3306', //=>
'name' => 'test', // 数据库名
Expand Down

0 comments on commit 4249140

Please sign in to comment.