From 2bcf6743a5f2636713df5610729ae306035f54b1 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 12 Oct 2022 10:24:30 -0600 Subject: [PATCH] Ensure DOCUMENT_ROOT and PROJECT_PATH exist --- resources/functions.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/resources/functions.php b/resources/functions.php index daa25aac72..7528e4fe2a 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -2161,6 +2161,13 @@ function number_pad($number,$n) { } } +//set the include path + $conf = glob("{/usr/local/etc,/etc}/fusionpbx/config.conf", GLOB_BRACE); + set_include_path(parse_ini_file($conf[0])['document.root']); + +//includes files + require_once "resources/require.php"; + //include additional functions $functions = glob("{".$_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/functions/*.php,".$_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/resources/functions/*.php}", GLOB_BRACE); foreach($functions as $function) {