Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
Fixed precedence for prefix, locale and platformName, raised version …
Browse files Browse the repository at this point in the history
…to 0.1.9
  • Loading branch information
peterjaap committed Mar 6, 2019
1 parent e2a2895 commit 40c6d37
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Elgentos/Masquerade/Console/GroupsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private function setup()
$this->configHelper = new Config();
$databaseConfig = $this->configHelper->readConfigFile();

$this->platformName = $databaseConfig['platform'] ?? $this->input->getOption('platform');
$this->platformName = $this->input->getOption('platform') ?? $databaseConfig['platform'];

if (!$this->platformName) {
throw new \Exception('No platformName set, use option --platform or set it in ' . Config::CONFIG_YAML);
Expand Down
2 changes: 1 addition & 1 deletion src/Elgentos/Masquerade/Console/IdentifyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ private function setup()
$this->configHelper = new Config();
$databaseConfig = $this->configHelper->readConfigFile();

$this->platformName = $databaseConfig['platform'] ?? $this->input->getOption('platform');
$this->platformName = $this->input->getOption('platform') ?? $databaseConfig['platform'];

if (!$this->platformName) {
throw new \Exception('No platformName set, use option --platform or set it in ' . Config::CONFIG_YAML);
Expand Down
8 changes: 4 additions & 4 deletions src/Elgentos/Masquerade/Console/RunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class RunCommand extends Command
|
by elgentos';

const VERSION = '0.1.7';
const VERSION = '0.1.9';

protected $config;

Expand Down Expand Up @@ -206,7 +206,7 @@ private function setup()

$databaseConfig = $this->configHelper->readConfigFile();

$this->platformName = $databaseConfig['platform'] ?? $this->input->getOption('platform');
$this->platformName = $this->input->getOption('platform') ?? $databaseConfig['platform'];

if (!$this->platformName) {
throw new \Exception('No platformName set, use option --platform or set it in ' . Config::CONFIG_YAML);
Expand All @@ -219,7 +219,7 @@ private function setup()
$database = $this->input->getOption('database') ?? $databaseConfig['database'];
$username = $this->input->getOption('username') ?? $databaseConfig['username'];
$password = $this->input->getOption('password') ?? $databaseConfig['password'];
$prefix = $this->input->getOption('prefix') ?? $databaseConfig['prefix'];
$prefix = $this->input->getOption('prefix') ?? $databaseConfig['prefix'] ?? '';
$charset = $this->input->getOption('charset') ?? $databaseConfig['charset'] ?? 'utf8';

$errors = [];
Expand Down Expand Up @@ -250,7 +250,7 @@ private function setup()
$this->db = $capsule->getConnection();
$this->db->statement('SET FOREIGN_KEY_CHECKS=0');

$this->locale = $databaseConfig['locale'] ?? $this->input->getOption('locale') ?? 'en_US';
$this->locale = $this->input->getOption('locale') ?? $databaseConfig['locale'] ?? 'en_US';

$this->group = array_filter(array_map('trim', explode(',', $this->input->getOption('group'))));
}
Expand Down

0 comments on commit 40c6d37

Please sign in to comment.