I transferred it from C ++ and asked where the PHP initialization was? This is the type of configuration data that needs to be read when the program is started for the first time.

Source: Internet
Author: User
I transferred it from C ++ and asked where the PHP initialization was? Which is the first time the program needs to read the configuration data? For example, there is a main function in C ++ that can start initialization and read the configuration table or something. Now I am using PHP to write the server. Where can I add this similar function? Thank you! ------ Solution ------------------ no program is executed in the order of code. ------ solution -------------- it is transferred from C ++. where is the PHP initialization? Which is the first time the program needs to read the configuration data?
For example, there is a main function in C ++ that can start initialization and read the configuration table or something.
Now I am using PHP to write the server. Where can I add this similar function? Thank you!
------ Solution --------------------
No
Programs are executed in the order of code appearance
------ Solution --------------------
_ Construct () cube function. Similar to main.
------ Solution --------------------
What should I initialize? Php generally gets a public configuration file, which is included by everyone.
------ Solution --------------------
The script language is like this. if you want to avoid multiple executions, you can use the data cache.

Reference:
Quote: reference:

In the same way, it is equivalent to configuring database connection information in this public configuration file at the same time, and then reading public initialization things...


This is from the code level.

However
If user A browses the WEB, this part of code will run once,
If User B browses the WEB, will this part of code run again?

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.