mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 07:12:47 +08:00
修正几处Notice错误
This commit is contained in:
@@ -303,7 +303,7 @@ class App
|
|||||||
// 路由检测
|
// 路由检测
|
||||||
if (!empty($config['url_route_on'])) {
|
if (!empty($config['url_route_on'])) {
|
||||||
// 开启路由 则检测路由配置
|
// 开启路由 则检测路由配置
|
||||||
Route::register($config['route']);
|
Route::register(!empty($config['route'])?$config['route']:null);
|
||||||
$result = Route::check($path_info, $depr);
|
$result = Route::check($path_info, $depr);
|
||||||
if (false === $result) {
|
if (false === $result) {
|
||||||
// 路由无效
|
// 路由无效
|
||||||
|
|||||||
@@ -1148,7 +1148,7 @@ abstract class Driver
|
|||||||
*/
|
*/
|
||||||
protected function debug($start)
|
protected function debug($start)
|
||||||
{
|
{
|
||||||
if ($this->config['debug']) {
|
if (!empty($this->config['debug'])) {
|
||||||
// 开启数据库调试模式
|
// 开启数据库调试模式
|
||||||
if ($start) {
|
if ($start) {
|
||||||
Debug::remark('queryStartTime', 'time');
|
Debug::remark('queryStartTime', 'time');
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ class Mongo extends Driver
|
|||||||
|
|
||||||
$host = 'mongodb://' . ($config['username'] ? "{$config['username']}" : '') . ($config['password'] ? ":{$config['password']}@" : '') . $config['hostname'] . ($config['hostport'] ? ":{$config['hostport']}" : '') . '/' . ($config['database'] ? "{$config['database']}" : '');
|
$host = 'mongodb://' . ($config['username'] ? "{$config['username']}" : '') . ($config['password'] ? ":{$config['password']}@" : '') . $config['hostname'] . ($config['hostport'] ? ":{$config['hostport']}" : '') . '/' . ($config['database'] ? "{$config['database']}" : '');
|
||||||
try {
|
try {
|
||||||
$this->linkID[$linkNum] = new \mongoClient($host, $this->config['params']);
|
$this->linkID[$linkNum] = new \mongoClient($host, !empty($this->config['params'])?$this->config['params']:array());
|
||||||
} catch (\MongoConnectionException $e) {
|
} catch (\MongoConnectionException $e) {
|
||||||
throw new Exception($e->getmessage());
|
throw new Exception($e->getmessage());
|
||||||
}
|
}
|
||||||
@@ -105,7 +105,7 @@ class Mongo extends Driver
|
|||||||
$this->_mongo = $this->_linkID->selectDb($db);
|
$this->_mongo = $this->_linkID->selectDb($db);
|
||||||
}
|
}
|
||||||
// 当前MongoCollection对象
|
// 当前MongoCollection对象
|
||||||
if ($this->config['debug']) {
|
if (!empty($this->config['debug'])) {
|
||||||
$this->queryStr = $this->_dbName . '.getCollection(' . $collection . ')';
|
$this->queryStr = $this->_dbName . '.getCollection(' . $collection . ')';
|
||||||
}
|
}
|
||||||
if ($this->_collectionName != $collection) {
|
if ($this->_collectionName != $collection) {
|
||||||
@@ -519,7 +519,7 @@ class Mongo extends Driver
|
|||||||
$this->model = $options['model'];
|
$this->model = $options['model'];
|
||||||
$this->queryTimes++;
|
$this->queryTimes++;
|
||||||
$query = $this->parseWhere($options['where']);
|
$query = $this->parseWhere($options['where']);
|
||||||
if ($this->config['debug']) {
|
if (!empty($this->config['debug'])) {
|
||||||
$this->queryStr = $this->_dbName . '.' . $this->_collectionName;
|
$this->queryStr = $this->_dbName . '.' . $this->_collectionName;
|
||||||
$this->queryStr .= $query ? '.find(' . json_encode($query) . ')' : '';
|
$this->queryStr .= $query ? '.find(' . json_encode($query) . ')' : '';
|
||||||
$this->queryStr .= '.count()';
|
$this->queryStr .= '.count()';
|
||||||
|
|||||||
Reference in New Issue
Block a user