From C + + turn around, ask PHP initialization where? The first time the program starts, it needs to read into the configuration data.

Source: Internet
Author: User
From C + + turn around, ask PHP initialization where? Is that the first time the program starts to read into the configuration data?
For example, in C + + there is a main function, you can do some startup initialization, read into the configuration table what, just do it once
Now write the service side with PHP, this similar function I need to add where? Thanks, eh!
------Solution--------------------
Just put it in the program!

------Solution--------------------
References:
Quote: References:

Just put it in the program!


But a Web access, service side of the corresponding PHP will not run once? Isn't it a program that reads resources every time?? If PHP does not have the main function that starts, I want to create a global variable class that reads the resources under this class. This global variable must be executed only once?

Each client access is to reopen a program client if it corresponds to C + +.
In general, PHP global variables or programs to run are placed in a init.php file, which file needs to use these global configuration information can contain this file.
For the same access user (session is not expired, the general session is closed after the browser is expired), the user can use the session to store the relevant configuration options, so that users can access other pages directly from the session to get the user's configuration options.
  • 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.