fix: affichage du sql:repair quand certaines tables ne supportent pas le repair

(la croix d'erreur s'affichait sur la table précédente, et la table concernée n'était pas affichée)
+ afficher la notice
master
Cerdic 2 months ago
parent 8c64d0f494
commit dac07b4b6a

@ -25,17 +25,23 @@ class SqlRepair extends Command
protected function presenterHTML($html) {
include_spip('inc/filtres');
$html = explode("</div><div>", $html);
$html = explode("</div><div", $html);
foreach ($html as $ligne) {
$table = explode("\n", $ligne, 2);
$table = textebrut(array_shift($table));
$details = explode("\n", $ligne, 2);
$table = array_shift($details);
$table = textebrut("<div" . $table);
$table = str_replace(['(', ')'], ['<comment>(', ')</comment>'], $table);
if (false === stripos($ligne, "'notice'")) {
if (false === stripos($ligne, "'notice'") or stripos($ligne, "OK")) {
$this->io->check($table);
} else {
$this->io->fail($table);
}
if (stripos($ligne, "'notice'")) {
$aff = textebrut(implode(' ', $details));
$aff = preg_replace(",\s+,"," ", $aff);
$this->io->care($aff);
}
}
$this->io->text("");
}
}
}

Loading…
Cancel
Save