Skip to content

Commit

Permalink
Add unknown config log
Browse files Browse the repository at this point in the history
  • Loading branch information
M0rgan01 committed Mar 7, 2025
1 parent 30575ca commit a319769
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion classes/Task/Miscellaneous/UpdateConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public function run(): int
$configurationData = $this->getConfigurationData();
$config = [];

$diff = array_diff($configurationData, UpgradeConfiguration::UPGRADE_CONST_KEYS);

foreach (array_keys($diff) as $configDiff) {
$this->logger->warning($this->translator->trans("Unknown configuration key '%s', Ignoring.", [$configDiff]));
}

foreach (UpgradeConfiguration::UPGRADE_CONST_KEYS as $key) {
if (!isset($configurationData[$key])) {
continue;
Expand Down Expand Up @@ -89,7 +95,7 @@ public function run(): int
$file = $config[UpgradeConfiguration::ARCHIVE_ZIP];
$fullFilePath = $this->container->getProperty(UpgradeContainer::DOWNLOAD_PATH) . DIRECTORY_SEPARATOR . $file;
try {
$config['archive_version_num'] = $this->container->getPrestashopVersionService()->extractPrestashopVersionFromZip($fullFilePath);
$config[UpgradeConfiguration::ARCHIVE_VERSION_NUM] = $this->container->getPrestashopVersionService()->extractPrestashopVersionFromZip($fullFilePath);
$this->logger->info($this->translator->trans('Update process will use archive.'));
} catch (Exception $exception) {
$this->setErrorFlag();
Expand Down

0 comments on commit a319769

Please sign in to comment.