From 6e8f66276d791de7edb5bb873642501faf4094d9 Mon Sep 17 00:00:00 2001 From: Hannes Lau Date: Sun, 26 Mar 2023 23:34:33 +0200 Subject: [PATCH] [FEATURE] Allow placeholders in YAML files --- Classes/Command/AbstractTableCommand.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Classes/Command/AbstractTableCommand.php b/Classes/Command/AbstractTableCommand.php index 393ddb9..986ca38 100644 --- a/Classes/Command/AbstractTableCommand.php +++ b/Classes/Command/AbstractTableCommand.php @@ -14,7 +14,7 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\Yaml\Yaml; +use TYPO3\CMS\Core\Configuration\Loader\YamlFileLoader; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\Query\QueryBuilder; use TYPO3\CMS\Core\Package\PackageInterface; @@ -54,6 +54,13 @@ class AbstractTableCommand extends Command */ protected $tableColumnCache = []; + public function __construct( + protected YamlFileLoader $yamlFileLoader, + string $name = null + ) { + parent::__construct($name); + } + /** * Initialize variables used in the rest of the command methods * @@ -251,7 +258,7 @@ protected function parseConfigurationFile($configurationFile): ?array { $configuration = null; if (!empty($configurationFile) && is_file($configurationFile)) { - $configuration = Yaml::parseFile($configurationFile); + $configuration = $this->yamlFileLoader->load($configurationFile); } return $configuration;