Version 4.7.8

This commit is contained in:
Neo committed 2025-12-19 16:10:42 -08:00
1 parent 7b7404e741
commit fd22d99e69
688 files changed
+19814 -10890

No files matched your search

@@ -0,0 +1,63 @@
<?php
/**
* @brief 4.7.8 Beta 1 Upgrade Code
* @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 07 Feb 2023
*/
namespace IPS\core\setup\upg_107640;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
exit;
}
/**
* 4.7.8 Beta 1 Upgrade Code
*/
class _Upgrade
{
/**
* ...
*
* @return bool|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 step1()
{
$queries = [];
/* Get all existing Content Classes */
foreach( \IPS\Application::allExtensions( 'core', 'ContentRouter', FALSE ) AS $contentRouter )
{
foreach ( $contentRouter->classes as $class )
{
/* If the class uses polls, update the poll class */
if( \in_array( 'IPS\Content\Polls', \class_implements( $class ) ) AND isset( $class::$databaseColumnMap['poll'] ) )
{
$queries[] =
[
'table' => 'core_polls',
'query' => 'UPDATE ' . \IPS\Db::i()->prefix . "core_polls SET poll_item_class='" . \IPS\Db::i()->escape_string( $class ) . "' WHERE pid in( SELECT " . $class::$databasePrefix . $class::$databaseColumnMap['poll'] . ' FROM ' . \IPS\Db::i()->prefix . $class::$databaseTable . ' WHERE ' . $class::$databasePrefix . $class::$databaseColumnMap['poll'] . ' IS NOT NULL)'
];
}
}
}
$toRun = \IPS\core\Setup\Upgrade::runManualQueries( $queries );
if( \count( $toRun ) )
{
\IPS\core\Setup\Upgrade::adjustMultipleRedirect( [ 1 => 'core', 'extra' => [ '_upgradeStep' => 2 ] ] );
/* Queries to run manually */
return [ 'html' => \IPS\Theme::i()->getTemplate( 'forms' )->queries( $toRun, \IPS\Http\Url::internal( 'controller=upgrade' )->setQueryString( [ 'key' => $_SESSION[ 'uniqueKey' ], 'mr_continue' => 1, 'mr' => \IPS\Request::i()->mr, 'extra' => 0 ] ) ) ];
}
return TRUE;
}
// You can create as many additional methods (step2, step3, etc.) as is necessary.
// Each step will be executed in a new HTTP request
}