mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-18 02:25:05 +00:00
system: remove debug mode, disable display errors on runtime for development mode #5889
This commit is contained in:
parent
0d77a46b1f
commit
a256697cbf
@ -133,6 +133,13 @@ function webgui_configure_do($verbose = false, $interface = '')
|
||||
/* regenerate the php.ini files in case the setup has changed */
|
||||
configd_run('template reload OPNsense/WebGui');
|
||||
|
||||
/* we need a marker file for debug mode to ensure quick action */
|
||||
if (empty($config['system']['deployment'])) {
|
||||
@unlink('/var/run/development');
|
||||
} else {
|
||||
@touch('/var/run/development');
|
||||
}
|
||||
|
||||
/*
|
||||
* Force reloading all php-cgi children to
|
||||
* avoid hiccups with moved include files.
|
||||
|
||||
@ -25,10 +25,8 @@ error_reporting = E_ALL ^ (E_WARNING | E_NOTICE | E_DEPRECATED | E_STRICT | E_CO
|
||||
{% else %}
|
||||
error_reporting = E_ALL
|
||||
{% endif %}
|
||||
display_errors={% if system.deployment|default("") != "development" %}on{%else%}off{%endif%}
|
||||
|
||||
display_startup_errors={% if system.deployment|default("") == "debug" %}on{%else%}off{%endif%}
|
||||
|
||||
display_errors=on
|
||||
display_startup_errors=off
|
||||
log_errors=on
|
||||
error_log=/tmp/PHP_errors.log
|
||||
date.timezone="{{system.timezone|default('Etc/UTC')}}"
|
||||
|
||||
@ -31,6 +31,10 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
if (file_exists('/var/run/development')) {
|
||||
ini_set('display_errors', 0);
|
||||
}
|
||||
|
||||
require_once("util.inc");
|
||||
require_once("config.inc");
|
||||
|
||||
|
||||
@ -671,7 +671,7 @@ $(document).ready(function() {
|
||||
<input name="httpaccesslog" type="checkbox" value="yes" <?= empty($pconfig['httpaccesslog']) ? '' : 'checked="checked"' ?> />
|
||||
<?=gettext("Enable access log"); ?>
|
||||
<div class="hidden" data-for="help_for_httpaccesslog">
|
||||
<?=gettext("Enable access logging on the webinterface for debugging and analysis purposes.") ?>
|
||||
<?=gettext("Enable access logging on the web GUI for debugging and analysis purposes.") ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -1048,13 +1048,9 @@ $(document).ready(function() {
|
||||
<option value="development" <?= $pconfig['deployment'] == 'development' ? 'selected="selected"' : '' ?>>
|
||||
<?=gettext("Development");?>
|
||||
</option>
|
||||
<option value="debug" <?=$pconfig['deployment'] == 'debug' ? 'selected="selected"' : '' ?>>
|
||||
<?=gettext("Debug");?>
|
||||
</option>
|
||||
</select>
|
||||
<div class="hidden" data-for="help_for_deployment">
|
||||
<?=gettext("Set the deployment type of this OPNsense instance.");?></br>
|
||||
<?=gettext("Warning: enabling debug mode will affect the GUI's layout and may break usability.");?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user