From ae32d781742d014715631228b01859d8d6c05e34 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sat, 19 Mar 2016 22:10:25 +0100 Subject: [PATCH] ConfigCommand: new cli command, used for benchmarks --- application/clicommands/ConfigCommand.php | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 application/clicommands/ConfigCommand.php diff --git a/application/clicommands/ConfigCommand.php b/application/clicommands/ConfigCommand.php new file mode 100644 index 00000000..a81cde24 --- /dev/null +++ b/application/clicommands/ConfigCommand.php @@ -0,0 +1,41 @@ +db()); + Benchmark::measure('Rendering config'); + if ($config->hasBeenModified()) { + Benchmark::measure('Config rendered, storing to db'); + $config->store(); + Benchmark::measure('All done'); + $checksum = $config->getHexChecksum(); + printf( + 'New config with checksum %s has been generated', + $checksum + ); + } else { + $checksum = $config->getHexChecksum(); + printf( + 'Config with checksum %s already exists', + $checksum + ); + } + } + + public function filesAction() + { + } + + public function fileAction() + { + } +}