Version 4.3.0

This commit is contained in:
Neo committed 2025-12-19 05:47:12 -08:00
1 parent 96997ddd8e
commit fe1acf984a
1349 files changed
+116159 -67711

No files matched your search

+20 -9
View File
@@ -38,6 +38,8 @@ class _Upgrade
$hasChanges = FALSE;
$applications = array();
$_SESSION['repairFileUrls'] = false;
/* Loop over all file storage extensions */
foreach ( \IPS\Application::allExtensions( 'core', 'FileStorage', FALSE, NULL, NULL, TRUE ) as $name => $obj )
{
@@ -45,22 +47,15 @@ class _Upgrade
{
$settings[ "filestorage__{$name}" ] = $defaultSetting;
$hasChanges = TRUE;
$_extension = explode( '_', $name );
$applications[ $_extension[0] ] = $_extension[0];
}
}
/* Now, if we have changes, update the setting and reinitiate the RepairFileUrls background queue task for the affected application(s) */
if( $hasChanges )
{
\IPS\Db::i()->update( 'core_sys_conf_settings', array( 'conf_value' => json_encode( $settings ) ), array( 'conf_key=?', 'upload_settings' ) );
unset( \IPS\Data\Store::i()->settings );
\IPS\Settings::i()->changeValues( array( 'upload_settings' => json_encode( $settings ) ) );
foreach( $applications as $app )
{
\IPS\core\Setup\Upgrade::repairFileUrls( $app );
}
$_SESSION['repairFileUrls'] = true;
}
/* That's all ... easy peasy */
@@ -113,4 +108,20 @@ class _Upgrade
{
return "Removing orphaned personal message maps";
}
/**
* Repair URLs
*
* @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 finish()
{
if( isset( $_SESSION['repairFileUrls'] ) AND $_SESSION['repairFileUrls'] )
{
foreach( \IPS\Application::applications() as $app )
{
\IPS\core\Setup\Upgrade::repairFileUrls( $app->directory );
}
}
}
}