Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Collection of system constants and predefined constants in ThinkPHP

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the knowledge of "collection of system constants and predefined constants in ThinkPHP". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The ThinkPHP system constants and predefined constants are summarized as follows:

1. System constant:

THINK_PATH / / ThinkPHP system directory:

APP_PATH / / current project directory

APP_NAME / / current project name

MODULE_NAME / / current module name

ACTION_NAME / / name of the current operation

TMPL_PATH / / Project template directory

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 / / temporary project file directory

PLUGIN_PATH / / Project plug-in file directory

VENDOR_PATH / / third-party class library directory

DATA_PATH / / Project data file directory

Whether IS_APACHE / / belongs to Apache

Whether IS_IIS / / belongs to IIS

Whether IS_WIN / / belongs to Windows environment

Whether IS_LINUX / / belongs to Linux environment

Whether IS_FREEBSD / / 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__ / / site root address

_ _ APP__ / / address of current project (entry file)

_ _ URL__ / / current module address

_ _ ACTION__ / / current operation address

_ _ SELF__ / / current URL address

TMPL_FILE_NAME / / default template name for the current operation (including path)

WEB_PUBLIC_URL / / website public directory

APP_PUBLIC_URL / / Project Common template Catalog

two。 Predefined constants:

WEB_LOG_ERROR=0 / / error log type

WEB_LOG_DEBUG=1 / / Debug log type

SQL_LOG_DEBUG=2 / / SQL log type

Logging in SYSTEM_LOG=0 / / system mode

Log by MAIL_LOG=1 / / email

Log in TCP_LOG=2 / / TCP mode

Log in FILE_LOG=3 / / file mode

Returned in DATA_TYPE_OBJ=1 / / object mode

Returned in DATA_TYPE_ARRAY=0 / / 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 / / if there is a field in the form, it is verified.

MUST_TO_VALIDATE = 1 / / must be verified

VALUE_TO_VAILIDATE = 2 / / validation if the form value is not empty

That's all for the collection of system constants and predefined constants in ThinkPHP. Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report