Merge pull request #9850 from nextcloud/fix/noid/setup-check-empty-index

Fix wrong hint about missing indexes
This commit is contained in:
Morris Jobke 2018-06-13 12:21:02 +02:00 committed by GitHub
commit 6756c8d2b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 19 deletions

View File

@ -183,7 +183,7 @@
type: OC.SetupChecks.MESSAGE_TYPE_INFO
})
}
if (data.hasMissingIndexes) {
if (data.hasMissingIndexes.length > 0) {
var listOfMissingIndexes = "";
data.hasMissingIndexes.forEach(function(element){
listOfMissingIndexes += "<li>";

View File

@ -157,7 +157,8 @@ describe('OC.SetupChecks tests', function() {
hasPassedCodeIntegrityCheck: true,
isOpcacheProperlySetup: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true
hasFreeTypeSupport: true,
hasMissingIndexes: []
})
);
@ -191,7 +192,8 @@ describe('OC.SetupChecks tests', function() {
hasPassedCodeIntegrityCheck: true,
isOpcacheProperlySetup: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true
hasFreeTypeSupport: true,
hasMissingIndexes: []
})
);
@ -226,7 +228,8 @@ describe('OC.SetupChecks tests', function() {
hasPassedCodeIntegrityCheck: true,
isOpcacheProperlySetup: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true
hasFreeTypeSupport: true,
hasMissingIndexes: []
})
);
@ -259,7 +262,8 @@ describe('OC.SetupChecks tests', function() {
hasPassedCodeIntegrityCheck: true,
isOpcacheProperlySetup: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true
hasFreeTypeSupport: true,
hasMissingIndexes: []
})
);
@ -290,7 +294,8 @@ describe('OC.SetupChecks tests', function() {
hasPassedCodeIntegrityCheck: true,
isOpcacheProperlySetup: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true
hasFreeTypeSupport: true,
hasMissingIndexes: []
})
);
@ -321,7 +326,8 @@ describe('OC.SetupChecks tests', function() {
hasPassedCodeIntegrityCheck: true,
isOpcacheProperlySetup: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true
hasFreeTypeSupport: true,
hasMissingIndexes: []
})
);
@ -352,7 +358,8 @@ describe('OC.SetupChecks tests', function() {
hasPassedCodeIntegrityCheck: true,
isOpcacheProperlySetup: true,
isSettimelimitAvailable: false,
hasFreeTypeSupport: true
hasFreeTypeSupport: true,
hasMissingIndexes: []
})
);
@ -404,7 +411,8 @@ describe('OC.SetupChecks tests', function() {
hasPassedCodeIntegrityCheck: true,
isOpcacheProperlySetup: true,
isSettimelimitAvailable: true,
hasFreeTypeSupport: true
hasFreeTypeSupport: true,
hasMissingIndexes: []
})
);
@ -436,7 +444,8 @@ describe('OC.SetupChecks tests', function() {
isOpcacheProperlySetup: false,
phpOpcacheDocumentation: 'https://example.org/link/to/doc',
isSettimelimitAvailable: true,
hasFreeTypeSupport: true
hasFreeTypeSupport: true,
hasMissingIndexes: []
})
);
@ -468,7 +477,8 @@ describe('OC.SetupChecks tests', function() {
isOpcacheProperlySetup: true,
phpOpcacheDocumentation: 'https://example.org/link/to/doc',
isSettimelimitAvailable: true,
hasFreeTypeSupport: false
hasFreeTypeSupport: false,
hasMissingIndexes: []
})
);

View File

@ -1,4 +1,5 @@
<?php
declare(strict_types=1);
/**
* @copyright Copyright (c) 2018 Morris Jobke <hey@morrisjobke.de>
*
@ -21,19 +22,18 @@
namespace OC\DB;
class MissingIndexInformation {
private $listOfMissingIndexes = [];
public function addHintForMissingSubject($tableName, $indexName) {
public function addHintForMissingSubject(string $tableName, string $indexName) {
$this->listOfMissingIndexes[] = [
'tableName' => $tableName,
'indexName' => $indexName
];
}
public function getListOfMissingIndexes() {
public function getListOfMissingIndexes(): array {
return $this->listOfMissingIndexes;
}
}

View File

@ -415,11 +415,7 @@ Raw output
return function_exists('imagettfbbox') && function_exists('imagettftext');
}
/**
* Check if the required FreeType functions are present
* @return bool
*/
protected function hasMissingIndexes() {
protected function hasMissingIndexes(): array {
$indexInfo = new MissingIndexInformation();
// Dispatch event so apps can also hint for pending index updates if needed
$event = new GenericEvent($indexInfo);