Version 4.6.0

This commit is contained in:
Neo committed 2025-12-19 05:55:31 -08:00
1 parent f79dcf067a
commit 517a5e1f70
2036 files changed
+110041 -26162

No files matched your search

+25 -10
View File
@@ -92,7 +92,7 @@ class _Upgrade
}
$maxChunkSizeValues = \IPS\Member::loggedIn()->language()->formatList( $maxChunkSizeValues );
$return['advice']["filesystem{$class->configurationId}"] = \IPS\Member::loggedIn()->language()->addToStack( 'file_storage_test_chunk_mismatch', FALSE, array( 'sprintf' => array( $class->displayName( $class->configuration ), \IPS\Output\Plugin\Filesize::humanReadableFilesize( $maxChunkSize * 1048576 ), \IPS\Output\Plugin\Filesize::humanReadableFilesize( $class::$minChunkSize * 1048576 ), $maxChunkSizeValues ) ) );
$return['advice'][ $writeablesKey ]["filesystem{$class->configurationId}"] = \IPS\Member::loggedIn()->language()->addToStack( 'file_storage_test_chunk_mismatch', FALSE, array( 'sprintf' => array( $class->displayName( $class->configuration ), \IPS\Output\Plugin\Filesize::humanReadableFilesize( $maxChunkSize * 1048576 ), \IPS\Output\Plugin\Filesize::humanReadableFilesize( $class::$minChunkSize * 1048576 ), $maxChunkSizeValues ) ) );
}
$successfulStorage = TRUE;
@@ -134,6 +134,21 @@ class _Upgrade
{
unset( $return['requirements'][ $writeablesKey ]['datastore'] );
}
/* If InnoDB is in use check that COMPACT isn't used */
if ( !\IPS\CIC AND iterator_to_array( \IPS\Db::i()->query( "SHOW TABLE STATUS WHERE Engine='InnoDB' AND Row_format='Compact'" ) ) )
{
$ifpt = '';
foreach ( \IPS\Db::i()->query("SHOW VARIABLES LIKE 'innodb_file_per_table'") as $row )
{
if( \strtolower( $row['Value'] ) !== \strtolower( 'ON' ) )
{
$ifpt = \IPS\Member::loggedIn()->language()->get( 'requirements_mysql_ifpt_advice' );
}
}
$return['advice']['MySQL']['compact'] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_mysql_format_advice', FALSE, array( 'htmlsprintf' => array( $ifpt ) ) );
}
return $return;
}
@@ -166,7 +181,7 @@ class _Upgrade
if ( version_compare( $mysqlVersion, $requirements['mysql']['recommended'] ) == -1 AND !mb_strpos( $mysqlVersion, "MariaDB" ) )
{
$return['advice'][] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_mysql_version_advice', FALSE, array( 'sprintf' => array( $mysqlVersion, $requirements['mysql']['recommended'] ) ) );
$return['advice']['MySQL']['version'] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_mysql_version_advice', FALSE, array( 'sprintf' => array( $mysqlVersion, $requirements['mysql']['recommended'] ) ) );
}
}
else
@@ -188,13 +203,13 @@ class _Upgrade
{
if ( $row['Variable_name'] == 'wait_timeout' AND $row['Value'] < 20 )
{
$return['advice'][] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_mysql_timeout', FALSE, array( 'sprintf' => array( $row['Variable_name'], $row['Value'] ) ) );
$return['advice']['MySQL']['timeout'] = \IPS\Member::loggedIn()->language()->addToStack( 'requirements_mysql_timeout', FALSE, array( 'sprintf' => array( $row['Variable_name'], $row['Value'] ) ) );
}
}
}
catch( \IPS\Db\Exception $e )
{
$return['advice'][] = $e->getMessage();
$return['advice']['MySQL'][] = $e->getMessage();
}
return $return;
@@ -480,9 +495,9 @@ class _Upgrade
try
{
if( file_exists( \IPS\ROOT_PATH . "/applications/{$app}/setup/upg_{$extra['_current']}/lang.json" ) )
if( file_exists( \IPS\Application::load( $app )->getApplicationPath() . "/setup/upg_{$extra['_current']}/lang.json" ) )
{
$langChanges = json_decode( \file_get_contents( \IPS\ROOT_PATH . "/applications/{$app}/setup/upg_{$extra['_current']}/lang.json" ), TRUE );
$langChanges = json_decode( \file_get_contents( \IPS\Application::load( $app )->getApplicationPath() . "/setup/upg_{$extra['_current']}/lang.json" ), TRUE );
if ( isset( $langChanges['normal']['removed'] ) and $langChanges['normal']['removed'] )
{
\IPS\Db::i()->delete( 'core_sys_lang_words', array( array( 'word_app=?', $app ), array( 'word_js=0' ), array( \IPS\Db::i()->in( 'word_key', $langChanges['normal']['removed'] ) ) ) );
@@ -794,7 +809,7 @@ class _Upgrade
if( !\IPS\CIC2 AND !is_writable( \IPS\SITE_FILES_PATH . '/plugins/hooks.php' ) )
{
throw new \RuntimeException( sprintf( \IPS\Member::loggedIn()->language()->get("hook_file_not_writable"), \IPS\ROOT_PATH . '/plugins/hooks.php' ) );
throw new \RuntimeException( sprintf( \IPS\Member::loggedIn()->language()->get("hook_file_not_writable"), \IPS\SITE_FILES_PATH . '/plugins/hooks.php' ) );
}
try
@@ -824,11 +839,11 @@ class _Upgrade
}
/* Update application data */
if( file_exists( \IPS\ROOT_PATH . '/applications/' . $app . '/data/application.json' ) )
if( file_exists( \IPS\Application::load( $app )->getApplicationPath() . '/data/application.json' ) )
{
\IPS\Log::debug( "Installing application data for " . $app, 'upgrade' );
$application = json_decode( file_get_contents( \IPS\ROOT_PATH . '/applications/' . $app . '/data/application.json' ), TRUE );
$application = json_decode( file_get_contents( \IPS\Application::load( $app )->getApplicationPath() . '/data/application.json' ), TRUE );
//\IPS\Lang::saveCustom( $app, "__app_{$app}", $application['application_title'] );
@@ -1141,7 +1156,7 @@ class _Upgrade
*/
public static function runLegacySql( $app, $upgradeId, $file='queries.php' )
{
$queryFile = \IPS\ROOT_PATH . '/applications/' . $app . '/setup/upg_' . $upgradeId . '/' . $file;
$queryFile = \IPS\Application::load( $app )->getApplicationPath() . '/setup/upg_' . $upgradeId . '/' . $file;
$lastIndex = ( isset( $_SESSION['lastJsonIndex'] ) ) ? $_SESSION['lastJsonIndex'] : 0;
if ( file_exists( $queryFile ) )