Skip to content

Commit

Permalink
Bootstrap cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonkelly committed Apr 30, 2019
1 parent 70abee5 commit 48051d1
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions bootstrap/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
$parts = explode('=', $arg);
$value = $parts[1];
unset($_SERVER['argv'][$key]);

return $value;
}
}
Expand All @@ -45,7 +44,6 @@

$findConfigPath = function($constName, $argName) use ($findConfig) {
$path = $findConfig($constName, $argName);

return $path ? realpath($path) : null;
};

Expand All @@ -57,7 +55,6 @@
if (!mkdir($path, 0755, true)) {
// Set a 503 response header so things like Varnish won't cache a bad page.
http_response_code(503);

exit('Tried to create a folder at ' . $path . ', but could not.' . PHP_EOL);
}

Expand All @@ -74,17 +71,13 @@
if ($realPath === false || !is_dir($realPath) || !@file_exists($realPath . '/.')) {
// Set a 503 response header so things like Varnish won't cache a bad page.
http_response_code(503);

exit(($realPath !== false ? $realPath : $path) . ' doesn\'t exist or isn\'t writable by PHP. Please fix that.' . PHP_EOL);
}

if ($writableToo) {
if (!is_writable($realPath)) {
// Set a 503 response header so things like Varnish won't cache a bad page.
http_response_code(503);

exit($realPath . ' isn\'t writable by PHP. Please fix that.' . PHP_EOL);
}
if ($writableToo && !is_writable($realPath)) {
// Set a 503 response header so things like Varnish won't cache a bad page.
http_response_code(503);
exit($realPath . ' isn\'t writable by PHP. Please fix that.' . PHP_EOL);
}
};

Expand Down

0 comments on commit 48051d1

Please sign in to comment.