-
-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More helpful error message in checkEnvironment.php #958
Conversation
Codecov Report
@@ Coverage Diff @@
## hotfix #958 +/- ##
============================================
+ Coverage 36.82% 37.05% +0.22%
- Complexity 2121 2127 +6
============================================
Files 158 159 +1
Lines 7212 7233 +21
============================================
+ Hits 2656 2680 +24
+ Misses 4556 4553 -3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logic looks good. Careful with the indentation and overall style of your code. I added a couple of hint in the comments. StyleCi (style checker bot) will be activated on the main repo probably when I'm done with Support package, so better work on this now otherwise the bot will yell at you in your future PR 😛 .
I'll tag this for 4.2.1 release, give it a try and merge when I'm done with the other issue (unless someone else can review it before me 😬 )
if ($this->checkDirectories()) { | ||
$problemsFound = true; | ||
// Skip checkPermissions() if the required directories do not exist. | ||
return $problemsFound; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Careful with the indentation here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the information! I will look over the PSR guides and get more familiar with the UF style guide as well.
]; | ||
|
||
foreach ($directoryPaths as $directory => $path) { | ||
if ($path == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation should be 4 spaces
'success' => false | ||
]; | ||
} | ||
else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Brace should be on the same line per PSR-2
https://www.php-fig.org/psr/psr-2/#51-if-elseif-else
Related #934 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Styling should be fixed before this can be merged.
Merged into hotfix for 4.2.1 release. Thanks ! |
Provide helpful error message in situation where

cache
session
orlogs
is accidentally deleted or moved.The existing error was:
This adds

checkDirectories
which provides a more helpful error message:Because I was unable to come up with a more creative way to prevent
checkPermissions
from returning the generic error message, that check is skipped until the directories actually exist.