本文整理匯總了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';
//.........這裏部分代碼省略.........