Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -12,16 +12,29 @@
|
||||
namespace IPS\core\setup\upg_107000;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Application;
|
||||
use IPS\Content\Search\Index;
|
||||
use IPS\Db;
|
||||
use IPS\Db\Exception;
|
||||
use IPS\IPS;
|
||||
use IPS\Settings;
|
||||
use function call_user_func_array;
|
||||
use function defined;
|
||||
use function in_array;
|
||||
use function IPS\Cicloud\install;
|
||||
use const IPS\CIC;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* 4.7.0 Beta 1 Upgrade Code
|
||||
*/
|
||||
class _Upgrade
|
||||
class Upgrade
|
||||
{
|
||||
/**
|
||||
* Install the platform app for platform clients if it's not there which it won't be, probably.
|
||||
@@ -30,7 +43,7 @@ class _Upgrade
|
||||
*/
|
||||
public function step1()
|
||||
{
|
||||
if ( \IPS\CIC and ! \in_array( 'cloud', array_keys( \IPS\Application::applications() ) ) )
|
||||
if ( CIC and ! in_array( 'cloud', array_keys( Application::applications() ) ) )
|
||||
{
|
||||
/* Load in our CiC functions */
|
||||
if ( isset( $_SERVER['IPS_CLOUD2'] ) AND isset( $_SERVER['IPS_CLOUD2_ID'] ) AND file_exists( "/var/www/sitefiles/{$_SERVER['IPS_CLOUD2_ID']}/applications/cloud/sources/functions.php" ) )
|
||||
@@ -43,7 +56,7 @@ class _Upgrade
|
||||
@require_once( __DIR__ . '/applications/cloud/sources/functions.php' );
|
||||
}
|
||||
|
||||
\IPS\Cicloud\install();
|
||||
install();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -56,7 +69,7 @@ class _Upgrade
|
||||
*/
|
||||
public function step2()
|
||||
{
|
||||
\IPS\Db::i()->insert( 'core_sys_conf_settings', array( 'conf_app' => 'core', 'conf_key' => 'searchlog_exclude_groups', 'conf_value' => json_encode( array( \IPS\Settings::i()->guest_group ) ) ), TRUE );
|
||||
Db::i()->insert( 'core_sys_conf_settings', array( 'conf_app' => 'core', 'conf_key' => 'searchlog_exclude_groups', 'conf_value' => json_encode( array( Settings::i()->guest_group ) ) ), TRUE );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -67,9 +80,9 @@ class _Upgrade
|
||||
public function step3()
|
||||
{
|
||||
/* Disable third party addons to prevent errors during upgrade */
|
||||
foreach( \IPS\Application::enabledApplications() as $app )
|
||||
foreach( Application::enabledApplications() as $app )
|
||||
{
|
||||
if( !\in_array( $app->directory, \IPS\IPS::$ipsApps ) )
|
||||
if( !in_array( $app->directory, IPS::$ipsApps ) )
|
||||
{
|
||||
$app->enabled = false;
|
||||
$app->save();
|
||||
@@ -77,7 +90,7 @@ class _Upgrade
|
||||
}
|
||||
|
||||
/* Truncate index, as we have to rebuild index to get the solved flag populated */
|
||||
\IPS\Content\Search\Index::i()->prune();
|
||||
Index::i()->prune();
|
||||
|
||||
$json = <<<EOF
|
||||
[
|
||||
@@ -107,9 +120,9 @@ EOF;
|
||||
{
|
||||
try
|
||||
{
|
||||
$run = \call_user_func_array( array( \IPS\Db::i(), $query['method'] ), $query['params'] );
|
||||
$run = call_user_func_array( array( Db::i(), $query['method'] ), $query['params'] );
|
||||
}
|
||||
catch( \IPS\Db\Exception $e )
|
||||
catch( Exception $e )
|
||||
{
|
||||
if( !in_array( $e->getCode(), array( 1007, 1008, 1050, 1060, 1061, 1062, 1091, 1051 ) ) )
|
||||
{
|
||||
@@ -118,7 +131,7 @@ EOF;
|
||||
}
|
||||
}
|
||||
|
||||
\IPS\Content\Search\Index::i()->rebuild();
|
||||
Index::i()->rebuild();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user