本文整理汇总了PHP中IPSLib::cleanGlobals方法的典型用法代码示例。如果您正苦于以下问题:PHP IPSLib::cleanGlobals方法的具体用法?PHP IPSLib::cleanGlobals怎么用?PHP IPSLib::cleanGlobals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPSLib
的用法示例。
在下文中一共展示了IPSLib::cleanGlobals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
//.........这里部分代码省略.........
define('IPS_IS_MOBILE_APP', false);
}
/**
* File and folder permissions
*/
if (!defined('IPS_FILE_PERMISSION')) {
define('IPS_FILE_PERMISSION', 0777);
}
if (!defined('IPS_FOLDER_PERMISSION')) {
define('IPS_FOLDER_PERMISSION', 0777);
}
/* Set it again incase a gateway turned it off */
ipsRegistry::$settings['use_friendly_urls'] = ALLOW_FURLS;
/* Start timer */
IPSDebug::startTimer();
/* Cookies... */
IPSCookie::$sensitive_cookies = array('session_id', 'admin_session_id', 'member_id', 'pass_hash');
/* INIT DB */
self::$handles['db'] = ips_DBRegistry::instance();
/* Set DB */
self::$handles['db']->setDB(ipsRegistry::$settings['sql_driver']);
/* Input set up... */
if (is_array($_POST) and count($_POST)) {
foreach ($_POST as $key => $value) {
# Skip post arrays
if (!is_array($value)) {
$_POST[$key] = IPSText::stripslashes($value);
}
}
}
//-----------------------------------------
// Clean globals, first.
//-----------------------------------------
IPSLib::cleanGlobals($_GET);
IPSLib::cleanGlobals($_POST);
IPSLib::cleanGlobals($_COOKIE);
IPSLib::cleanGlobals($_REQUEST);
# GET first
$input = IPSLib::parseIncomingRecursively($_GET, array());
# Then overwrite with POST
self::$request = IPSLib::parseIncomingRecursively($_POST, $input);
# Fix some notices
if (!isset(self::$request['module'])) {
self::$request['module'] = '';
}
if (!isset(self::$request['section'])) {
self::$request['section'] = '';
}
# Assign request method
self::$request['request_method'] = strtolower(my_getenv('REQUEST_METHOD'));
/* Define some constants */
define('IPS_IS_TASK', (isset(self::$request['module']) and self::$request['module'] == 'task' and self::$request['app'] == 'core') ? TRUE : FALSE);
define('IPS_IS_AJAX', (isset(self::$request['module']) and self::$request['module'] == 'ajax') ? TRUE : FALSE);
/* First pass of app set up. Needs to be BEFORE caches and member are set up */
self::_fUrlInit();
self::_manageIncomingURLs();
/* _manageIncomingURLs MUST be called first!!! */
self::_setUpAppData();
/* Load app / coreVariables.. must be called after app Data */
self::_loadAppCoreVariables(IPS_APP_COMPONENT);
/* Must be called after _manageIncomingURLs */
self::$handles['db']->getDB()->setDebugMode(IPS_SQL_DEBUG_MODE ? isset($_GET['debug']) ? intval($_GET['debug']) : 0 : 0);
/* Get caches */
self::$handles['caches'] = ips_CacheRegistry::instance();
/* Make sure all is well before we proceed */
try {
示例2: init
/**
* Initiate the registry
*
* @access public
* @return @e void
*/
public static function init()
{
if (self::$initiated === TRUE) {
return FALSE;
}
self::$initiated = TRUE;
/* Log current upgrade step */
self::logUpgradeStep();
/* Load static classes */
require IPS_ROOT_PATH . "sources/base/core.php";
/*noLibHook*/
require IPS_ROOT_PATH . "sources/base/ipsMember.php";
/*noLibHook*/
require_once IPS_ROOT_PATH . "setup/sources/base/setup.php";
/*noLibHook*/
/* Load conf global and set up DB */
if (IPS_IS_UPGRADER) {
if (!is_file(DOC_IPS_ROOT_PATH . "conf_global.php")) {
print "Cannot locate: " . DOC_IPS_ROOT_PATH . "conf_global.php";
exit;
}
self::loadConfGlobal();
/* Got settings? */
if (!ipsRegistry::$settings['sql_driver']) {
print "Settings not loaded from: " . DOC_IPS_ROOT_PATH . "conf_global.php - did you mean to install?";
exit;
}
self::setDBHandle();
} else {
/* Ensure char set is defined */
if (!defined('IPS_DOC_CHAR_SET')) {
define('IPS_DOC_CHAR_SET', strtoupper(IPSSetUp::charSet));
}
if (!defined('IPS_CACHE_PATH')) {
define('IPS_CACHE_PATH', DOC_IPS_ROOT_PATH);
}
require IPS_ROOT_PATH . "setup/sources/base/install.php";
/*noLibHook*/
}
/* Input set up... */
if (is_array($_POST) and count($_POST)) {
foreach ($_POST as $key => $value) {
# Skip post arrays
if (!is_array($value)) {
$_POST[$key] = IPSText::stripslashes($value);
}
}
}
//-----------------------------------------
// Clean globals, first.
//-----------------------------------------
IPSLib::cleanGlobals($_GET);
IPSLib::cleanGlobals($_POST);
IPSLib::cleanGlobals($_COOKIE);
IPSLib::cleanGlobals($_REQUEST);
# GET first
$input = IPSLib::parseIncomingRecursively($_GET, array());
# Then overwrite with POST
self::$request = IPSLib::parseIncomingRecursively($_POST, $input);
# Assign request method
self::$request['request_method'] = strtolower(my_getenv('REQUEST_METHOD'));
self::_setUpAppData();
/* Make sure it's a string */
if (is_array(self::$request['section'])) {
self::$request['section'] = '';
}
/* Get caches */
self::$handles['caches'] = ips_CacheRegistry::instance();
if (IPS_IS_UPGRADER) {
/* Make sure all is well before we proceed */
self::instance()->setUpSettings();
/* Build module and application caches */
self::instance()->checkCaches();
/* Load 'legacy' systems */
$file = '';
if (IPSSetUp::is300plus() === TRUE) {
$file = '3xx.php';
} else {
if (IPSSetUp::is200plus() === TRUE) {
$file = '2xx.php';
} else {
$file = '1xx.php';
}
}
require_once IPS_ROOT_PATH . 'setup/sources/legacy/' . $file;
/*noLibHook*/
self::instance()->setClass('legacy', new upgradeLegacy(self::instance()));
}
/* Set up member */
self::$handles['member'] = ips_MemberRegistry::instance();
# Thaw saved data
IPSSetUp::thawSavedData();
/* Gather other classes */
require_once IPS_ROOT_PATH . 'setup/sources/classes/output/output.php';
//.........这里部分代码省略.........