Version 4.2.0

This commit is contained in:
Neo committed 2025-12-19 05:44:59 -08:00
1 parent 0dc2aee5ed
commit 96997ddd8e
2074 files changed
+125454 -55780

No files matched your search

+48 -67
View File
@@ -1,12 +1,11 @@
<?php
/**
* @brief Upgrade steps
* @author <a href='http://www.invisionpower.com'>Invision Power Services, Inc.</a>
* @copyright (c) 2001 - 2016 Invision Power Services, Inc.
* @license http://www.invisionpower.com/legal/standards/
* @package IPS Community Suite
* @author <a href='https://www.invisioncommunity.com'>Invision Power Services, Inc.</a>
* @copyright (c) Invision Power Services, Inc.
* @license https://www.invisioncommunity.com/legal/standards/
* @package Invision Community
* @since 5 Jun 2014
* @version SVN_VERSION_NUMBER
*/
namespace IPS\core\setup\upg_33000;
@@ -454,6 +453,16 @@ class _Upgrade
'columns' => array( 'item_member_id', 'item_app', 'item_app_key_1' )
) );
return TRUE;
}
/**
* Step 2
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
{
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( array( array(
'table' => 'members',
'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "members ADD COLUMN unacknowledged_warnings TINYINT(1) NULL DEFAULT NULL;"
@@ -466,7 +475,7 @@ class _Upgrade
if ( count( $toRun ) )
{
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 2 ) ) );
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 3 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr ) ) ) );
@@ -477,11 +486,11 @@ class _Upgrade
}
/**
* Step 2
* Step 3
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step2()
public function step3()
{
\IPS\Db::i()->createTable( array(
'name' => 'core_archive_log',
@@ -926,11 +935,11 @@ class _Upgrade
}
/**
* Step 3
* Step 4
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step3()
public function step4()
{
$queries = array( array(
'table' => 'topics',
@@ -970,7 +979,7 @@ class _Upgrade
if ( count( $toRun ) )
{
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 4 ) ) );
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 5 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr ) ) ) );
@@ -980,11 +989,11 @@ class _Upgrade
}
/**
* Step 4
* Step 5
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step4()
public function step5()
{
/* Init */
$pergo = 100;
@@ -1109,11 +1118,11 @@ class _Upgrade
}
/**
* Step 5
* Step 6
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step5()
public function step6()
{
foreach( \IPS\Db::i()->select( '*', 'forums', "rules_text LIKE '%&%'" ) as $row )
{
@@ -1135,11 +1144,11 @@ class _Upgrade
}
/**
* Step 6
* Step 7
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step6()
public function step7()
{
foreach( \IPS\Db::i()->select( '*', 'groups' ) as $row )
{
@@ -1152,75 +1161,47 @@ class _Upgrade
}
/**
* Step 7
* Step 8
*
* @return array If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
*/
public function step7()
public function step8()
{
/* If we have a lot of posts, prompt to run manually */
if( \IPS\Db::i()->select( 'count(*)', 'posts' )->first() > 100000 )
{
$queries = array();
if ( !\IPS\Db::i()->checkForColumn( 'posts', 'post_field_int' ) )
{
$queries[] = "ALTER TABLE " . \IPS\Db::i()->prefix . "posts ADD post_field_int INT(10) NOT NULL DEFAULT 0;";
}
if ( !\IPS\Db::i()->checkForColumn( 'posts', 'post_field_t1' ) )
{
$queries[] = "ALTER TABLE " . \IPS\Db::i()->prefix . "posts ADD post_field_t1 TEXT NULL DEFAULT NULL;";
}
if ( !\IPS\Db::i()->checkForColumn( 'posts', 'post_field_t2' ) )
{
$queries[] = "ALTER TABLE " . \IPS\Db::i()->prefix . "posts ADD post_field_t2 TEXT NULL DEFAULT NULL;";
}
if( !count( $queries ) )
{
return TRUE;
}
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 8 ) ) );
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $queries, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr ) ) ) );
}
$queries = array();
if ( !\IPS\Db::i()->checkForColumn( 'posts', 'post_field_int' ) )
{
\IPS\Db::i()->addColumn( 'posts', array(
'name' => 'post_field_int',
'type' => 'int',
'length' => 10,
'allow_null' => false,
'default' => 0
) );
$queries[] = array( 'table' => 'posts', 'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "posts ADD post_field_int INT(10) NOT NULL DEFAULT 0;" );
}
if ( !\IPS\Db::i()->checkForColumn( 'posts', 'post_field_t1' ) )
{
\IPS\Db::i()->addColumn( 'posts', array(
'name' => 'post_field_t1',
'type' => 'text',
'allow_null' => true,
'default' => null
) );
$queries[] = array( 'table' => 'posts', 'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "posts ADD post_field_t1 TEXT NULL DEFAULT NULL;" );
}
if ( !\IPS\Db::i()->checkForColumn( 'posts', 'post_field_t2' ) )
{
\IPS\Db::i()->addColumn( 'posts', array(
'name' => 'post_field_t2',
'type' => 'text',
'allow_null' => true,
'default' => null
) );
$queries[] = array( 'table' => 'posts', 'query' => "ALTER TABLE " . \IPS\Db::i()->prefix . "posts ADD post_field_t2 TEXT NULL DEFAULT NULL;" );
}
if( !count( $queries ) )
{
return TRUE;
}
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $queries );
if ( count( $toRun ) )
{
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( array( 1 => 'core', 'extra' => array( '_upgradeStep' => 9 ) ) );
/* Queries to run manually */
return array( 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( array( 'key' => $_SESSION['uniqueKey'], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr ) ) ) );
}
/* @note Previously we gave the option of flagging users in the banned group as banned, but we force that in 4.0 anyways so no need now */
/* Finish */
return TRUE;
}
}