System constants and predefined constants in ThinkPHP _ php instances

Source: Internet
Author: User
This article mainly introduces ThinkPHP system constants and predefined constants. If you need them, you can refer to the ThinkPHP system constants and predefined constants 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-142626.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

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.