选择语言 :

 Bootstrap::reload_all_libraries

重新加载类库

null Bootstrap::reload_all_libraries( )
File: ./core/bootstrap.php
protected static function reload_all_libraries()
{
    # 加载类库
    $lib_config = self::$core_config['libraries'];

    # 重置
    self::$include_path['library'] = array();

    foreach (array('autoload', 'cli', 'admin', 'debug', 'rest') as $type)
    {
        if (!isset($lib_config[$type]) || !$lib_config[$type])continue;

        if ($type=='cli')
        {
            if (!IS_DEBUG)continue;
        }
        else if ($type=='admin')
        {
            if (!IS_ADMIN_MODE)continue;
        }
        else if ($type=='rest')
        {
            if (!IS_REST_MODE)continue;
        }
        else if ($type=='debug')
        {
            if (!IS_DEBUG)continue;
        }

        $libs = array_reverse((array)$lib_config[$type]);
        foreach ($libs as $lib)
        {
            self::_add_include_path_lib($lib);
        }
    }

    # 处理 library 的config
    $config_files = array();

    self::get_config_file_by_path($config_files, self::$include_path['project'],      true );
    self::get_config_file_by_path($config_files, self::$include_path['team-library'], true );
    self::get_config_file_by_path($config_files, self::$include_path['library'],      false);
    self::get_config_file_by_path($config_files, self::$include_path['core'],         false);

    if ($config_files)
    {
        # 反向排序,从最后一个开始导入
        $config_files = array_reverse($config_files);

        # 导入config
        self::$config = self::$core_config;

        # 移除特殊的key
        unset(self::$config['core']);
        unset(self::$config['projects']);

        # 载入config
        __include_config_file(self::$config, $config_files);
    }
}