本文整理汇总了PHP中SC::setGlobal方法的典型用法代码示例。如果您正苦于以下问题:PHP SC::setGlobal方法的具体用法?PHP SC::setGlobal怎么用?PHP SC::setGlobal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SC
的用法示例。
在下文中一共展示了SC::setGlobal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initializeBase
function initializeBase()
{
// set the default timezone
if (function_exists('date_default_timezone_set')) {
@date_default_timezone_set('Asia/Shanghai');
}
// define the start of our script
define('MICROTIME', microtime(TRUE));
// path to the html templates folder.
// base path
define('DIR_BASE', dirname(dirname(__FILE__)) . '/');
// path to the private source code
define('DIR_PRIVATE', DIR_BASE . 'private/');
// path to the 3rd Party vendors
define('DIR_VENDORS', DIR_BASE . 'vendors/');
// path public_html folder
//define('DIR_PUBLIC_HTML', DIR_BASE .'wp-content/themes/seecblog/');
define('DIR_PUBLIC_HTML', DIR_BASE);
// define the path to the classes directory
define('DIR_CLASSES', DIR_PRIVATE . 'classes/');
// path to php includes
define('DIR_INCLUDES', DIR_PRIVATE . 'includes/');
// path to script includes.
define('DIR_SCRIPT_INCLUDES', DIR_PRIVATE . 'script_includes/');
// path to circuit application directory root
define('DIR_CIRCUIT_APPS', DIR_PRIVATE . 'circuit-apps/');
// include general fuctions
include_once DIR_INCLUDES . 'functions.php';
// EVENTUALLY INTEGRATE THIS FILE INTO THIS PAGE
// get rid of stupid errors.
if (!defined('IN_PHPBB')) {
define('IN_PHPBB', true);
}
// This will NOT report uninitialized variables
if (SC::isEmpty('board_config.report_errors')) {
error_reporting(E_ERROR | E_WARNING | E_PARSE);
} else {
error_reporting(E_ALL);
ini_set('report_errors', 1);
// ini_set('display_errors', 1);
}
//
// Obtain and encode users IP
$user_ip_address = get_user_ip();
define('USER_IP', encode_ip($user_ip_address));
SC::setGlobal('user_ip', USER_IP);
// not sure if we still need this but just trying to keep consistent.
// i converted to string replace instead of preg_match then preg_replace.
// still not sure we need it tho.
foreach ($_SERVER as $key => $ex_check) {
if (is_string($ex_check)) {
$_SERVER[$key] = str_replace(array('"', "'"), '', $ex_check);
}
}
// becuase register_globals is turned off...
// $PHP_SELF doesn't work anymore...
// so, we have to force it to work for bw compatibility.
// as soon as possible, remove this!
SC::setGlobal('PHP_SELF', $_SERVER['PHP_SELF']);
// start output buffering
buffer_browser_output();
}