Add warning in status widget when debug mode is enabled (#4500)

Debug mode is now shown as a warning in the Status report widget to indicate that its use is discouraged for production websites.

Credit to @Samuell1.
This commit is contained in:
Samuell 2019-08-15 05:44:22 +02:00 committed by Ben Thomson
parent 188c565d69
commit 60a235e000
2 changed files with 5 additions and 0 deletions

View File

@ -364,6 +364,7 @@ return [
'permissions' => 'Directory :name or its subdirectories is not writable for PHP. Please set corresponding permissions for the webserver on this directory.',
'extension' => 'The PHP extension :name is not installed. Please install this library and activate the extension.',
'plugin_missing' => 'The plugin :name is a dependency but is not installed. Please install this plugin.',
'debug' => 'Debug mode is enabled. This is not recommended for production installations.'
],
'editor' => [
'menu_label' => 'Editor settings',

View File

@ -99,6 +99,10 @@ class Status extends ReportWidgetBase
$writablePaths[] = themes_path();
}
if (Config::get('app.debug', true)) {
$warnings[] = Lang::get('backend::lang.warnings.debug');
}
$requiredExtensions = [
'GD' => extension_loaded('gd'),
'fileinfo' => extension_loaded('fileinfo'),