Transferred from http://www.cnblogs.com/redfox241/admin/www.discuz.net by Guo Xin
Reprint address: http://www.discuz.net/viewthread.php? Tid = 611716 & highlight = % 2B % CA % B7 % C9 % CF % B5 % DA % D2 % BB % C7 % BF % A3 % BADiscuz % 21
// Define some PHP Environments
Error_reporting (0 );
Set_magic_quotes_runtime (0 );
// Set the start time of Discuz
$ Mtime = explode ('', microtime ());
$ Discuz_starttime = $ mtime [1] + $ mtime [0];
// Define some constants
Define ('sys _ debug', FALSE );
Define ('in _ DISCUZ ', TRUE );
Define ('discuz _ root', substr (dirname (_ FILE _), 0,-7); // obtain the absolute directory
// Versatility
If (PHP_VERSION <'4. 1.0 '){
$ _ GET = & $ HTTP_GET_VARS;
$ _ POST = & $ HTTP_POST_VARS;
$ _ COOKIE = & $ HTTP_COOKIE_VARS;
$ _ SERVER = & $ HTTP_SERVER_VARS;
$ _ ENV = & $ HTTP_ENV_VARS;
$ _ FILES = & $ HTTP_POST_FILES;
}
This section basically sets an error report, closes the sick guy magic_quotes, and sets a start time, in this way, the Process Time we see at the bottom of the Forum is calculated based on the difference between the start Time and the end Time, and then defines an IN_DISCUZ as true, the IN_DISCUZ constant is used to prevent unauthorized reference in other include files such as inc. If this constant is not present, the word "Access Denied" appears and exits. Then obtain the absolute directory where Discuz runs. The next step is to determine whether the PHP version is earlier than 4.1 or above, because PHP uses 4.1 as a demarcation line, get the GET value in the way of $ HTTP_GET_VARS ['xx'] below 4.1, and get the get value using $ _ GET later, the purpose of this operation is to use $ _ GET in whatever PHP version. It is universal ~!
Require_once DISCUZ_ROOT. './include/global. func. php ';
Reference include/global. inc. php. This file is the core function file of Discuz. It contains many common functions used by Discuz.