System constants and pre-defined constants collections in thinkphp _php tutorial

Source: Internet
Author: User
Thinkphp system constants and pre-defined 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 action name
Tmpl_path//project template Catalog
Lib_path//Project Class Library Directory
Cache_path//project template Cache directory
Config_path//Project Profile directory
Log_path// Project log file directory
Lang_path//Project Language file directory
Temp_path//Project temp file directory
Plugin_path//project plug-in file directory
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//is a Windows environment
Is_linux//Whether it belongs to Linux Environment
IS_FREEBSD//Whether it belongs to the FREEBSD environment
Now_time//Current timestamp
memory_limit_on//Whether there is memory usage limit
memory_limit_on// Is there a memory usage limit
output_gzip_on//whether to turn on 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__//web site root address
__app__// Current project (entry file) address
__url__//Current module address
__action__//Current action address
__self__//Current URL address
Tmpl_file_name//Default template name for current operation (with path) Br>web_public_url//Web site Public directory
App_public_url//Project Common template catalog

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 logging
Mail_log=1//Mail logging
tcp_log=2//TCP log logging
file_log=3//File mode logging
Data_type_obj=1//Object mode return
data_type_array=0//Array mode return
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//form exists field is validated
Must_to_validate = 1//Must be verified
Value_to_vailidate = 2//The form value is not NULL to validate

http://www.bkjia.com/PHPjc/824677.html www.bkjia.com true http://www.bkjia.com/PHPjc/824677.html techarticle thinkphp System constants and pre-defined 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 ...

  • 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.