Home >Backend Development >PHP Tutorial >System constants and predefined constant collections in ThinkPHP_PHP tutorial

System constants and predefined constant collections in ThinkPHP_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:26:30780browse

ThinkPHP system constants and predefined constants are summarized as follows:

1. System constants:

THINK_PATH // ThinkPHP system directory:
APP_PATH // Current project directory
APP_NAME // Current project name
MODULE_NAME //Current module name
ACTION_NAME // Current operation name
TMPL_PATH // Project template directory
LIB_PATH //Project class library directory
CACHE_PATH // Project template cache directory
CONFIG_PATH //Project configuration file directory
LOG_PATH //Project log file directory
LANG_PATH //Project language file directory
TEMP_PATH //Project temporary file directory
PLUGIN_PATH // Project plug-in file directory
VENDOR_PATH // Third-party library directory
DATA_PATH //Project data file directory
IS_APACHE // Whether it belongs to Apache
IS_IIS //Whether it belongs to IIS
IS_WIN //Whether it belongs to Windows environment
IS_LINUX //Whether it belongs to Linux environment
IS_FREEBSD //Whether it belongs to FreeBsd environment
NOW_TIME // Current timestamp
MEMORY_LIMIT_ON // Is there a memory usage limit
MEMORY_LIMIT_ON // Is there a memory usage limit
OUTPUT_GZIP_ON //Whether to enable output compression
MAGIC_QUOTES_GPC // MAGIC_QUOTES_GPC
THINK_VERSION //ThinkPHP version number
LANG_SET // Browser language
TEMPLATE_NAME //Current template name
TEMPLATE_PATH //Current template path
__ROOT__ // Website root directory address
__APP__ // Current project (entry file) address
__URL__ // Current module address
__ACTION__ // Current operation address
__SELF__ // Current URL address
TMPL_FILE_NAME //The default template name of the current operation (including path)
WEB_PUBLIC_URL //Website public directory
APP_PUBLIC_URL //Project public template directory

2. Predefined constants:

WEB_LOG_ERROR=0 // Error log type
WEB_LOG_DEBUG=1 // Debug log type
SQL_LOG_DEBUG=2 // SQL log type
SYSTEM_LOG=0 // System mode recording log
MAIL_LOG=1 // Record log by email
TCP_LOG=2 // TCP mode logging
FILE_LOG=3 // Record log in file mode
DATA_TYPE_OBJ=1 //Return in object mode
DATA_TYPE_ARRAY=0 // Return in array mode
URL_COMMON=0 // Normal mode URL
URL_PATHINFO=1 // PATHINFO URL
URL_REWRITE=2 // REWRITE URL
HAS_ONE=1 // HAS_ONE association definition
BELONGS_TO=2 // BELONGS_TO association definition
HAS_MANY=3 // HAS_MANY association definition
MANY_TO_MANY=4 // MANY_TO_MANY association definition
EXISTS_TO_VAILIDATE = 0 // Validate if fields exist in the form
MUST_TO_VALIDATE = 1 // Must verify
VALUE_TO_VAILIDATE = 2 // Validate if the form value is not empty

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/824677.htmlTechArticleThinkPHP system constants and predefined constants are summarized as follows: 1. System constants: THINK_PATH // ThinkPHP system directory: APP_PATH / / Current project directory APP_NAME // Current project name MODULE_N...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn