mirror of
https://github.com/archtechx/tenancy.git
synced 2026-08-06 05:54:03 +00:00
handle 0 and empty $_ENV differently
This commit is contained in:
parent
4f2c4528a4
commit
6806871993
1 changed files with 7 additions and 2 deletions
|
|
@ -374,13 +374,18 @@ test('migrate fresh command only shows migration output when run with the verbos
|
||||||
// so we cannot easily test commands without -v. To work around that, we temporarily
|
// so we cannot easily test commands without -v. To work around that, we temporarily
|
||||||
// override $_ENV['SHELL_VERBOSITY'] immediately before executing the command. If this
|
// override $_ENV['SHELL_VERBOSITY'] immediately before executing the command. If this
|
||||||
// ever stops working, try also overriding the value in $_SERVER and putenv().
|
// ever stops working, try also overriding the value in $_SERVER and putenv().
|
||||||
$originalVerbosity = $_ENV['SHELL_VERBOSITY'] ?? 0;
|
$emptySentinel = new \stdClass();
|
||||||
|
$originalVerbosity = $_ENV['SHELL_VERBOSITY'] ?? $emptySentinel;
|
||||||
try {
|
try {
|
||||||
$_ENV['SHELL_VERBOSITY'] = 0;
|
$_ENV['SHELL_VERBOSITY'] = 0;
|
||||||
Artisan::call('tenants:migrate-fresh');
|
Artisan::call('tenants:migrate-fresh');
|
||||||
$defaultOutput = Artisan::output();
|
$defaultOutput = Artisan::output();
|
||||||
} finally {
|
} finally {
|
||||||
$_ENV['SHELL_VERBOSITY'] = $originalVerbosity;
|
if ($originalVerbosity === $emptySentinel) {
|
||||||
|
unset($_ENV['SHELL_VERBOSITY']);
|
||||||
|
} else {
|
||||||
|
$_ENV['SHELL_VERBOSITY'] = $originalVerbosity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Artisan::call('tenants:migrate-fresh -v');
|
Artisan::call('tenants:migrate-fresh -v');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue