bootstrap一般为index.php直接加载,通常位于system(core、libraries)中,kohana中bootstrap在application(modules、projects)中。



spl_autoload_register(Bootstrap::auto_load)



abstract class Bootstrap {

public $base_url;

public $path_info;

public $current_project;

public $project_dir;





//启动函数

public static function setup() {



}



//class自动加载函数

public static function auto_load($class) {



}



//获取path_info函数

public static function get_path_info() {



}



public static function set_project($project) {

define(INITIAL_PROJECT, $project);

self::$project = $project;

self::$project_dir = DIR_LIB. $project. DIRECTORY_SEPARATOR;







}



}





通过获取pathinfo和系统中现有projects继续比较,获取当前project并更新pathinfo,set_projects,设置当前project, 设定$project_config, 同时加载core核心,设定projects,加载$include_dir。等相关信息。调用Core的setup()