Add helper to know if we currently are in "debug" mode

Can be used to enable more features / debugging tools throughout the application.
This commit is contained in:
Molkobain
2020-07-16 14:02:14 +02:00
parent f5df442e8b
commit c9b80074f4

View File

@@ -2119,6 +2119,18 @@ class utils
return ITOP_REVISION === 'svn';
}
/**
* Check if debug is enabled in the current environment.
* Currently just checking if the "debug=true" parameter is in the URL, but could be more complex.
*
* @return bool
* @since 2.8.0
*/
public static function IsDebugEnabled()
{
return utils::ReadParam('debug') === 'true';
}
/**
* @see https://php.net/manual/en/function.finfo-file.php
*