This article mainly introduces ThinkPHP system constants and predefined constants. if you need them, refer to ThinkPHP.
The 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 // name of the current module
ACTION_NAME // Current operation name
TMPL_PATH // project template directory
LIB_PATH // Directory of the project class library
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 // temporary project file directory
PLUGIN_PATH // Directory of the project plug-in file
VENDOR_PATH // third-party Class 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 the Windows environment
IS_LINUX // whether it belongs to the Linux environment
IS_FREEBSD // whether it belongs to the FreeBsd environment
NOW_TIME // Current timestamp
MEMORY_LIMIT_ON // whether the memory usage limit exists
MEMORY_LIMIT_ON // whether the memory usage limit exists
OUTPUT_GZIP_ON // whether to enable output compression
MAGIC_QUOTES_GPC // MAGIC_QUOTES_GPC
THINK_VERSION // ThinkPHP version
LANG_SET // browser language
TEMPLATE_NAME // name of the current template
TEMPLATE_PATH // Current template path
// Website root directory address
/Index. php // address of the current project (entry file)
/Index. php/Article // address of the current module
/Index. php/Article/detail // Current operation address
/Php-weizijiaocheng-56440.html // Current URL
TMPL_FILE_NAME // Default Template name (including path) for the current operation)
WEB_PUBLIC_URL // public website 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 // log recorded in the system mode
MAIL_LOG = 1 // mail method log
TCP_LOG = 2 // log recorded in TCP mode
FILE_LOG = 3 // log recorded by file
DATA_TYPE_OBJ = 1 // returns an object
DATA_TYPE_ARRAY = 0 // returns an array
URL_COMMON = 0 // URL in normal mode
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_attributes = 3 // has_attributes Association definition
Many_to_detail = 4 // many_to_detail Association definition
EXISTS_TO_VAILIDATE = 0 // validate if a field exists in the form
MUST_TO_VALIDATE = 1 // verification required
VALUE_TO_VAILIDATE = 2 // verify if the form value is not empty