Skip to content
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

[5.4] Handle missing or malformed config/app.php file #18466

Merged
merged 2 commits into from
Mar 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ public function bootstrap(Application $app)
*/
protected function loadConfigurationFiles(Application $app, RepositoryContract $repository)
{
$files = $this->getConfigurationFiles($app);

if (! isset($files['app'])) {
throw new \Exception('Unable to load the config/app.php file.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally, we import things. :)

}

foreach ($this->getConfigurationFiles($app) as $key => $path) {
$repository->set($key, require $path);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Foundation/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ protected function convertExceptionToResponse(Exception $e)
{
$e = FlattenException::create($e);

$handler = new SymfonyExceptionHandler(config('app.debug'));
$handler = new SymfonyExceptionHandler(config('app.debug', true));

return SymfonyResponse::create($handler->getHtml($e), $e->getStatusCode(), $e->getHeaders());
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Log/LogServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected function configureErrorlogHandler(Writer $log)
protected function handler()
{
if ($this->app->bound('config')) {
return $this->app->make('config')->get('app.log');
return $this->app->make('config')->get('app.log', 'single');
}

return 'single';
Expand Down