本文整理汇总了PHP中IPSSetUp::getSavedData方法的典型用法代码示例。如果您正苦于以下问题:PHP IPSSetUp::getSavedData方法的具体用法?PHP IPSSetUp::getSavedData怎么用?PHP IPSSetUp::getSavedData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPSSetUp
的用法示例。
在下文中一共展示了IPSSetUp::getSavedData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postInstallNotices
/**
* Return any post-installation notices
*
* @return array Array of notices
*/
public function postInstallNotices()
{
$options = IPSSetUp::getSavedData('custom_options');
$_skip = $options['ipchat'][13000]['skipIgnoredUsers'];
$notices = array();
if ($_skip) {
$notices[] = "Ignored chat users have not been converted. You should run the tool in the ACP under Other Apps > Chat > Tools to convert the ignored users.";
}
return $notices;
}
示例2: convertIgnored
/**
* Convert ignored users
*
* @param int
* @return @e void
*/
public function convertIgnored()
{
/* Are we skipping this step? */
$options = IPSSetUp::getSavedData('custom_options');
$_skip = $options['ipchat'][13000]['skipIgnoredUsers'];
if ($_skip) {
$this->registry->output->addMessage("Skipping chat ignored users conversion...");
$this->request['st'] = 0;
$this->request['workact'] = '';
return;
}
/* Init */
$st = intval($this->request['st']);
$did = 0;
$each = 500;
/* Find chat ignored users */
$this->DB->build(array('select' => 'member_id, members_cache', 'from' => 'members', 'order' => 'member_id ASC', 'limit' => array($st, $each)));
$outer = $this->DB->execute();
while ($r = $this->DB->fetch($outer)) {
$did++;
/* Unpack cache */
$_cache = unserialize($r['members_cache']);
/* Now look for ignored users in chat */
if (is_array($_cache['ignore_chat']) and count($_cache['ignore_chat'])) {
foreach ($_cache['ignore_chat'] as $_mid) {
/* Are we already 'ignoring' this user for other reasons? */
$_check = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'ignored_users', 'where' => "ignore_owner_id=" . $r['member_id'] . ' AND ignore_ignore_id=' . $_mid));
/* If yes, then update record to also ignore chat */
if ($_check['ignore_id']) {
$this->DB->update('ignored_users', array('ignore_chats' => 1), 'ignore_id=' . $_check['ignore_id']);
} else {
$this->DB->insert('ignored_users', array('ignore_chats' => 1, 'ignore_owner_id' => $r['member_id'], 'ignore_ignore_id' => $_mid));
}
}
/* Rebuild cache */
IPSMember::rebuildIgnoredUsersCache($r);
/* Clean up members_cache */
unset($_cache['ignore_chat']);
$_cache = serialize($_cache);
$this->DB->update('members', array('members_cache' => $_cache), 'member_id=' . $r['member_id']);
}
}
/* Show message and redirect */
if ($did > 0) {
$this->request['st'] = $st + $did;
$this->request['workact'] = 'ignored';
$this->registry->output->addMessage("Up to {$this->request['st']} members checked for ignored chat users...");
} else {
$this->request['st'] = 0;
$this->request['workact'] = '';
$this->registry->output->addMessage("All ignored chat users converted...");
}
/* Next Page */
return;
}
示例3: setDbPrefix
/**
* Set db prefix
*
* @access public
* @param object Registry reference
* @return @e void
*/
public function setDbPrefix($prefix = '')
{
if ($prefix) {
$this->prefix = $prefix;
return;
} else {
if (class_exists('IPSSetUp')) {
if (IPSSetUp::getSavedData('db_pre')) {
$this->prefix = IPSSetUp::getSavedData('db_pre');
return;
}
}
}
/* Still 'ere? */
$this->prefix = $this->settings['sql_tbl_prefix'];
}
示例4: doExecute
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return @e void
*/
public function doExecute(ipsRegistry $registry)
{
/* Remove the FURL cache */
@unlink(FURL_CACHE_PATH);
/* Got anything to show? */
$apps = explode(',', IPSSetUp::getSavedData('install_apps'));
$vNums = IPSSetUp::getSavedData('version_numbers');
$output = array();
if (is_array($apps) and count($apps)) {
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, $this->settings['gb_char_set']);
$appClasses[$app] = IPSSetUp::fetchVersionClasses($app, $vNums[$app], $numbers['latest'][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($this->registry);
if (method_exists($_tmp, 'postInstallNotices')) {
$_t = $_tmp->postInstallNotices();
if (is_array($_t) and count($_t)) {
$output[$app][$num] = array('long' => $nums[$app][$num], 'app' => $appData[$app], 'out' => implode("<br />", $_t));
}
}
}
}
}
}
}
/* Remove any SQL source files */
IPSSetUp::removeSqlSourceFiles();
/* Simply return the Done page */
$this->registry->output->setTitle("Complete!");
$this->registry->output->setHideButton(TRUE);
$this->registry->output->addContent($this->registry->output->template()->upgrade_complete($output));
$this->registry->output->sendOutput();
}
示例5: upgradeLogs
/**
* Upgrade log file tables
*
* @param int
* @return @e void
*/
public function upgradeLogs($id = 1)
{
/* Verify posts alter table query has run */
if ($id == 1) {
if (!$this->DB->checkForField('post_bwoptions', 'posts')) {
$this->_output = ' ';
$this->registry->output->addError("Вы должны выполнить запрос изменяющий таблицу posts. После того как вы выполните это, просто обновите данную страницу и обновление будет продолжено.");
return;
}
}
$cnt = 0;
$file = '_updates_logs_' . $id . '.php';
$output = "";
$path = IPSLib::getAppDir('core') . '/setup/versions/upg_32000/' . strtolower($this->registry->dbFunctions()->getDriverType()) . $file;
$prefix = $this->registry->dbFunctions()->getPrefix();
if (is_file($path)) {
$SQL = array();
$TABLE = '';
require $path;
/*noLibHook*/
/* Set DB driver to return any errors */
$this->DB->return_die = 1;
foreach ($SQL as $query) {
$this->DB->allow_sub_select = 1;
$this->DB->error = '';
/* Need to tack on a prefix? */
if ($prefix) {
$query = IPSSetUp::addPrefixToQuery($query, $prefix);
}
/* Chose to prune and run? */
if ($this->request['pruneAndRun']) {
$this->DB->delete($TABLE);
$man = false;
} else {
/* Show alter table / prune option? */
$man = IPSSetUp::getSavedData('man');
if ($TABLE) {
$count = $this->DB->buildAndFetch(array('select' => 'count(*) as logs', 'from' => $TABLE));
if ($count['logs'] > 100000) {
$man = true;
}
}
}
/* Show option to run manually or prune ? */
if ($man) {
$query = trim($query);
/* Ensure the last character is a semi-colon */
if (substr($query, -1) != ';') {
$query .= ';';
}
$output .= $query . "\n\n";
} else {
$this->DB->query($query);
if ($this->DB->error) {
$this->registry->output->addError("<br />" . $query . "<br />" . $this->DB->error);
} else {
$cnt++;
}
}
}
$this->registry->output->addMessage("{$cnt} запросов выполнено....");
}
/* Next Page */
if ($id < 10) {
$nextid = $id + 1;
$this->request['workact'] = 'logs' . $nextid;
} else {
$this->request['workact'] = 'forums';
}
if ($output) {
$this->_output = $this->registry->output->template()->upgrade_manual_queries_logs($output, $id, $TABLE);
}
}
示例6: upgrade_sql
function upgrade_sql($id = 1)
{
$man = 0;
// Manual upgrade ? intval( $this->request['man'] );
$cnt = 0;
$SQL = array();
$file = '_updates_' . $id . '.php';
$output = "";
$path = IPSLib::getAppDir('core') . '/setup/versions/upg_22005/' . strtolower($this->registry->dbFunctions()->getDriverType()) . $file;
$prefix = $this->registry->dbFunctions()->getPrefix();
if (is_file($path)) {
require_once $path;
/*noLibHook*/
$this->sqlcount = 0;
$output = "";
$this->DB->return_die = 1;
foreach ($SQL as $query) {
$this->DB->allow_sub_select = 1;
$this->DB->error = '';
$query = str_replace("<%time%>", time(), $query);
if ($this->settings['mysql_tbl_type']) {
if (preg_match("/^create table(.+?)/i", $query)) {
$query = preg_replace("/^(.+?)\\);\$/is", "\\1) ENGINE={$this->settings['mysql_tbl_type']};", $query);
}
}
/* Need to tack on a prefix? */
if ($prefix) {
$query = IPSSetUp::addPrefixToQuery($query, $prefix);
}
if (IPSSetUp::getSavedData('man')) {
$output .= preg_replace("/\\s{1,}/", " ", $query) . "\n\n";
} else {
$this->DB->query($query);
if ($this->DB->error) {
$this->registry->output->addError($query . "<br /><br />" . $this->DB->error);
} else {
$this->sqlcount++;
}
}
}
$this->registry->output->addMessage("{$this->sqlcount} запросов выполнено....");
}
//--------------------------------
// Next page...
//--------------------------------
$this->request['st'] = 0;
if ($id != 4) {
$nextid = $id + 1;
$this->request['workact'] = 'sql' . $nextid;
} else {
$this->request['workact'] = 'forums';
}
if (IPSSetUp::getSavedData('man') and $output) {
/* Create source file */
if ($this->registry->dbFunctions()->getDriverType() == 'mysql') {
$sourceFile = IPSSetUp::createSqlSourceFile($output, '22005', $id);
}
$this->_output = $this->registry->output->template()->upgrade_manual_queries($output, $sourceFile);
}
}
示例7: convert_polls
function convert_polls()
{
$start = intval($this->request['st']) > 0 ? intval($this->request['st']) : 0;
$lend = 50;
$end = $start + $lend;
$max = intval(IPSSetUp::getSavedData('max'));
$converted = intval(IPSSetUp::getSavedData('conv'));
//-----------------------------------------
// First off.. grab number of polls to convert
//-----------------------------------------
if (!$max) {
$total = $this->DB->buildAndFetch(array('select' => 'COUNT(*) as max', 'from' => 'topics', 'where' => "poll_state IN ('open', 'close', 'closed')"));
$max = $total['max'];
}
//-----------------------------------------
// In steps...
//-----------------------------------------
$this->DB->build(array('select' => '*', 'from' => 'topics', 'where' => "poll_state IN ('open', 'close', 'closed' )", 'limit' => array(0, $lend)));
$o = $this->DB->execute();
//-----------------------------------------
// Do it...
//-----------------------------------------
if ($this->DB->getTotalRows($o)) {
//-----------------------------------------
// Got some to convert!
//-----------------------------------------
while ($r = $this->DB->fetch($o)) {
$converted++;
//-----------------------------------------
// All done?
//-----------------------------------------
if ($converted >= $max) {
$done = 1;
}
$new_poll = array(1 => array());
$poll_data = $this->DB->buildAndFetch(array('select' => '*', 'from' => 'polls', 'where' => "tid=" . $r['tid']));
if (!$poll_data['pid']) {
continue;
}
if (!$poll_data['poll_question']) {
$poll_data['poll_question'] = $r['title'];
}
//-----------------------------------------
// Kick start new poll
//-----------------------------------------
$new_poll[1]['question'] = $poll_data['poll_question'];
//-----------------------------------------
// Get OLD polls
//-----------------------------------------
$poll_answers = unserialize(stripslashes($poll_data['choices']));
reset($poll_answers);
foreach ($poll_answers as $entry) {
$id = $entry[0];
$choice = $entry[1];
$votes = $entry[2];
$total_votes += $votes;
if (strlen($choice) < 1) {
continue;
}
$new_poll[1]['choice'][$id] = $choice;
$new_poll[1]['votes'][$id] = $votes;
}
//-----------------------------------------
// Got something?
//-----------------------------------------
if (count($new_poll[1]['choice'])) {
$this->DB->update('polls', array('choices' => serialize($new_poll)), 'tid=' . $r['tid']);
$this->DB->update('topics', array('poll_state' => 1), 'tid=' . $r['tid']);
}
}
} else {
$done = 1;
}
if (!$done) {
$this->registry->output->addMessage("Polls: {$start} to {$end} completed....");
$this->request['workact'] = 'polls';
$this->request['st'] = $end;
IPSSetUp::setSavedData('max', $max);
IPSSetUp::setSavedData('conv', $converted);
return FALSE;
} else {
$this->registry->output->addMessage("Polls converted, proceeding to calendar events...");
$this->request['workact'] = 'calevents';
$this->request['st'] = '0';
return FALSE;
}
}
示例8: cleanConfGlobal
/**
* Clean up conf global
* Removes data variables
*
* @access public
* @return boolean
*/
public static function cleanConfGlobal()
{
if ($contents = @file_get_contents(IPSSetUp::getSavedData('install_dir') . '/conf_global.php')) {
if ($contents) {
$contents = preg_replace("#/\\*~~DATA~~\\*/(.+?)\n/\\*\\*/#s", "", $contents);
return IPSSetUp::writeFile(IPSSetUp::getSavedData('install_dir') . '/conf_global.php', $contents);
}
}
return FALSE;
}
示例9: postInstallNotices
/**
* Return any post-installation notices
*
* @return array Array of notices
*/
public function postInstallNotices()
{
$options = IPSSetUp::getSavedData('custom_options');
$_doSkin = $options['core'][30001]['exportSkins'];
$_doLang = $options['core'][30001]['exportLangs'];
$rootAdmins = $options['core'][30001]['rootAdmins'];
$skipPms = $options['core'][30001]['skipPms'];
$notices = array();
if ($_doSkin) {
$notices[] = "Все старые стили сохранены в 'cache/previousSkinFiles'";
}
if ($_doLang) {
$notices[] = "Все старые языки сохранены в 'cache/previousLangFiles'";
}
if ($skipPms) {
$notices[] = "Конвертация личных сообщений пропущена. Для конвертации личных сообщений в будущем воспользуйтесь shell-скриптом из директории 'tools' дистрибутива";
}
/* Notice about post content */
$notices[] = "Теперь вам необходимо обновить содержимое всех сообщений через админцентр (Система > Пересчет и обновление). <br />";
/* Notice about admin restrictions */
$notices[] = "Из-за изменений в системе прав доступа. Все администраторы, имевшие ограничения, будут лишены доступа ко всем модулям, пока вы не измените права.";
/* Notice about admin restrictions */
if ($rootAdmins) {
$notices[] = "Были сброшены все ограничения для доступа в админцентр Вы можете восстановить их через АЦ.<br />";
} else {
$notices[] = "Все администраторы получили полный доступ к админцентру. Вы можете ограничить их доступ через АЦ.<br />";
}
/* Notice about custom time settings */
$notices[] = "Формат показа времени изменен в настройках.<br />";
/* Notice about FURLs */
$notices[] = "Для использования Friendly URLs (ЧПУ), добавьте в ваш conf_global.php строчку: \$INFO['use_friendly_urls'] = '1';.";
return $notices;
}
示例10: doExecute
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return @e void
*/
public function doExecute(ipsRegistry $registry)
{
/* Delete sessions and continue */
if ($this->request['do'] == 'rsessions') {
IPSSetUp::removePreviousSession();
}
/* Rebuild from last session and continue */
if ($this->request['do'] == 'rcontinue') {
$oldSession = IPSSetUp::checkForPreviousSessions();
if (count($oldSession) and $oldSession['_session_get']['section'] and $oldSession['_sd']['install_apps']) {
IPSSetUp::restorePreviousSession($oldSession);
exit;
}
}
/* Check for failed upgrade */
if (!$this->request['do'] or $this->request['do'] != 'rsessions') {
$oldSession = IPSSetUp::checkForPreviousSessions();
if (count($oldSession) and $oldSession['_session_get']['section'] and $oldSession['_sd']['install_apps']) {
/* Page Output */
$this->registry->output->setTitle("Applications");
$this->registry->output->setNextAction('apps&do=rsessions');
//$this->registry->output->setHideButton( TRUE );
$this->registry->output->addContent($this->registry->output->template()->upgrade_previousSession($oldSession));
$this->registry->output->sendOutput();
}
}
/* Save data */
if ($this->request['do'] == 'save') {
$apps = explode(',', IPSSetUp::getSavedData('install_apps'));
$toSave = array();
$vNums = array();
if (is_array($apps) and count($apps)) {
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, $this->settings['gb_char_set']);
$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($this->registry);
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);
}
}
}
/* Next Action */
$this->registry->autoLoadNextAction('license');
} else {
if ($this->request['do'] == 'check') {
/* Check Directory */
if (!is_array($_POST['apps']) or !count($_POST['apps'])) {
/* We use 'warning' because it has same effect but does not block the 'next' button (which they'll want to use after selecting an app when page reloads) */
$this->registry->output->addWarning('You must select to upgrade at least one application');
} else {
/* If it's lower than 3.0.0, then add in the removed apps */
if (IPSSetUp::is300plus() !== TRUE) {
$_POST['apps']['forums'] = 1;
$_POST['apps']['members'] = 1;
$_POST['apps']['calendar'] = 1;
$_POST['apps']['chat'] = 1;
} else {
if ($_POST['apps']['core']) {
$_POST['apps']['forums'] = 1;
$_POST['apps']['members'] = 1;
}
}
/* Save Form Data */
IPSSetUp::setSavedData('install_apps', implode(',', array_keys($_POST['apps'])));
//.........这里部分代码省略.........
示例11: doExecute
/**
* Execute selected method
*
* @access public
* @param object Registry object
* @return void
*/
public function doExecute(ipsRegistry $registry)
{
/* Save data */
if ($this->request['do'] == 'save') {
$apps = explode(',', IPSSetUp::getSavedData('install_apps'));
$toSave = array();
$vNums = array();
if (is_array($apps) and count($apps)) {
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 (file_exists(IPSLib::getAppDir($app) . '/setup/versions/upg_' . $num . '/version_class.php')) {
$_class = 'version_class_' . $num;
require_once IPSLib::getAppDir($app) . '/setup/versions/upg_' . $num . '/version_class.php';
$_tmp = new $_class($this->registry);
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);
}
}
}
/* Next Action */
$this->registry->autoLoadNextAction('upgrade');
} else {
if ($this->request['do'] == 'check') {
/* Check Directory */
if (!is_array($_POST['apps']) or !count($_POST['apps'])) {
$this->registry->output->addError('You must select to upgrade at least one application');
} else {
/* If it's lower than 3.0.0, then add in the removed apps */
if (IPSSetUp::is300plus() !== TRUE) {
$_POST['apps']['forums'] = 1;
$_POST['apps']['members'] = 1;
$_POST['apps']['calendar'] = 1;
$_POST['apps']['chat'] = 1;
$_POST['apps']['portal'] = 1;
//$_POST['apps']['subscriptions'] = 1;
} else {
if ($_POST['apps']['core']) {
$_POST['apps']['forums'] = 1;
$_POST['apps']['members'] = 1;
}
}
/* Save Form Data */
IPSSetUp::setSavedData('install_apps', implode(',', array_keys($_POST['apps'])));
/* Got any app-version classes? */
$appClasses = array();
$output = array();
$nums = array();
$appData = array();
foreach ($_POST['apps'] as $app => $val) {
/* 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]);
}
/* Got anything? */
if (count($appClasses)) {
foreach ($appClasses as $app => $data) {
foreach ($data as $num) {
if (file_exists(IPSLib::getAppDir($app) . '/setup/versions/upg_' . $num . '/version_class.php')) {
$_class = 'version_class_' . $num;
require_once IPSLib::getAppDir($app) . '/setup/versions/upg_' . $num . '/version_class.php';
$_tmp = new $_class($this->registry);
if (method_exists($_tmp, 'preInstallOptionsForm')) {
$_t = $_tmp->preInstallOptionsForm();
//.........这里部分代码省略.........
示例12: fetchNextApplication
/**
* Fetch next application
*
* @access public
* @param string Previous application
* @param string XML file to search for. If supplied, function will return next app that has the XML file. Use {app} for $app ({app}_settings.xml)
* @param string Charset (used post-install)
* @return mixed
*/
public static function fetchNextApplication($previous = '', $xmlFileSearch = '', $charset = '')
{
//-----------------------------------------
// INIT
//-----------------------------------------
$apps = explode(",", IPSSetUp::getSavedData('install_apps'));
$return = FALSE;
$flag = $previous ? 0 : 1;
$array = array();
if (!count($apps) or !count($apps)) {
return FALSE;
}
foreach ($apps as $_app) {
# Looking for an XML file?
if ($xmlFileSearch) {
$_xmlFileSearch = str_replace('{app}', $_app, $xmlFileSearch);
if (!is_file(IPSLib::getAppDir($_app) . '/xml/' . $_xmlFileSearch)) {
continue;
}
}
# Flag raised? Grab it!
if ($flag) {
$return = $_app;
break;
}
# Got this one? Set the flag
if ($_app == $previous) {
$flag = 1;
}
}
//-----------------------------------------
// Got something?
//-----------------------------------------
if ($return) {
$result = self::fetchXmlAppInformation($return, $charset);
if ($result) {
return $result;
} else {
return self::fetchNextApplication($return, $xmlFileSearch, $charset);
}
}
return FALSE;
}
示例13: step_21
function step_21()
{
#$SQL[] = "alter table ".ipsRegistry::dbFunctions()->getPrefix()."posts drop index topic_id;";
$SQL[] = "alter table " . ipsRegistry::dbFunctions()->getPrefix() . "posts drop index author_id;";
#$SQL[] = "alter table ".ipsRegistry::dbFunctions()->getPrefix()."posts add index topic_id (topic_id, queued, pid);";
$SQL[] = "alter table " . ipsRegistry::dbFunctions()->getPrefix() . "posts add index author_id( author_id, topic_id);";
$SQL[] = "ALTER TABLE " . ipsRegistry::dbFunctions()->getPrefix() . "posts DROP INDEX forum_id, ADD INDEX(post_date);";
$this->error = array();
$this->sqlcount = 0;
$output = "";
$this->DB->return_die = 1;
foreach ($SQL as $query) {
$this->DB->allow_sub_select = 1;
$this->DB->error = '';
if (IPSSetUp::getSavedData('man')) {
$output .= preg_replace("/\\sibf_(\\S+?)([\\s\\.,]|\$)/", " " . $this->DB->obj['sql_tbl_prefix'] . "\\1\\2", preg_replace("/\\s{1,}/", " ", $query)) . "\n\n";
} else {
$this->DB->query($query);
if ($this->DB->error) {
$this->registry->output->addError($query . "<br /><br />" . $this->DB->error);
} else {
$this->sqlcount++;
}
}
}
$this->registry->output->addMessage("Optimization completed");
$this->request['workact'] = 'step_22';
if (IPSSetUp::getSavedData('man') and $output) {
$this->_output = $this->registry->output->template()->upgrade_manual_queries($output);
}
unset($this->request['workact']);
unset($this->request['st']);
}
示例14: _setUpDBDriver
/**
* Set up DB driver
*
* @access private
* @param bool Whether the DB driver returns with an error or not
* @return @e void
*/
private function _setUpDBDriver($returnDie = TRUE)
{
$extra_install = '';
//--------------------------------------------------
// Any "extra" configs required for this driver?
//--------------------------------------------------
if (is_file(IPS_ROOT_PATH . 'setup/sql/' . strtolower(IPSSetUp::getSavedData('sql_driver')) . '_install.php')) {
require_once IPS_ROOT_PATH . 'setup/sql/' . strtolower(IPSSetUp::getSavedData('sql_driver')) . '_install.php';
/*noLibHook*/
$extra_install = new install_extra($this->registry);
}
//-----------------------------------------
// Set DB Handle
//-----------------------------------------
$this->registry->loadConfGlobal();
$this->registry->setDBHandle();
$this->DB = $this->registry->DB();
/* Return error? */
if ($returnDie === TRUE) {
$this->DB->return_die = 1;
}
return $extra_install;
}
示例15: array
<?php
/*
* Returns known settings
*
* No, really it does!
*
* Remember: ipsRegistry::$settings probably won't be available.
*
*
* IPSSetUp::getSavedData('admin_email')
* IPSSetUp::getSavedData('install_dir') [Example: /home/user/public_html/forums] - No trailing slash supplied
* IPSSetUp::getSavedData('install_url') [Example: http://www.domain.tld/forums] - No trailing slash supplied
*/
$knownSettings = array('email_in' => IPSSetUp::getSavedData('admin_email'), 'email_out' => IPSSetUp::getSavedData('admin_email'), 'base_dir' => IPSSetUp::getSavedData('install_dir'), 'css_cache_url' => IPSSetUp::getSavedData('install_url') . '/public/style_images', 'upload_url' => IPSSetUp::getSavedData('install_url') . '/uploads', 'upload_dir' => IPSSetUp::getSavedData('install_dir') . '/uploads', 'search_sql_method' => ipsRegistry::DB()->checkFulltextSupport() ? 'ftext' : 'man', 'safe_mode_skins' => @ini_get("safe_mode") ? 1 : 0);