本文整理汇总了PHP中IPSSetUp::thawSavedData方法的典型用法代码示例。如果您正苦于以下问题:PHP IPSSetUp::thawSavedData方法的具体用法?PHP IPSSetUp::thawSavedData怎么用?PHP IPSSetUp::thawSavedData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPSSetUp
的用法示例。
在下文中一共展示了IPSSetUp::thawSavedData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: restorePreviousSession
/**
* Check for previous sessions.
* Checks to see if there's an unfinished upgrade.
*
* @param array
* @access public
*/
public static function restorePreviousSession($session)
{
/* Delete all previous sessions */
ipsRegistry::DB()->delete('upgrade_sessions', 'session_id != \'' . ipsRegistry::$request['s'] . '\'');
/* Update the session */
ipsRegistry::DB()->update('upgrade_sessions', array('session_current_time' => time(), 'session_section' => $session['session_section'], 'session_post' => serialize($session['_session_post']), 'session_get' => serialize($session['_session_get'])), 'session_id=\'' . ipsRegistry::$request['s'] . '\'');
/* Set correct app */
$_GET['app'] = 'upgrade';
$_POST['app'] = 'upgrade';
ipsRegistry::$request['app'] = 'upgrade';
ipsRegistry::$current_section = 'upgrade';
/* Set correct section */
$_GET['section'] = $session['_session_get']['section'];
$_POST['section'] = $session['_session_get']['section'];
ipsRegistry::$request['section'] = $session['_session_get']['section'];
ipsRegistry::$current_section = $session['_session_get']['section'];
/* Set up the correct do */
$_GET['do'] = $session['_session_get']['do'];
$_POST['do'] = $session['_session_get']['do'];
ipsRegistry::$request['do'] = $session['_session_get']['do'];
/* Set up the correct previous */
$_GET['previous'] = $session['_session_get']['previous'];
$_POST['previous'] = $session['_session_get']['previous'];
ipsRegistry::$request['previous'] = $session['_session_get']['previous'];
/* Set up SD */
$_POST['_sd'] = $session['_sd'];
ipsRegistry::$request['_sd'] = $session['_sd'];
/* App dir, etc */
ipsRegistry::$request['appdir'] = $session['_sd']['appdir'];
ipsRegistry::$request['man'] = $session['_sd']['man'];
ipsRegistry::$request['helpfile'] = $session['_sd']['helpfile'];
$apps = explode(',', $session['_sd']['install_apps']);
$toSave = array();
$vNums = array();
/* set saved data */
if (count($session['_sd'])) {
foreach ($session['_sd'] as $k => $v) {
if ($k) {
IPSSetUp::setSavedData($k, $v);
}
}
}
if (is_array($apps) and count($apps)) {
/* Grab data */
foreach ($apps as $app) {
/* Grab version numbers */
$numbers = IPSSetUp::fetchAppVersionNumbers($app);
/* Grab all numbers */
$nums[$app] = IPSSetUp::fetchXmlAppVersions($app);
/* Grab app data */
$appData[$app] = IPSSetUp::fetchXmlAppInformation($app);
$appClasses[$app] = IPSSetUp::fetchVersionClasses($app, $numbers['current'][0], $numbers['latest'][0]);
/* Store starting vnums */
$vNums[$app] = $numbers['current'][0];
}
/* Got anything? */
if (count($appClasses)) {
foreach ($appClasses as $app => $data) {
foreach ($data as $num) {
if (is_file(IPSLib::getAppDir($app) . '/setup/versions/upg_' . $num . '/version_class.php')) {
$_class = 'version_class_' . $app . '_' . $num;
require_once IPSLib::getAppDir($app) . '/setup/versions/upg_' . $num . '/version_class.php';
/*noLibHook*/
$_tmp = new $_class(ipsRegistry::instance());
if (method_exists($_tmp, 'preInstallOptionsSave')) {
$_t = $_tmp->preInstallOptionsSave();
if (is_array($_t) and count($_t)) {
$toSave[$app][$num] = $_t;
}
}
}
}
}
/* Save it */
if (count($toSave)) {
IPSSetUp::setSavedData('custom_options', $toSave);
}
if (count($vNums)) {
IPSSetUp::setSavedData('version_numbers', $vNums);
}
}
/* Freeze data */
IPSSetUp::freezeSavedData();
/* Thaw it */
IPSSetUp::thawSavedData();
}
/* Re run our controller */
ipsController::run();
}
示例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';
//.........这里部分代码省略.........