Version 3.2.3

This commit is contained in:
Neo committed 2025-12-19 00:34:03 -08:00
1 parent ae5c01cc78
commit 78706903a2
2641 files changed
+228363 -201264

No files matched your search

@@ -2,17 +2,17 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.1.4
* IP.Board v3.2.3
* Installer: Upgrader core file
* Last Updated: $LastChangedDate: 2010-09-15 17:14:23 -0400 (Wed, 15 Sep 2010) $
* Last Updated: $LastChangedDate: 2011-09-27 21:33:45 -0400 (Tue, 27 Sep 2011) $
* </pre>
*
* @author $Author: terabyte $
* @author $Author: bfarber $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/community/board/license.html
* @license This is NULLED!
* @package IP.Board
* @link http://www.invisionpower.com
* @version $Rev: 6881 $
* @link http://hatynka.in
* @version $Rev: 9556 $
*
*/
@@ -83,7 +83,7 @@ class upgrade_upgrade extends ipsCommand
*
* @access public
* @param object Registry object
* @return void
* @return @e void
*/
public function doExecute( ipsRegistry $registry )
{
@@ -262,9 +262,9 @@ class upgrade_upgrade extends ipsCommand
$file = IPSLib::getAppDir( $this->_currentApp ) . '/setup/versions/upg_' . $this->_uipLong . '/' . $this->_dbDriver . '_updates.php';
/* Get file */
if ( file_exists( $file ) )
if ( is_file( $file ) )
{
require( $file );
require( $file );/*noLibHook*/
if ( is_array( $SQL ) AND count( $SQL ) > 0 )
{
@@ -284,7 +284,7 @@ class upgrade_upgrade extends ipsCommand
{
if ( preg_match( "/^create table(.+?)/i", $q ) )
{
$q = preg_replace( "/^(.+?)\);$/is", "\\1) TYPE={$this->settings['mysql_tbl_type']};", $q );
$q = preg_replace( "/^(.+?)\);$/is", "\\1) ENGINE={$this->settings['mysql_tbl_type']};", $q );
}
}
@@ -386,11 +386,11 @@ class upgrade_upgrade extends ipsCommand
$fileLegacy = IPSLib::getAppDir( $this->_currentApp ) . '/setup/versions/upg_' . $this->_uipLong . '/version_upgrade_' . $this->_dbDriver . '.php';
/* Got any file? */
if ( file_exists( $fileNewer ) )
if ( is_file( $fileNewer ) )
{
$file = $fileNewer;
}
else if ( file_exists( $fileLegacy ) )
else if ( is_file( $fileLegacy ) )
{
$file = $fileLegacy;
}
@@ -398,7 +398,7 @@ class upgrade_upgrade extends ipsCommand
/* Do we have a file? */
if ( $file )
{
require_once( $file );
require_once( $file );/*noLibHook*/
$upgrade = new version_upgrade();
$result = $upgrade->doExecute( $this->registry );
@@ -454,7 +454,9 @@ class upgrade_upgrade extends ipsCommand
$_in = ( $this->_currentApp == 'core' ) ? "'core', 'forums', 'members'" : "'" . $this->_currentApp . "'";
$this->DB->update( 'core_applications', array( 'app_long_version' => $this->_uipLong,
'app_version' => $this->_uipHuman ), 'app_directory IN (' . $_in . ')' );
'app_version' => $this->_uipHuman,
'app_website' => $this->_appData['website'],
'app_update_check' => $this->_appData['update_check'] ), 'app_directory IN (' . $_in . ')' );
}
else
{
@@ -507,7 +509,9 @@ class upgrade_upgrade extends ipsCommand
$_in = ( $this->_currentApp == 'core' ) ? "'core', 'forums', 'members'" : "'" . $this->_currentApp . "'";
$this->DB->update( 'core_applications', array( 'app_long_version' => $this->_uipLong,
'app_version' => $this->_uipHuman ), 'app_directory IN (' . $_in . ')' );
'app_version' => $this->_uipHuman,
'app_website' => $this->_appData['website'],
'app_update_check' => $this->_appData['update_check'] ), 'app_directory IN (' . $_in . ')' );
}
else
{
@@ -612,9 +616,9 @@ class upgrade_upgrade extends ipsCommand
$output[] = $next['title'] . ": Обновление модулей";
$_PATH = IPSLib::getAppDir( $next['key'] ) . '/xml/';
if ( file_exists( $_PATH . $next['key'] . '_modules.xml' ) )
if ( is_file( $_PATH . $next['key'] . '_modules.xml' ) )
{
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/applications/applications.php' );
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/applications/applications.php' );/*noLibHook*/
$apps = new admin_core_applications_applications();
$apps->makeRegistryShortcuts( $this->registry );
@@ -668,14 +672,14 @@ class upgrade_upgrade extends ipsCommand
$output[] = $next['title'] . ": Обновление настроек";
$_PATH = IPSLib::getAppDir( $next['key'] ) . '/xml/';
if ( file_exists( $_PATH . $next['key'] . '_settings.xml' ) )
if ( is_file( $_PATH . $next['key'] . '_settings.xml' ) )
{
//-----------------------------------------
// Continue
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/tools/settings.php' );
$settings = new admin_core_tools_settings();
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/settings/settings.php' );/*noLibHook*/
$settings = new admin_core_settings_settings();
$settings->makeRegistryShortcuts( $this->registry );
$this->request['app_dir'] = $next['key'];
@@ -696,9 +700,9 @@ class upgrade_upgrade extends ipsCommand
/* Fetch known settings */
$knownSettings = array();
if ( file_exists( IPSLib::getAppDir( $next['key'] ) . '/setup/versions/install/knownSettings.php' ) )
if ( is_file( IPSLib::getAppDir( $next['key'] ) . '/setup/versions/install/knownSettings.php' ) )
{
require( IPSLib::getAppDir( $next['key'] ) . '/setup/versions/install/knownSettings.php' );
require( IPSLib::getAppDir( $next['key'] ) . '/setup/versions/install/knownSettings.php' );/*noLibHook*/
}
$settings->importAllSettings( 1, 1, $knownSettings );
@@ -737,9 +741,9 @@ class upgrade_upgrade extends ipsCommand
$previous = $_REQUEST['previous'];
if ( file_exists( IPS_ROOT_PATH .'setup/sql/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . '_install.php' ) )
if ( is_file( IPS_ROOT_PATH .'setup/sql/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . '_install.php' ) )
{
require_once( IPS_ROOT_PATH .'setup/sql/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . '_install.php' );
require_once( IPS_ROOT_PATH .'setup/sql/' . strtolower( $this->registry->dbFunctions()->getDriverType() ) . '_install.php' );/*noLibHook*/
$extra_install = new install_extra( $this->registry );
}
@@ -762,7 +766,7 @@ class upgrade_upgrade extends ipsCommand
$output[] = "Добавление шаблонов";
require_once( IPS_KERNEL_PATH . 'classXML.php' );
require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/
$xml = new classXML( IPSSetUp::charSet );
//-----------------------------------------
@@ -775,7 +779,7 @@ class upgrade_upgrade extends ipsCommand
}
/* Skin Set Data */
$xml->load( IPS_PUBLIC_PATH . 'resources/skins/setsData.xml' );
$xml->load( IPS_ROOT_PATH . 'setup/xml/skins/setsData.xml' );
foreach( $xml->fetchElements( 'set' ) as $xmlelement )
{
@@ -795,9 +799,9 @@ class upgrade_upgrade extends ipsCommand
}
/* Load skin classes */
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );/*noLibHook*/
$skinFunctions = new skinImportExport( $this->registry );
@@ -831,7 +835,7 @@ class upgrade_upgrade extends ipsCommand
$output[] = $next['title'] . ": Обновление шаблонов {$skinData['set_name']}";
if ( file_exists( $_PATH . $next['key'] . '_' . $skinKey . '_templates.xml' ) )
if ( is_file( $_PATH . $next['key'] . '_' . $skinKey . '_templates.xml' ) )
{
//-----------------------------------------
// Install
@@ -842,7 +846,7 @@ class upgrade_upgrade extends ipsCommand
$output[] = $next['title'] . ": " . intval( $return['insertCount'] ) . " шаблонов добавлено";
}
if ( file_exists( $_PATH . $next['key'] . '_' . $skinKey . '_css.xml' ) )
if ( is_file( $_PATH . $next['key'] . '_' . $skinKey . '_css.xml' ) )
{
//-----------------------------------------
// Install
@@ -871,12 +875,14 @@ class upgrade_upgrade extends ipsCommand
foreach( $skinSets as $skinKey => $skinData )
{
/* Replacements */
if ( file_exists( IPS_PUBLIC_PATH . 'resources/skins/replacements_' . $skinKey . '.xml' ) )
if ( is_file( IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $skinKey . '.xml' ) )
{
$skinFunctions->importReplacementsXMLArchive( file_get_contents( IPS_PUBLIC_PATH . 'resources/skins/replacements_' . $skinKey . '.xml' ), $skinKey );
$skinFunctions->importReplacementsXMLArchive( file_get_contents( IPS_ROOT_PATH . 'setup/xml/skins/replacements_' . $skinKey . '.xml' ), $skinKey );
}
}
$skinFunctions->rebuildMobileSkinUserAgentsFromSetDataXml();
$skinFunctions->rebuildSkinSetsCache();
$output[] = "Все шаблоны обновлены";
@@ -914,13 +920,13 @@ class upgrade_upgrade extends ipsCommand
$output[] = $next['title'] . ": Обновление задач";
$_PATH = IPSLib::getAppDir( $next['key'] ) . '/xml/';
if ( file_exists( $_PATH . $next['key'] . '_tasks.xml' ) )
if ( is_file( $_PATH . $next['key'] . '_tasks.xml' ) )
{
//-----------------------------------------
// Continue
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/system/taskmanager.php' );
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/system/taskmanager.php' );/*noLibHook*/
$tasks = new admin_core_system_taskmanager();
$tasks->makeRegistryShortcuts( $this->registry );
@@ -977,7 +983,7 @@ class upgrade_upgrade extends ipsCommand
// Get the language stuff
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php' );
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php' );/*noLibHook*/
$lang = new admin_core_languages_manage_languages();
$lang->makeRegistryShortcuts( $this->registry );
@@ -1054,7 +1060,7 @@ class upgrade_upgrade extends ipsCommand
// Get the language stuff
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php' );
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/languages/manage_languages.php' );/*noLibHook*/
$lang = new admin_core_languages_manage_languages();
$lang->makeRegistryShortcuts( $this->registry );
@@ -1076,7 +1082,7 @@ class upgrade_upgrade extends ipsCommand
//-----------------------------------------
$this->request['file_location'] = $_PATH . $f->getFileName();
$lang->imprtFromXML( true, true, true, $next['key'], false, 1 );
$lang->imprtFromXML( true, true, true, $next['key'], true, 1 );
}
}
} catch ( Exception $e ) {}
@@ -1127,29 +1133,34 @@ class upgrade_upgrade extends ipsCommand
$output[] = $next['title'] . ": Обновление BB-кодов";
$_PATH = IPSLib::getAppDir( $next['key'] ) . '/xml/';
if ( file_exists( $_PATH . $next['key'] . '_bbcode.xml' ) )
if ( is_file( $_PATH . $next['key'] . '_bbcode.xml' ) )
{
//-----------------------------------------
// Continue
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/bbcode.php' );
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/bbcode.php' );/*noLibHook*/
$bbcode = new admin_core_posts_bbcode();
$bbcode->makeRegistryShortcuts( $this->registry );
$bbcode->bbcodeImportDo( file_get_contents( $_PATH . $next['key'] . '_bbcode.xml' ) );
$_contents = file_get_contents( $_PATH . $next['key'] . '_bbcode.xml' );
if( $_contents )
{
$bbcode->bbcodeImportDo( $_contents );
}
}
$output[] = $next['title'] . ": Обновление медиа тегов";
$_PATH = IPSLib::getAppDir( $next['key'] ) . '/xml/';
if ( file_exists( $_PATH . $next['key'] . '_mediatag.xml' ) )
if ( is_file( $_PATH . $next['key'] . '_mediatag.xml' ) )
{
//-----------------------------------------
// Continue
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/media.php' );
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/posts/media.php' );/*noLibHook*/
$bbcode = new admin_core_posts_media();
$bbcode->makeRegistryShortcuts( $this->registry );
@@ -1193,7 +1204,7 @@ class upgrade_upgrade extends ipsCommand
$next = IPSSetUp::fetchNextApplication( $previous, '{app}_help.xml', $this->settings['gb_char_set'] );
require_once( IPS_KERNEL_PATH . 'classXML.php' );
require_once( IPS_KERNEL_PATH . 'classXML.php' );/*noLibHook*/
$xml = new classXML( IPSSetUp::charSet );
//-----------------------------------------
@@ -1202,15 +1213,17 @@ class upgrade_upgrade extends ipsCommand
if ( $next['key'] )
{
$output[] = $next['title'] . ": Обновление разделов помощи";
$_PATH = IPSLib::getAppDir( $next['key'] ) . '/xml/';
$output[] = $next['title'] . ": Upgrading Public Help...";
if ( file_exists( $_PATH . $next['key'] . '_help.xml' ) )
if ( is_file( $_PATH . $next['key'] . '_help.xml' ) )
{
//-----------------------------------------
// Do it..
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/tools/help.php' );
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/tools/help.php' );/*noLibHook*/
$help = new admin_core_tools_help();
$help->makeRegistryShortcuts( $this->registry );
@@ -1267,13 +1280,13 @@ class upgrade_upgrade extends ipsCommand
$output[] = $next['title'] . ": Обновление модификаций";
$_PATH = IPSLib::getAppDir( $next['key'] ) . '/xml/';
if ( file_exists( $_PATH . 'hooks.xml' ) )
if ( is_file( $_PATH . 'hooks.xml' ) )
{
//-----------------------------------------
// Continue
//-----------------------------------------
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/applications/hooks.php' );
require_once( IPS_ROOT_PATH . 'applications/core/modules_admin/applications/hooks.php' );/*noLibHook*/
$hooks = new admin_core_applications_hooks();
$hooks->makeRegistryShortcuts( $this->registry );
@@ -1290,32 +1303,17 @@ class upgrade_upgrade extends ipsCommand
}
else
{
//-----------------------------------------
// ****** USER AGENTS
//-----------------------------------------
$output[] = "Добавление user-agent`ов по-умолчанию";
require_once( IPS_ROOT_PATH . 'sources/classes/useragents/userAgentFunctions.php' );
require_once( IPS_ROOT_PATH . 'sources/classes/useragents/userAgentFunctions.php' );/*noLibHook*/
$userAgentFunctions = new userAgentFunctions( $this->registry );
$userAgentFunctions->rebuildMasterUserAgents();
//-----------------------------------------
// Build Calendar RSS
//-----------------------------------------
if( IPSLib::appIsInstalled('calendar') )
{
require_once( IPSLib::getAppDir('calendar') . '/modules_admin/calendar/calendars.php' );
$cal = new admin_calendar_calendar_calendars();
$cal->makeRegistryShortcuts( $this->registry );
$output[] = "Обновление RSS календаря";
$cal->calendarRSSCache();
}
//-----------------------------------------
// Next...
//-----------------------------------------
@@ -1353,11 +1351,11 @@ class upgrade_upgrade extends ipsCommand
{
$_PATH = IPSLib::getAppDir( $next['key'] ) . '/extensions/';
if ( file_exists( $_PATH . 'coreVariables.php' ) )
if ( is_file( $_PATH . 'coreVariables.php' ) )
{
# Grab cache master file
$CACHE = array();
require_once( $_PATH . 'coreVariables.php' );
require_once( $_PATH . 'coreVariables.php' );/*noLibHook*/
if ( is_array( $CACHE ) && count( $CACHE ) )
{
@@ -1396,7 +1394,7 @@ class upgrade_upgrade extends ipsCommand
//-----------------------------------------
# Grab cache master file
require_once( IPS_ROOT_PATH . 'extensions/coreVariables.php' );
require_once( IPS_ROOT_PATH . 'extensions/coreVariables.php' );/*noLibHook*/
/* Add handle */
$_tmp = new coreVariables();
@@ -1427,12 +1425,49 @@ class upgrade_upgrade extends ipsCommand
//-------------------------------------------------------------
$output[] = "Обновление кеша системных переменных";
$cache = array( 'mail_queue' => 0,
'task_next_run' => time() + 3600 );
$cache = ipsRegistry::cache()->getCache( 'systemvars' );
$cache['task_next_run'] = time() + 3600;
$cache['mail_queue'] = 0;
ipsRegistry::cache()->setCache( 'systemvars', $cache, array( 'array' => 1 ) );
//-------------------------------------------------------------
// License Key
//-------------------------------------------------------------
if( ipsRegistry::$settings['ipb_reg_number'] )
{
$output[] = "Обновление данных о лицензии...";
require_once( IPS_KERNEL_PATH . 'classFileManagement.php' );/*noLibHook*/
$this->classFileManagement = new classFileManagement();
/* Query the api */
$response = $this->classFileManagement->getFileContents( "http://myipb.in/license.php?lk=" . ipsRegistry::$settings['ipb_reg_number'] . "&url=" . ipsRegistry::$settings['board_url'] . "&flush=1" );
/* Get License Data */
$licenseData = json_decode( $response, true );
/* Copyright Removal? */
if ( $licenseData['cr'] )
{
IPSLib::updateSettings( array( 'ipb_copy_number' => $licenseData['cr'], 'ips_cp_purchase' => 1 ) );
}
elseif ( $this->settings['ips_cp_purchase'] )
{
IPSLib::updateSettings( array( 'ips_cp_purchase' => 0 ) );
}
/* Save to cache */
$licenseData['_cached_date'] = time();
$licenseData['key']['_expires'] = $licenseData['key']['_expires'] ? $licenseData['key']['_expires'] : 9999999999;
$licenseData['key']['expires'] = $licenseData['key']['expires'] ? $licenseData['key']['expires'] : 9999999999;
ipsRegistry::cache()->setCache( 'licenseData', $licenseData, array( 'array' => 1 ) );
}
$output[] = "Весь кеш обновлен";
$this->_finishStep( $output, "Обновление: Кеш", 'upgrade&do=templatecache' );
@@ -1468,9 +1503,9 @@ class upgrade_upgrade extends ipsCommand
//-----------------------------------------
/* Load skin classes */
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinFunctions.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinCaching.php' );/*noLibHook*/
require_once( IPS_ROOT_PATH . 'sources/classes/skins/skinImportExport.php' );/*noLibHook*/
$skinFunctions = new skinImportExport( $this->registry );
@@ -1519,10 +1554,11 @@ class upgrade_upgrade extends ipsCommand
$skinFunctions->rebuildSkinSetsCache();
/* Rebuild FURL cache */
/* Rebuild FURL & GLOBAL caches */
try
{
IPSLib::cacheFurlTemplates();
IPSLib::cacheGlobalCaches();
}
catch( Exception $error )
{
@@ -1551,7 +1587,7 @@ class upgrade_upgrade extends ipsCommand
* @param string output
* @param string title
* @param string next step
* @return void
* @return @e void
*/
private function _finishStep( $output, $title, $nextStep )
{