工单分类
This commit is contained in:
@@ -2,3 +2,25 @@
|
||||
/**
|
||||
* Here is your custom functions.
|
||||
*/
|
||||
|
||||
use support\exception\BusinessException;
|
||||
|
||||
/**
|
||||
* 获取配置
|
||||
*/
|
||||
function getConfig($filePath = null)
|
||||
{
|
||||
// 构建文件路径
|
||||
$config_file = app_path($filePath);
|
||||
// 检查文件是否存在
|
||||
if (!file_exists($config_file)) {
|
||||
return [];
|
||||
}
|
||||
// 包含文件并获取返回的数组
|
||||
$config = include $config_file;
|
||||
// 验证是否为数组
|
||||
if (!is_array($config)) {
|
||||
return [];
|
||||
}
|
||||
return $config;
|
||||
}
|
||||
Reference in New Issue
Block a user