|5.0系统|5.1系统|
|---|---|
| think\App | think\facade\App (或者 App )|
| think\Cache | think\facade\Cache (或者 Cache )|
| think\Config | think\facade\Config (或者 Config )|
| think\Cookie | think\facade\Cookie (或者 Cookie )|
| think\Debug | think\facade\Debug (或者 Debug )|
| think\Env | think\facade\Env (或者 Env )|
| think\Hook | think\facade\Hook (或者 Hook )|
| think\Lang | think\facade\Lang (或者 Lang )|
| think\Log | think\facade\Log (或者 Log )|
| think\Request | think\facade\Request (或者 Request )|
| think\Response | think\facade\Reponse (或者 Reponse )|
| think\Route | think\facade\Route (或者 Route )|
| think\Session | think\facade\Session (或者 Session )|
| think\Url | think\facade\Url (或者 Url )|
| think\View | think\facade\View (或者 View )|举个例子,如果应用类库开头`use`了 `think\Url`use think\Url;
Url::build('index/index');则需要改成use think\facade\Url;
Url::build('index/index');或者use Url;
Url::build('index/index');5.1为系统的类库注册了类库别名,因此可以直接从根命名空间方式调用Url。use think\Route;config('app_debug');等同于config('app.app_debug');一级配置`app`下的配置参数都在`app.php`配置文件中定义。\think\facade\Config::pull('app');原有的配置文件`config.php`按照模块拆分为`app.php`、`cache.php` 等独立配置文件放入`config`目录,系统默认的配置文件清单如下:|配置文件|说明|
|---|---|
|app.php| 应用配置文件|
|cache.php|缓存配置文件|
|cookie.php|Cookie配置文件|
|database.php|数据库配置文件|
|log.php|日志配置文件|
|session.php|Session配置文件|
|template.php|模板引擎配置文件|
|trace.php|页面Trace配置文件|原来的应用`extra`目录下面的配置文件直接移动到`config`目录下面。|5.0常量|5.1获取方法|
|---|---|
|EXT| 取消,固定使用 `.php`|
|IS_WIN|取消|
|IS_CLI|取消|
|ENV_PREFIX|取消,固定使用`PHP_`|
|THINK_START_TIME|App::getBeginTime()|
|THINK_START_MEM|App::getBeginMem()|
|THINK_VERSION| App::version()|
|THINK_PATH|App::getThinkPath()|
|LIB_PATH|App::getThinkPath() . 'library/'|
|CORE_PATH|App::getThinkPath() . 'library/think/'|
|APP_PATH|App::getAppPath()|
|CONFIG_PATH| App::getConfigPath()|
|CONFIG_EXT|App::getConfigExt()|
|ROOT_PATH|App::getRootPath()|
|EXTEND_PATH| App::getRootPath() . 'extend/' |
|VENDOR_PATH| App::getRootPath() . 'vendor/' |
|RUNTIME_PATH|App::getRuntimePath()|
|LOG_PATH| App::getRuntimePath() . 'log/' |
|CACHE_PATH| App::getRuntimePath() . 'cache/' |
|TEMP_PATH| App::getRuntimePath() . 'temp/' |
|MODULE_PATH|App::getModulePath()|另外也可以通过`Env`类的`get`方法获取这些路径变量(不区分大小写),例如:Env::get('root_path');ThinkPHP 是一个免费开源的,快速、简单的面向对象的 轻量级PHP开发框架 ,创立于2006年初,遵循Apache2开源协议发布,是为了敏捷WEB应用开发和简化企业应用开发而诞生的。ThinkPHP从诞生以来一直秉承简洁实用的设计原则,在保持出色的性能和至简的代码的同时,也注重易用性。并且拥有众多的原创功能和特性,在社区团队的积极参与下,在易用性、扩展性和性能方面不断优化和改进,已经成长为国内最领先和最具影响力的WEB应用开发框架,众多的典型案例确保可以稳定用于商业以及门户级的开发。