Misc fixes

* Updated build scripts to handle gitless environments a little
  better
* PDO shell plugin improvements
* More tests
This commit is contained in:
2021-12-17 12:51:29 +01:00
parent 1eab339347
commit 0f45219747
10 changed files with 165 additions and 8 deletions

View File

@ -6,6 +6,7 @@ use Spark\Commands\Command;
use SparkPlug;
use SparkPlug\Com\Noccy\ApiClient\Api\Method;
use SparkPlug\Com\Noccy\ApiClient\ApiClientPlugin;
use SparkPlug\Com\Noccy\ApiClient\Log\RequestData;
use SparkPlug\Com\Noccy\ApiClient\Request\RequestBuilder;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Input\InputArgument;
@ -29,7 +30,17 @@ class ApiLogsCommand extends Command
/** @var ApiClientPlugin */
$plugin = get_plugin('com.noccy.apiclient');
$iter = $plugin->getLogIterator("default");
foreach ($iter as $index=>$log) {
$this->dumpLog($log, $index, $output);
}
return Command::SUCCESS;
}
private function dumpLog(array $log, int $index, OutputInterface $output)
{
$output->writeln("<comment>#{$index}</> <options=bold>{$log['request']['info']['query']}</> (<info>{$log['method']}</>) ".strlen($log['response']['body'])."b");
}
}