diff --git a/framework/core/src/Install/Console/FileDataProvider.php b/framework/core/src/Install/Console/FileDataProvider.php index f5d3f8ddf..17bb9c5e9 100644 --- a/framework/core/src/Install/Console/FileDataProvider.php +++ b/framework/core/src/Install/Console/FileDataProvider.php @@ -33,8 +33,15 @@ class FileDataProvider implements DataProviderInterface // Check if file exists before parsing content if (file_exists($configurationFile)) { - // Parse YAML - $configuration = Yaml::parse(file_get_contents($configurationFile)); + $configurationFileContents = file_get_contents($configurationFile); + // Try parsing JSON + if (($json = json_decode($configurationFileContents, true)) !== null) { + //Use JSON if Valid + $configuration = $json; + } else { + //Else use YAML + $configuration = Yaml::parse($configurationFileContents); + } // Define configuration variables $this->baseUrl = isset($configuration['baseUrl']) ? rtrim($configuration['baseUrl'], '/') : null; diff --git a/framework/core/src/Install/Console/InstallCommand.php b/framework/core/src/Install/Console/InstallCommand.php index 69ac97a05..2c89fec85 100644 --- a/framework/core/src/Install/Console/InstallCommand.php +++ b/framework/core/src/Install/Console/InstallCommand.php @@ -69,7 +69,7 @@ class InstallCommand extends AbstractCommand 'file', 'f', InputOption::VALUE_REQUIRED, - 'Use external configuration file in YAML format' + 'Use external configuration file in JSON or YAML format' ) ->addOption( 'config',