Version 4.3.6
This commit is contained in:
1 parent
fe1acf984a
commit
1a0c7fd3c2
609 files changed
+14707
-5726
No files matched your search
@@ -144,6 +144,9 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
/* Issue */
|
||||
else
|
||||
{
|
||||
/* Log that the support tool has been run */
|
||||
\IPS\Session::i()->log( 'acplog__support_tool_ran' );
|
||||
|
||||
/* Get requirements and suggestions */
|
||||
$requirementsCheck = \IPS\core\Setup\Upgrade::systemRequirements();
|
||||
|
||||
@@ -173,13 +176,12 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
\IPS\Output::clearJsFiles();
|
||||
|
||||
/* Reset theme maps to make sure bad data hasn't been cached by visits mid-setup */
|
||||
\IPS\Theme::deleteCompiledCss();
|
||||
|
||||
foreach( \IPS\Theme::themes() as $id => $set )
|
||||
{
|
||||
/* Invalidate template disk cache */
|
||||
$set->cache_key = md5( microtime() . mt_rand( 0, 1000 ) );
|
||||
|
||||
/* Update mappings */
|
||||
$set->css_map = array();
|
||||
$set->save();
|
||||
}
|
||||
|
||||
@@ -346,7 +348,7 @@ class _support extends \IPS\Dispatcher\Controller
|
||||
*/
|
||||
protected function _connectionChecker()
|
||||
{
|
||||
return NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -174,6 +174,9 @@ class _utf8mb4 extends \IPS\Dispatcher\Controller
|
||||
continue;
|
||||
}
|
||||
|
||||
/* If all columns in an index are already utf8mb4 then we don't need to worry about recreating the index */
|
||||
$needToRecreate = FALSE;
|
||||
|
||||
$length = 0;
|
||||
$hasText = false;
|
||||
foreach( $indexData['columns'] as $column )
|
||||
@@ -186,9 +189,14 @@ class _utf8mb4 extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
$length += $tableDefinition['columns'][ $column ]['length'];
|
||||
}
|
||||
|
||||
if( $tableDefinition['columns'][ $column ]['collation'] !== 'utf8mb4_unicode_ci' )
|
||||
{
|
||||
$needToRecreate = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( $length * 4 > $maxLen ) or $hasText )
|
||||
if ( $needToRecreate AND ( ( $length * 4 > $maxLen ) or $hasText ) )
|
||||
{
|
||||
$indexesToRecreate[ $indexName ] = $indexData;
|
||||
\IPS\Db::i()->dropIndex( $table, $indexName );
|
||||
@@ -205,6 +213,9 @@ class _utf8mb4 extends \IPS\Dispatcher\Controller
|
||||
$repair = true;
|
||||
}
|
||||
|
||||
/* Aggregate all the changes into one query for efficiency */
|
||||
$aggregatedChanges = array();
|
||||
|
||||
/* Do each column */
|
||||
foreach ( $tableDefinition['columns'] as $columnName => $columnData )
|
||||
{
|
||||
@@ -212,7 +223,7 @@ class _utf8mb4 extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
if( $tableDefinition['columns'][ $columnName ]['collation'] !== 'utf8mb4_unicode_ci' )
|
||||
{
|
||||
\IPS\Db::i()->changeColumn( $table, $columnName, $columnData );
|
||||
$aggregatedChanges[] = "CHANGE COLUMN `" . \IPS\Db::i()->escape_string( $columnName ) . "` " . \IPS\Db::i()->compileColumnDefinition( $columnData );
|
||||
$repair = true;
|
||||
}
|
||||
}
|
||||
@@ -221,15 +232,21 @@ class _utf8mb4 extends \IPS\Dispatcher\Controller
|
||||
/* Recreate any indexes */
|
||||
foreach ( $indexesToRecreate as $indexName => $indexData )
|
||||
{
|
||||
\IPS\Db::i()->addIndex( $table, $indexData );
|
||||
$aggregatedChanges[] = \IPS\Db::i()->buildIndex( $table, $indexData );
|
||||
$repair = true;
|
||||
}
|
||||
|
||||
/* Now if we have any changes to make....make them */
|
||||
if( count( $aggregatedChanges ) )
|
||||
{
|
||||
\IPS\Db::i()->query( "ALTER TABLE " . \IPS\Db::i()->prefix . \IPS\Db::i()->escape_string( $table ) . " " . implode( ', ', $aggregatedChanges ) );
|
||||
}
|
||||
|
||||
/* Repair and optimize */
|
||||
if( $repair === true )
|
||||
{
|
||||
\IPS\Db::i()->query("REPAIR TABLE `" . \IPS\Settings::i()->sql_tbl_prefix . "{$table}`");
|
||||
\IPS\Db::i()->query("OPTIMIZE TABLE `" . \IPS\Settings::i()->sql_tbl_prefix . "{$table}`");
|
||||
//\IPS\Db::i()->query("OPTIMIZE TABLE `" . \IPS\Settings::i()->sql_tbl_prefix . "{$table}`");
|
||||
}
|
||||
|
||||
/* If this is the search index table, initiate rebuild now. */
|
||||
@@ -248,6 +265,7 @@ class _utf8mb4 extends \IPS\Dispatcher\Controller
|
||||
}
|
||||
catch ( \Exception $e )
|
||||
{
|
||||
\IPS\Log::log( $e, 'utf8mb4' );
|
||||
\IPS\Output::i()->error( \IPS\Member::loggedIn()->language()->addToStack( 'utf8mb4_converter_error', FALSE, array( 'sprintf' => array( $e->getMessage() ) ) ), '4C171/4', 403, '' );
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user