ThinkPHP3.x constant sorting (pre-defined constant/path constant/system constant), thinkphp3.x constant _ PHP Tutorial

Source: Internet
Author: User
ThinkPHP3.x constant sorting (pre-defined constant path constant system constant), thinkphp3.x constant. ThinkPHP3.x constant sorting (pre-defined constant path constant system constant), thinkphp3.x constant This article summarizes thinkPHP3.x common constants. For your reference, the thinkPHP3.x constants (pre-defined constants/path constants/system constants) and thinkphp3.x constants

This article summarizes common constants of thinkPHP3.x. We will share this with you for your reference. The details are as follows:

I. predefined constants

URL_COMMON = 0 URL in normal mode
URL_PATHINFO = 1 PATHINFO URL
URL_REWRITE = 2 REWRITE URL
URL_COMPAT = 3 compatible mode URL
HAS_ONE = 1 HAS_ONE join definition
BELONGS_TO = 2 BELONGS_TO Association definition
HAS_MANY = 3 HAS_MANY join definition
MANY_TO_MANY = 4 MANY_TO_MANY Association definition
THINK_VERSION Framework Version

These predefined constants will not change as the environment changes.

2. path constants

The path constants of the system and project are used in the system's default directory specification. you can change them by redefinition. if you do not want to customize directories, these constants do not need to be changed.

CORE_PATH system core class library directory THINK_PATH. 'Lib /'
EXTEND_PATH system extension directory THINK_PATH. 'extend /'
MODE_PATH: extended directory EXTEND_PATH. 'mode /'
ENGINE_PATH Engine extension directory EXTEND_PATH. 'engine /'
VENDOR_PATH third-party class library directory EXTEND_PATH. 'vendor /'
LIBRARY_PATH System Extension class Library directory EXTEND_PATH. 'Library /'
COMMON_PATH project public directory APP_PATH. 'common /'
LIB_PATH project class library directory APP_PATH. 'Lib /'
RUNTIME_PATH directory APP_PATH. 'runtime /'
CONF_PATH project configuration directory APP_PATH. 'conf /'
LOG_PATH project log directory RUNTIME_PATH. 'logs /'
CACHE_PATH project template Cache directory RUNTIME_PATH. 'cache /'
LANG_PATH project language package directory APP_PATH. 'Lang /'
TEMP_PATH project cache directory RUNTIME_PATH. 'temp /'
DATA_PATH project Data directory RUNTIME_PATH. 'data /'
TMPL_PATH project template directory APP_PATH. 'tpl /'
HTML_PATH static cache Directory of the project APP_PATH. 'HTML /'

III. system constants

The following system constants will change with the development environment or settings.

Whether IS_CGI belongs to CGI mode
Is IS_WIN in Windows?
Whether IS_CLI is in command line mode
Website root directory address
/Index. php current project (entry file) address
/Index. php URL of the current group
/Index. php/Article URL of the current module
/Index. php/Article/detail URL of the current operation
/Php-weizijiaocheng-286343.html current URL
_ INFO _ current PATH_INFO string
APP_NAME current project name
GROUP_NAME current group name
MODULE_NAME current module name
ACTION_NAME current operation name
Debug Mode enabled for APP_DEBUG
MODE_NAME current mode name
APP_PATH current project path
THINK_PATH system framework path
MEMORY_LIMIT_ON system memory statistics support
RUNTIME_FILE project compilation cache file name
THEME_NAME current topic name
THEME_PATH path of the current template topic
APP_TMPL_PATH: URL path of the current template
LANG_SET current browser language
MAGIC_QUOTES_GPC

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.