选择语言 :

Bootstrap

Bootstrap

API - Bootstrap

author
呼吸二氧化碳 jonwang@myqee.com
category
Core
copyright
Copyright © 2008-2013 myqee.com
license
http://www.myqee.com/license.html

Bootstrap::setup( $auto_execute = true)

系统初始化

参数列表

参数 类型 描述 默认值
$auto_execute boolean 是否自动运行控制器 bool true

Bootstrap::auto_load( $class_name )

自动加载类

参数列表

参数 类型 描述 默认值
$class_name string $class_name
返回值
  • boolean

Bootstrap::include_path( )

获取包含目录,返回一个一维的数组

注意 Bootstrap::$include_path 为一个二维数组
返回值
  • array

Bootstrap::find_file( $dir , $file , $ext = null, $auto_require = false)

查找文件

 // 查找类文件路径
 $file = Bootstrap::find_file('classes', 'Database');

 // 查找一个视图文件
 $file = Bootstrap::find_file('views', 'test');

 // 查找一个自定义文件,注意第3个参数设置空表示后缀在文件名中
 $file = Bootstrap::find_file('assets', 'test.css', '');
 // 等价于
 $file = Bootstrap::find_file('assets', 'test', '.css');

参数列表

参数 类型 描述 默认值
$dir string 目录
$file string 文件
$ext string 后缀 例如:.html,不指定(null)的话则自动设置后缀 null
$auto_require boolean 是否自动加载上来,对config,i18n无效 bool false
返回值
  • string

Bootstrap::import_library( $library_name )

导入指定类库 支持多个,当一次导入多个时,从数组最后一个开始导入

导入的格式必须是类似 com.a.b 的形式,否则会抛出异常,例如: com.myqee.test

 Bootstrap::import_library('com.myqee.test');
 Bootstrap::import_library(array('com.myqee.test','com.myqee.cms'));

参数列表

参数 类型 描述 默认值
$library_name string|array 指定类库 支持多个
返回值
  • num 返回新加载的类库总数

Bootstrap::_add_include_path_lib( $lib )

加入include_path类库

参数列表

参数 类型 描述 默认值
$lib string $lib
返回值
  • array `array($ns, $dir, $is_already_loaded)`

Bootstrap::get_debug_hash( $username , $password )

根据用户名和密码获取一个hash

参数列表

参数 类型 描述 默认值
$username string $username
$password string $password
返回值
  • string

Bootstrap::protocol( )

返回协议类型

当在命令行里执行,则返回null

返回值
  • string `null` | `http://` | `https://`

Bootstrap::reload_all_libraries( )

重新加载类库


Bootstrap::get_config_file_by_path( )


Bootstrap::setup_by_url( )

根据URL初始化


Bootstrap::_show_error( $msg )

抛出系统启动时错误信息

参数列表

参数 类型 描述 默认值
$msg string $msg

Bootstrap::_is_online_debug( )

判断是否开启了在线调试

返回值
  • boolean

Bootstrap::_get_pathinfo( )

获取path_info

返回值
  • string