[Configuration] Fix open_basedir warnings (#887)

If .git/HEAD isn't in open_basedir it'd throw ugly warnings.
Suppress errors while checking if file is readable
This commit is contained in:
Yardena Cohen 2018-10-27 01:53:45 -07:00 committed by LogMANOriginal
parent 7621784598
commit c4896c7791
1 changed files with 2 additions and 1 deletions

View File

@ -107,7 +107,8 @@ class Configuration {
$headFile = '.git/HEAD';
if(file_exists($headFile)) {
// '@' is used to mute open_basedir warning
if(@is_readable($headFile)) {
$revisionHashFile = '.git/' . substr(file_get_contents($headFile), 5, -1);
$branchName = explode('/', $revisionHashFile)[3];