From 087a32ece2f75b5709eff5a44482e345fdfd5414 Mon Sep 17 00:00:00 2001 From: Stepan Kechedzhi Date: Fri, 29 Mar 2024 18:35:56 +0100 Subject: [PATCH] - Added container for easy building on non-linux devices - Removed the fix for hyphens variable names: it seams this had been fixed somehow and hyphens now works, while deprecation of hyphens in fact makes it impossible to configure 'table-groups' property for adding project specific tables for stripping. --- Makefile | 3 +++ docker-compose.yml | 8 ++++++++ src/Application/ConfigLoader/FileLoader.php | 17 ----------------- 3 files changed, 11 insertions(+), 17 deletions(-) create mode 100644 docker-compose.yml diff --git a/Makefile b/Makefile index 01312bf..51b79bc 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,9 @@ build: magedbm2.phar +build-in-container: + docker-compose run --rm build /bin/bash -c "cd /var/www/html && make build" + clean: rm -rf vendor box.phar composer.phar magedbm2.phar diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e4bb597 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: "3.9" +services: + build: + image: docker.io/php:8.0.30-cli + + container_name: magedbm_build + volumes: + - ./:/var/www/html \ No newline at end of file diff --git a/src/Application/ConfigLoader/FileLoader.php b/src/Application/ConfigLoader/FileLoader.php index cad25d1..358e709 100644 --- a/src/Application/ConfigLoader/FileLoader.php +++ b/src/Application/ConfigLoader/FileLoader.php @@ -34,10 +34,6 @@ public function asConfig() try { $values = Yaml::parseFile($this->filePath); - if (is_array($values) && !$this->validateYamlVariables($values)) { - $this->configurationError(); - } - if (is_array($values)) { $values = $this->formatConfigVariableNames($values); } @@ -48,19 +44,6 @@ public function asConfig() } } - // yaml doesn't like variable names with hyphens (https://github.com/Space48/magedbm2/issues/21) - private function validateYamlVariables(array $variables) - { - $isValidYaml = true; - foreach ($variables as $variableName => $variableValue) { - if (strpos($variableName, '-') !== false) { - $isValidYaml = false; - break; - } - } - return $isValidYaml; - } - private function formatConfigVariableNames(array $variables) { foreach ($variables as $variableName => $variableValue) {