public
static
function
import_library(
$library_name
)
{
if
(!
$library_name
)
return
false;
$library_name
= (
array
)
$library_name
;
# 反向排序,从最后一个开始导入
$library_name
=
array_reverse
(
$library_name
);
$config_files
=
array
();
$load_num
= 0;
foreach
(
$library_name
as
$lib
)
{
$set
= self::_add_include_path_lib(
$lib
);
if
(true===
$set
[2])
{
# 已加载过
continue
;
}
$config_file
=
$set
[1] .
'config'
. EXT;
if
(
is_file
(
$config_file
))
{
$config_files
[] =
$config_file
;
}
$load_num
++;
if
(IS_DEBUG &&
class_exists
(
'Core'
, false) &&
class_exists
(
'Debug'
, false))Core::debug()->info(
'import a new library: '
.Core::debug_path(
$lib
));
}
if
(
$config_files
)
{
__include_config_file(self::
$config
,
$config_files
);
}
return
$load_num
;
}