3189 - DBTools enhancements

* Add CLI command bin/report.php to generate report offline
* Keep the latest report in log/dbtools-report.log in order to visualize it with "Log management" menu
This commit is contained in:
Eric
2020-07-21 14:08:09 +02:00
parent fdec608c3e
commit 3b20be05cb
4 changed files with 123 additions and 61 deletions

View File

@@ -0,0 +1,29 @@
<?php
/**
* @copyright Copyright (C) 2010-2020 Combodo SARL
* @license http://opensource.org/licenses/AGPL-3.0
*/
use Combodo\iTop\DBTools\Service\DBAnalyzerUtils;
@include_once('../approot.inc.php');
@include_once('../../approot.inc.php');
@include_once('../../../approot.inc.php');
require_once(APPROOT.'application/startup.inc.php');
require_once('../db_analyzer.class.inc.php');
require_once('../src/Service/DBAnalyzerUtils.php');
$oDBAnalyzer = new DatabaseAnalyzer(0);
$aResults = $oDBAnalyzer->CheckIntegrity([]);
if (empty($aResults))
{
echo "Database OK\n";
exit(0);
}
$sReportFile = DBAnalyzerUtils::GenerateReport($aResults);
echo "Report generated: {$sReportFile}.log\n";