Version 5.0.0 beta 1

This commit is contained in:
Neo committed 2025-12-19 16:27:35 -08:00
1 parent 25ddeb65d6
commit 15c7beabc5
6736 files changed
+627902 -497943

No files matched your search

+22 -15
View File
@@ -12,29 +12,36 @@
namespace IPS\nexus\setup\upg_107660;
/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
use IPS\core\AdminNotification;
use IPS\Db;
use IPS\Patterns\ActiveRecordIterator;
use IPS\Settings;
use function defined;
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.9 Beta 1 Upgrade Code
*/
class _Upgrade
class Upgrade
{
/**
* Step 1 - Remove redundant settings
*
* @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()
public function step1() : bool|array
{
\IPS\Db::i()->delete( 'core_sys_conf_settings', "conf_key IN( 'monitoring_alert', 'monitoring_allowed_fails' , 'monitoring_backup' , 'monitoring_from' , 'monitoring_panic' , 'monitoring_script' , 'network_status' , 'nexus_domain_prices' , 'nexus_domain_tax' , 'nexus_enom_pw' , 'nexus_enom_un' , 'nexus_hosting_allow_change_domain' , 'nexus_hosting_allow_own_domain' , 'nexus_hosting_bandwidth' , 'nexus_hosting_error_emails' , 'nexus_hosting_nameservers' , 'nexus_hosting_own_domain_sub' , 'nexus_hosting_own_domains' , 'nexus_hosting_subdomains' , 'nexus_hosting_terminate' )" );
Db::i()->delete( 'core_sys_conf_settings', "conf_key IN( 'monitoring_alert', 'monitoring_allowed_fails' , 'monitoring_backup' , 'monitoring_from' , 'monitoring_panic' , 'monitoring_script' , 'network_status' , 'nexus_domain_prices' , 'nexus_domain_tax' , 'nexus_enom_pw' , 'nexus_enom_un' , 'nexus_hosting_allow_change_domain' , 'nexus_hosting_allow_own_domain' , 'nexus_hosting_bandwidth' , 'nexus_hosting_error_emails' , 'nexus_hosting_nameservers' , 'nexus_hosting_own_domain_sub' , 'nexus_hosting_own_domains' , 'nexus_hosting_subdomains' , 'nexus_hosting_terminate' )" );
if( \IPS\Settings::i()->maxmind_key and !\IPS\Settings::i()->maxmind_id )
if( Settings::i()->maxmind_key and !Settings::i()->maxmind_id )
{
\IPS\core\AdminNotification::send( 'nexus', 'Maxmind', NULL, TRUE, array() );
AdminNotification::send( 'nexus', 'Maxmind', NULL, TRUE, array() );
}
return TRUE;
@@ -45,10 +52,10 @@ 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 step2()
public function step2() : bool|array
{
/* Remove hosting purchases */
\IPS\Db::i()->delete( 'nexus_purchases', array( \IPS\Db::i()->in( 'ps_item_id', \IPS\Db::i()->select( 'p_id', 'nexus_packages', array( "p_type='hosting'" ) ) ) ) );
Db::i()->delete( 'nexus_purchases', array( Db::i()->in( 'ps_item_id', Db::i()->select( 'p_id', 'nexus_packages', array( "p_type='hosting'" ) ) ) ) );
return TRUE;
}
@@ -58,10 +65,10 @@ 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 step3()
public function step3() : bool|array
{
/* Remove products */
foreach( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'nexus_packages', array( "p_type=?", 'hosting' ) ), 'IPS\nexus\Package' ) AS $pkg )
foreach( new ActiveRecordIterator( Db::i()->select( '*', 'nexus_packages', array( "p_type=?", 'hosting' ) ), 'IPS\nexus\Package' ) AS $pkg )
{
$pkg->delete();
}
@@ -74,10 +81,10 @@ 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 step4()
public function step4() : bool|array
{
/* Remove products */
\IPS\Db::i()->delete( 'core_acp_notifications', array( "app=? AND ext=?", 'nexus', 'HostingError' ) );
Db::i()->delete( 'core_acp_notifications', array( "app=? AND ext=?", 'nexus', 'HostingError' ) );
return TRUE;
}
@@ -87,9 +94,9 @@ 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 step5()
public function step5() : bool|array
{
\IPS\Db::i()->delete( 'core_modules', array( 'sys_module_application=? and sys_module_key=? and sys_module_area=?', 'nexus', 'hosting', 'admin' ) );
Db::i()->delete( 'core_modules', array( 'sys_module_application=? and sys_module_key=? and sys_module_area=?', 'nexus', 'hosting', 'admin' ) );
return TRUE;
}