Thinkphp System Constants

Source: Internet
Author: User

Pre-defined constants
Constants Description
Url_common=0 Normal Mode URL
Url_pathinfo=1 PATHINFO URL
url_rewrite=2 REWRITE URL
Url_compat=3 Compatibility Mode URL
Has_one=1 Has_one Association Definitions
belongs_to=2 BELONGS_TO Association Definitions
Has_many=3 Has_many Association Definitions
Many_to_many=4 Many_to_many Association Definitions
Think_version Frame version number

These pre-defined constants do not change as the environment changes.

Path constants

System and project 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.

constant Name Description Default Value
Core_path System Core Class Library Directory Think_path. ' lib/'
Extend_path System Extensions Directory Think_path. ' Extend/'
Mode_path Pattern Extensions Directory Extend_path. ' mode/'
Engine_path Engine Extensions Directory Extend_path. ' engine/'
Vendor_path Third-party class library catalogs 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 Catalog App_path. ' lib/'
Runtime_path Project Run-time catalog 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 Pack Directory App_path. ' lang/'
Temp_path Project Cache Directory Runtime_path. ' temp/'
Data_path Project Data Catalog Runtime_path. ' data/'
Tmpl_path Project Template Catalog App_path. ' tpl/'
Html_path Project Static Cache Directory App_path. ' Html/'
System constants

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

constant Name Description
is_cgi Whether it belongs to CGI mode
Is_win Whether it belongs to a Windows environment
Is_cli Whether it belongs to the command line mode
__root__ Site root directory Address
__app__ Current project (entry file) address
__group__ The URL address of the current group
__url__ The URL address of the current module
__action__ The URL address of the current action
__self__ Current URL Address
__info__ The current Path_info string
App_name Current project Name
Group_name Current group name
Module_name Current module Name
Action_name Current operation name
App_debug Whether to turn on debug mode
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 Current Template Theme Path
App_tmpl_path Current Template URL Path
Lang_set Current browser language
Magic_quotes_gpc Magic_quotes_gpc

Reprint Address: http://www.thinkphp.cn/info/77.html

Thinkphp System Constants

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.