本文整理汇总了PHP中ipsRegistry::initiated方法的典型用法代码示例。如果您正苦于以下问题:PHP ipsRegistry::initiated方法的具体用法?PHP ipsRegistry::initiated怎么用?PHP ipsRegistry::initiated使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ipsRegistry
的用法示例。
在下文中一共展示了ipsRegistry::initiated方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* Initiate the registry
*
* @return mixed false or void
*/
public static function init()
{
$INFO = array();
$_ipsPowerSettings = array();
if (self::$initiated === TRUE) {
return FALSE;
}
self::$initiated = TRUE;
/* Load static classes */
require IPS_ROOT_PATH . "sources/base/core.php";
/*noLibHook*/
require IPS_ROOT_PATH . "sources/base/ipsMember.php";
/*noLibHook*/
/* Debugging notices? */
if (defined('IPS_ERROR_CAPTURE') and IPS_ERROR_CAPTURE !== FALSE) {
@error_reporting(E_ALL | E_NOTICE);
@set_error_handler("IPSDebug::errorHandler");
}
/* Load core variables */
self::_loadCoreVariables();
/* Load config file */
if (is_file(DOC_IPS_ROOT_PATH . 'conf_global.php')) {
require DOC_IPS_ROOT_PATH . 'conf_global.php';
/*noLibHook*/
if (is_array($INFO)) {
foreach ($INFO as $key => $val) {
ipsRegistry::$settings[$key] = str_replace('\', '\\', $val);
}
}
}
/* Load secret sauce */
if (is_array($_ipsPowerSettings)) {
ipsRegistry::$settings = array_merge($_ipsPowerSettings, ipsRegistry::$settings);
}
/* Make sure we're installed */
if (empty($INFO['sql_database'])) {
/* Quick PHP version check */
if (!version_compare(MIN_PHP_VERS, PHP_VERSION, '<=')) {
print "You must be using PHP " . MIN_PHP_VERS . " or better. You are currently using: " . PHP_VERSION;
exit;
}
$host = $_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : @getenv('HTTP_HOST');
$self = $_SERVER['PHP_SELF'] ? $_SERVER['PHP_SELF'] : @getenv('PHP_SELF');
if (IPS_AREA == 'admin') {
@header("Location: http://" . $host . rtrim(dirname($self), '/\\') . "/install/index.php");
} else {
if (!defined('CP_DIRECTORY')) {
define('CP_DIRECTORY', 'admin');
}
@header("Location: http://" . $host . rtrim(dirname($self), '/\\') . "/" . CP_DIRECTORY . "/install/index.php");
}
}
/* Switch off dev mode you idjit */
if (!defined('IN_DEV')) {
define('IN_DEV', 0);
}
/* Shell defined? */
if (!defined('IPS_IS_SHELL')) {
define('IPS_IS_SHELL', FALSE);
}
/* If this wasn't defined in the gateway file... */
if (!defined('ALLOW_FURLS')) {
define('ALLOW_FURLS', ipsRegistry::$settings['use_friendly_urls'] ? TRUE : FALSE);
}
if (!defined('IPS_IS_MOBILE_APP')) {
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);
}
}
}
//.........这里部分代码省略.........
示例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';
//.........这里部分代码省略.........