Commit c2467340 by 王兴勇

修正空值

parent f41316a6
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
* @author Lazy 2017-10-26 * @author Lazy 2017-10-26
*/ */
function faker_login($configs) { function faker_login($configs) {
if (empty($configss))
return false;
is_array($configs) || $configs = explode(',', $configs); is_array($configs) || $configs = explode(',', $configs);
foreach ($configs as $config) { foreach ($configs as $config) {
$_ = strpos($config, '.'); $_ = strpos($config, '.');
...@@ -20,6 +22,7 @@ function faker_login($configs) { ...@@ -20,6 +22,7 @@ function faker_login($configs) {
* @param $config 要获取的配置名称 * @param $config 要获取的配置名称
*/ */
function require_db_config($config) { function require_db_config($config) {
empty($config) && $config = 'local';
$file = format_common_path('db.'.$config); $file = format_common_path('db.'.$config);
file_exists($file) || $file = format_common_path('db.local'); file_exists($file) || $file = format_common_path('db.local');
$config = require $file; $config = require $file;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment