当前位置: 首页>>代码示例>>PHP>>正文


PHP IPSSetUp::freezeSavedData方法代码示例

本文整理汇总了PHP中IPSSetUp::freezeSavedData方法的典型用法代码示例。如果您正苦于以下问题:PHP IPSSetUp::freezeSavedData方法的具体用法?PHP IPSSetUp::freezeSavedData怎么用?PHP IPSSetUp::freezeSavedData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPSSetUp的用法示例。


在下文中一共展示了IPSSetUp::freezeSavedData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
 }
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:96,代码来源:setup.php

示例2: sendOutput

 /**
  * Main output function
  *
  * @access	public
  * @param	boolean		TRUE - freeze data, FALSE, do not.
  * @return	@e void	Nothin'
  */
 public function sendOutput($saveData = TRUE)
 {
     //-----------------------------------------
     // INIT
     //-----------------------------------------
     $_hit = 0;
     /* Options */
     $options['savedData'] = $saveData === TRUE ? IPSSetUp::freezeSavedData() : '';
     $options['hideButton'] = $this->_hideButton === TRUE ? TRUE : FALSE;
     $options['progress'] = array();
     /* Sequence progress */
     foreach ($this->sequenceData as $key => $page) {
         if ($key == $this->currentPage) {
             $options['progress'][] = array('step_doing', $page);
             $_hit = 1;
         } else {
             if ($_hit) {
                 $options['progress'][] = array('step_notdone', $page);
             } else {
                 $options['progress'][] = array('step_done', $page);
             }
         }
     }
     //-----------------------------------------
     // Header
     //-----------------------------------------
     if (isset($_SERVER['SERVER_PROTOCOL']) and strstr($_SERVER['SERVER_PROTOCOL'], '/1.0')) {
         header("HTTP/1.0 200 OK");
     } else {
         header("HTTP/1.1 200 OK");
     }
     header("Content-type: text/html;charset={$this->settings['gb_char_set']}");
     header("Cache-Control: no-cache, must-revalidate, max-age=0");
     header("Expires: 0");
     header("Pragma: no-cache");
     $template = $this->template->globalTemplate($this->_title, $this->_html, $options, $this->_errors, $this->_warnings, $this->_messages, $this->_installStep, $this->_curVersion, $this->_curApp);
     print $template;
     exit;
 }
开发者ID:ConnorChristie,项目名称:GrabViews,代码行数:46,代码来源:output.php

示例3: writeConfiguration

 /**
  * Writes out conf_global
  *
  * @access	public
  * @return	bool	File written successfully
  */
 public static function writeConfiguration()
 {
     //-----------------------------------------
     // Safe mode?
     //-----------------------------------------
     $safe_mode = 0;
     if (@get_cfg_var('safe_mode')) {
         $safe_mode = @get_cfg_var('safe_mode');
     }
     //-----------------------------------------
     // Set info array
     //-----------------------------------------
     $INFO = array('sql_driver' => IPSSetUp::getSavedData('sql_driver'), 'sql_host' => IPSSetUp::getSavedData('db_host'), 'sql_database' => IPSSetUp::getSavedData('db_name'), 'sql_user' => IPSSetUp::getSavedData('db_user'), 'sql_pass' => str_replace('\'', '\\\'', IPSSetUp::getSavedData('db_pass')), 'sql_tbl_prefix' => IPSSetUp::getSavedData('db_pre'), 'sql_debug' => 0, 'sql_charset' => '', 'board_start' => time(), 'installed' => 1, 'php_ext' => 'php', 'safe_mode' => $safe_mode, 'board_url' => IPSSetUp::getSavedData('install_url'), 'banned_group' => '5', 'admin_group' => '4', 'guest_group' => '2', 'member_group' => '3', 'auth_group' => '1', 'use_friendly_urls' => 1, '_jsDebug' => 0);
     //---------------------------------------------
     // Any "extra" configs required for this driver?
     //---------------------------------------------
     foreach (IPSSetUp::getSavedDataAsArray() as $k => $v) {
         if (preg_match("#^__sql__#", $k)) {
             $k = str_replace("__sql__", "", $k);
             $INFO[$k] = $v;
         }
     }
     //---------------------------------------------
     // Write to disk
     //---------------------------------------------
     $core_conf = "<" . "?php\n";
     foreach ($INFO as $k => $v) {
         $core_conf .= '$INFO[' . "'" . $k . "'" . ']' . "\t\t\t=\t'" . $v . "';\n";
     }
     $core_conf .= "\ndefine('IN_DEV', 0);";
     /* Remote archive stuff */
     $core_conf .= "\n/* Remote archive DB - complete these details if you\\'re using a remote DB for the post archive.\n   If content has already been archived in the local DB, this will need transferring and will not be done automatically. */\n";
     foreach (array('archive_remote_sql_host', 'archive_remote_sql_database', 'archive_remote_sql_user', 'archive_remote_sql_pass', 'archive_remote_sql_charset') as $k) {
         $core_conf .= '$INFO[' . "'" . $k . "'" . ']' . "\t\t\t=\t'';\n";
     }
     $core_conf .= "\n" . '?' . '>';
     /* Write Configuration Files */
     $output[] = 'Writing configuration files...<br />';
     $ret = IPSSetUp::writeFile(IPSSetUp::getSavedData('install_dir') . '/conf_global.php', $core_conf);
     /* Now freeze data */
     IPSSetUp::freezeSavedData();
     return $ret;
 }
开发者ID:mover5,项目名称:imobackup,代码行数:49,代码来源:install.php

示例4: writeConfiguration

 /**
  * Writes out conf_global
  *
  * @access	public
  * @return	bool	File written successfully
  */
 public static function writeConfiguration()
 {
     //-----------------------------------------
     // Safe mode?
     //-----------------------------------------
     $safe_mode = 0;
     if (@get_cfg_var('safe_mode')) {
         $safe_mode = @get_cfg_var('safe_mode');
     }
     //-----------------------------------------
     // Set info array
     //-----------------------------------------
     $INFO = array('sql_driver' => IPSSetUp::getSavedData('sql_driver'), 'sql_host' => IPSSetUp::getSavedData('db_host'), 'sql_database' => IPSSetUp::getSavedData('db_name'), 'sql_user' => IPSSetUp::getSavedData('db_user'), 'sql_pass' => IPSSetUp::getSavedData('db_pass'), 'sql_tbl_prefix' => IPSSetUp::getSavedData('db_pre'), 'sql_debug' => 1, 'sql_charset' => '', 'board_start' => time(), 'installed' => 1, 'php_ext' => 'php', 'safe_mode' => $safe_mode, 'board_url' => IPSSetUp::getSavedData('install_url'), 'banned_group' => '5', 'admin_group' => '4', 'guest_group' => '2', 'member_group' => '3', 'auth_group' => '1', 'use_friendly_urls' => 1, '_jsDebug' => 0);
     //---------------------------------------------
     // Any "extra" configs required for this driver?
     //---------------------------------------------
     foreach (IPSSetUp::getSavedDataAsArray() as $k => $v) {
         if (preg_match("#^__sql__#", $k)) {
             $k = str_replace("__sql__", "", $k);
             $INFO[$k] = $v;
         }
     }
     //---------------------------------------------
     // Write to disk
     //---------------------------------------------
     $core_conf = "<" . "?php\n";
     foreach ($INFO as $k => $v) {
         $core_conf .= '$INFO[' . "'" . $k . "'" . ']' . "\t\t\t=\t'" . $v . "';\n";
     }
     $core_conf .= "\ndefine('IN_DEV', 0);";
     $core_conf .= "\n" . '?' . '>';
     /* Write Configuration Files */
     $output[] = 'Writing configuration files...<br />';
     $ret = IPSSetUp::writeFile(IPSSetUp::getSavedData('install_dir') . '/conf_global.php', $core_conf);
     /* Now freeze data */
     IPSSetUp::freezeSavedData();
     return $ret;
 }
开发者ID:dalandis,项目名称:Visualization-of-Cell-Phone-Locations,代码行数:44,代码来源:install.php


注:本文中的IPSSetUp::freezeSavedData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。