Skip to content

Commit

Permalink
Show Application name when no all configs pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Nov 8, 2023
1 parent 26a3911 commit 64db731
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Ease/Shared.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ public static function init($configKeys = [], $envFile = '')
}
}
$configured = true;
if (array_key_exists('DB_CONNECTION', $configKeys) && (substr(self::cfg('DB_CONNECTION', ''), 0, 6) === 'sqlite')) {
if (array_key_exists('DB_CONNECTION', $configKeys) && preg_match('/^sqlite/', self::cfg('DB_CONNECTION', ''))) {
unset($configKeys['DB_PASSWORD']);
unset($configKeys['DB_USERNAME']);
unset($configKeys['DB_HOST']);
unset($configKeys['DB_PORT']);
}
foreach ($configKeys as $cfgKey) {
if (empty(self::cfg($cfgKey))) {
fwrite(fopen('php://stderr', 'wb'), 'Requied configuration ' . $cfgKey . " is not set." . PHP_EOL);
fwrite(fopen('php://stderr', 'wb'), self::appName() . ': Requied configuration ' . $cfgKey . " is not set." . PHP_EOL);
$configured = false;
}
}
Expand Down

0 comments on commit 64db731

Please sign in to comment.