Profiler/CLI

* move command line related functions to its own class
This commit is contained in:
Sarjuuk
2018-03-22 15:40:22 +01:00
parent f25498d4d0
commit b0a5f477c1
39 changed files with 595 additions and 588 deletions

View File

@@ -23,8 +23,8 @@ function sql($syncMe = null)
$allOk = true;
// start file generation
CLISetup::log('begin generation of '. implode(', ', SqlGen::$subScripts));
CLISetup::log();
CLI::write('begin generation of '. implode(', ', SqlGen::$subScripts));
CLI::write();
foreach (SqlGen::$subScripts as $tbl)
{
@@ -36,19 +36,19 @@ function sql($syncMe = null)
else
$done[] = $tbl;
CLISetup::log(' - subscript \''.$tbl.'\' returned '.($ok ? 'sucessfully' : 'with errors'), $ok ? CLISetup::LOG_OK : CLISetup::LOG_ERROR);
CLI::write(' - subscript \''.$tbl.'\' returned '.($ok ? 'sucessfully' : 'with errors'), $ok ? CLI::LOG_OK : CLI::LOG_ERROR);
set_time_limit(SqlGen::$defaultExecTime); // reset to default for the next script
}
// end
CLISetup::log();
CLI::write();
if ($allOk)
CLISetup::log('successfully finished sql generation', CLISetup::LOG_OK);
CLI::write('successfully finished sql generation', CLI::LOG_OK);
else
CLISetup::log('finished sql generation with errors', CLISetup::LOG_ERROR);
CLI::write('finished sql generation with errors', CLI::LOG_ERROR);
}
else if ($syncMe)
CLISetup::log('no valid script names supplied', CLISetup::LOG_ERROR);
CLI::write('no valid script names supplied', CLI::LOG_ERROR);
return $done;
}