修正几处Notice错误

This commit is contained in:
huangdijia
2015-12-22 11:59:02 +08:00
parent 0e6afef0be
commit 5b75506aa7
3 changed files with 5 additions and 5 deletions

View File

@@ -303,7 +303,7 @@ class App
// 路由检测
if (!empty($config['url_route_on'])) {
// 开启路由 则检测路由配置
Route::register($config['route']);
Route::register(!empty($config['route'])?$config['route']:null);
$result = Route::check($path_info, $depr);
if (false === $result) {
// 路由无效

View File

@@ -1148,7 +1148,7 @@ abstract class Driver
*/
protected function debug($start)
{
if ($this->config['debug']) {
if (!empty($this->config['debug'])) {
// 开启数据库调试模式
if ($start) {
Debug::remark('queryStartTime', 'time');

View File

@@ -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']}" : '');
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) {
throw new Exception($e->getmessage());
}
@@ -105,7 +105,7 @@ class Mongo extends Driver
$this->_mongo = $this->_linkID->selectDb($db);
}
// 当前MongoCollection对象
if ($this->config['debug']) {
if (!empty($this->config['debug'])) {
$this->queryStr = $this->_dbName . '.getCollection(' . $collection . ')';
}
if ($this->_collectionName != $collection) {
@@ -519,7 +519,7 @@ class Mongo extends Driver
$this->model = $options['model'];
$this->queryTimes++;
$query = $this->parseWhere($options['where']);
if ($this->config['debug']) {
if (!empty($this->config['debug'])) {
$this->queryStr = $this->_dbName . '.' . $this->_collectionName;
$this->queryStr .= $query ? '.find(' . json_encode($query) . ')' : '';
$this->queryStr .= '.count()';