THINKPHP3.2 constant Reference

Source: Internet
Author: User

Original: ThinkPHP3.2 constant reference

Pre-defined constants

Predefined constants are defined constants that are built into the system and do not change as the environment changes, including:

  1. URL_COMMON 普通模式 URL (0)
  2. URL_PATHINFO PATHINFO URL (1)
  3. URL_REWRITE REWRITE URL (2)
  4. URL_COMPAT 兼容模式 URL (3)
  5. EXT 类库文件后缀(.class.php)
  6. THINK_VERSION 框架版本号
Copy Code Path constants

System and application path constants are used for the system's default directory specification, and can be redefined by redefining changes, which generally do not need to be changed if you do not want to customize the catalog.

  1. THINK_PATH 框架系统目录
  2. APP_PATH 应用目录(默认为入口文件所在目录)
  3. LIB_PATH 系统类库目录(默认为 THINK_PATH.‘Library/‘)
  4. CORE_PATH 系统核心类库目录 (默认为 LIB_PATH.‘Think/‘)
  5. MODE_PATH 系统应用模式目录 (默认为 THINK_PATH.‘Mode/‘)
  6. BEHAVIOR_PATH 行为目录 (默认为 LIB_PATH.‘Behavior/‘)
  7. COMMON_PATH 公共模块目录 (默认为 APP_PATH.‘Common/‘)
  8. VENDOR_PATH 第三方类库目录(默认为 LIB_PATH.‘Vendor/‘)
  9. RUNTIME_PATH 应用运行时目录(默认为 APP_PATH.‘Runtime/‘)
  10. HTML_PATH 应用静态缓存目录(默认为 APP_PATH.‘Html/‘)
  11. CONF_PATH 应用公共配置目录(默认为 COMMON_PATH.‘Conf/‘)
  12. LANG_PATH 公共语言包目录 (默认为 COMMON_PATH.‘Lang/‘)
  13. LOG_PATH 应用日志目录 (默认为 RUNTIME_PATH.‘Logs/‘)
  14. CACHE_PATH 项目模板缓存目录(默认为 RUNTIME_PATH.‘Cache/‘)
  15. TEMP_PATH 应用缓存目录(默认为 RUNTIME_PATH.‘Temp/‘)
  16. DATA_PATH 应用数据目录 (默认为 RUNTIME_PATH.‘Data/‘)
System constants

System constants change as the development environment changes or settings change.

  1. IS_CGI 是否属于 CGI模式
  2. IS_WIN 是否属于Windows 环境
  3. IS_CLI 是否属于命令行模式
  4. __ROOT__ 网站根目录地址
  5. __APP__ 当前应用(入口文件)地址
  6. __MODULE__ 当前模块的URL地址
  7. __CONTROLLER__ 当前控制器的URL地址
  8. __ACTION__ 当前操作的URL地址
  9. __SELF__ 当前URL地址
  10. __INFO__ 当前的PATH_INFO字符串
  11. __EXT__ 当前URL地址的扩展名
  12. MODULE_NAME 当前模块名
  13. MODULE_PATH 当前模块路径
  14. CONTROLLER_NAME 当前控制器名
  15. ACTION_NAME 当前操作名
  16. APP_DEBUG 是否开启调试模式
  17. APP_MODE 当前应用模式名称
  18. APP_STATUS 当前应用状态
  19. STORAGE_TYPE 当前存储类型
  20. MODULE_PATHINFO_DEPR 模块的PATHINFO分割符
  21. MEMORY_LIMIT_ON 系统内存统计支持
  22. RUNTIME_FILE 项目编译缓存文件名
  23. THEME_NAME 当前主题名称
  24. THEME_PATH 当前模板主题路径
  25. LANG_SET 当前浏览器语言
  26. MAGIC_QUOTES_GPC MAGIC_QUOTES_GPC
  27. NOW_TIME 当前请求时间(时间戳)
  28. REQUEST_METHOD 当前请求类型
  29. IS_GET 当前是否GET请求
  30. IS_POST 当前是否POST请求
  31. IS_PUT 当前是否PUT请求
  32. IS_DELETE 当前是否DELETE请求
  33. IS_AJAX 当前是否AJAX请求
  34. BIND_MODULE 当前绑定的模块(3.2.1新增)
  35. BIND_CONTROLLER 当前绑定的控制器(3.2.1新增)
  36. BIND_ACTION 当前绑定的操作(3.2.1新增)
  37. CONF_EXT 配置文件后缀(3.2.2新增)
  38. CONF_PARSE 配置文件解析方法(3.2.2新增)
  39. TMPL_PATH 用于改变全局视图目录(3.2.3新增)

THINKPHP3.2 constant Reference

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.