Class_core.php module performance White Paper

Source: Internet
Author: User
Class_core.php module function white paper sourceclassclass_core.php is Discuz! General initialization module program, which is referenced by almost all external code. Before you start plug-in design, you can first understand the general functions of this module. Class_core.php mainly completes the following tasks: judging different PHP and operating system environments and processing compatibility, making the class_core.php module functional white paper

Source/class/class_core.php is Discuz! General initialization module program, which is referenced by almost all external code. Before you start plug-in design, you can first understand the general functions of this module. Class_core.php has completed the following tasks:

  • Different PHP and operating system environments are judged and compatible, so that Discuz! It can run in a variety of server environments with different configurations.
  • The initialization constant IN_DISCUZ is TRUE, which is used to judge the Future program of include or require to prevent other programs from being illegally referenced.
  • Read the absolute path of the community program and store it in the constant DISCUZ_ROOT.
  • Load the required basic function library source/function/function_core.php.
  • Use the database account information provided in config/config_global.php to establish a database connection. Discuz! The table prefix is supported. to obtain the full name of a table, you can use "DB: table ('tablename.
  • Determine whether a user logs on. for example, if $ _ G ['uid'] is not 0, add $ _ G ['username'] (the user name of addslashes is added, can be used to insert a database without modification), $ _ G ['member'] ['username'] (original user name, which can be used for display on the page), $ _ G ['member'] ['password'] (MD5 string of the user's password) and other user information assignment, other user information is stored in $ _ G ['member']. For more information, see "getuserprofile.
  • Determine the user management permission and set $ _ G ['adminid'] to 1 ~ 3. 0 stands for normal users; 1 stands for forum administrators; 2 stands for Super moderators; 3 stands for forum moderators. Mark user permissions as $ _ G ['groupid'] based on the ID of the user group to which the user belongs. the related permissions are read from the system cache corresponding to $ _ G ['groupid'] and stored in $ _ G ['group'].
  • Preset read various setting variables for each module.

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.