class_core.php Module Features white paper
Source/class/class_core.php is discuz!. General initialization Module program, which is almost referenced by all external code, before you start the plug-in design, you can first understand the approximate function of the module. Class_core.php has mainly completed the following tasks:
- Different PHP and operating system environment to make a judgment and compatibility processing, so that discuz! Can run in a variety of different configurations of the server environment.
- Initializes the constant in_discuz to TRUE, which is used for the judgment of the include or require follow-up program to avoid other programs being illegally referenced.
- Read the absolute path of the community program, stored in the constant discuz_root.
- Load the required base Function library source/function/function_core.php.
- The database connection is established through the database account information provided in the config/config_global.php. discuz! Support the prefix of the data table, if you want to get the full name of the table, you can use "db::table (' tablename ')" mode.
- Determine if the user is logged in, such as login tag $_g[' uid '] is not 0, and will be $_g[' username ' (added addslashes user name, can be used for non-modified insert database), $_g[' member ' [' username '] (The original user name, can be used for the page display), $_g[' member ' [' Password '] (user password MD5 string) and other user information assignment, other users information stored in $_g[' member '], more information can be through the "getuserprofile () Gets
- To determine the user administrative rights, mark the administrative permission $_g[' Adminid '] as the middle value. 0 for ordinary users, 1 for forum administrators, 2 for Super moderators, 3 for forum moderators. The user rights are marked as $_g[' GroupID ' according to their primary user group ID, and the relevant permissions are read from the system cache corresponding to the $_g[' GroupID '] and stored in the $_g[' group '.
- The Presets read the various settings variables for each module.