fix: checkVarDir warnings only fired in --quiet mode after #1643#1
Open
ashtriggs wants to merge 1 commit into
Open
fix: checkVarDir warnings only fired in --quiet mode after #1643#1ashtriggs wants to merge 1 commit into
ashtriggs wants to merge 1 commit into
Conversation
…rbose PR netz98#1643 moved the tempVarDir existence check earlier (good — fixes the spurious warning when /tmp/magento/var doesn't exist) but also wrapped both writeln() calls in `if (OutputInterface::VERBOSITY_NORMAL > $output->getVerbosity())`. Since VERBOSITY_QUIET (16) < VERBOSITY_NORMAL (32), that condition is only true in --quiet mode, so the warnings never fire at normal or verbose verbosity — the opposite of the intended behaviour. writeln() already respects verbosity on its own, so the extra gate is both redundant and inverted; drop it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
netz98#1643 fixed the spurious
Folder /tmp/magento/var found, but not usedwarning firing at normal verbosity even when the directory doesn't exist (good — see netz98#1642, netz98#1648, and my earlier duplicate PR netz98#1646 against the now-archived netz98/n98-magerun).However, it also wrapped both
checkVarDir()warningwriteln()calls in:Since
VERBOSITY_QUIET(16) <VERBOSITY_NORMAL(32), this condition is only true when verbosity is below normal — i.e. only in--quietmode. At normal or verbose verbosity the condition is always false, so neither warning can ever fire under everyday usage. That's the inverse of the intended behaviour: a warning about a real filesystem misconfiguration should be visible by default, not hidden unless you pass--quiet.Fix
Drop the redundant/inverted verbosity gate.
OutputInterface::writeln()already respects the output's verbosity setting on its own — the extra condition wasn't needed and was backwards. This restores both warnings (fallback-folder-in-use and folder-found-but-not-used) to firing at normal verbosity as before netz98#1643, while keeping netz98#1643's real fix (the earlyis_dir()return) intact.Testing
php -l src/N98/Magento/Application.phppasses. No existing unit tests covercheckVarDir()(none were added in netz98#1643 either).