add tracer_enabled check to the database class to prevent unnecessary memory build-up when tracer isn't outputting.

Globalized tracer_enabled to make it easier to access
This commit is contained in:
Matthew Barbour
2019-07-31 08:52:17 -05:00
committed by matthew
parent 7d110f11b6
commit fc294bfb3c
3 changed files with 12 additions and 5 deletions

View File

@@ -15,6 +15,11 @@ require_once "vendor/autoload.php";
_version_check();
_sanitise_environment();
// The trace system has a certain amount of memory consumption every time it is used,
// so to prevent running out of memory during complex operations code that uses it should
// check if tracer output is enabled before making use of it.
$tracer_enabled = constant('TRACE_FILE')!==null;
// load base files
$_tracer->begin("Bootstrap");
$_tracer->begin("Opening files");