All, except security block, include()/require() rewritten to own LOAD_INC()/LOAD_INC_...
[mailer.git] / inc / extensions.php
index 91646a16cc79a8a65afc9976cacc9e67042c16b5..c299557333522e4501d84249867f5bc6c7af3ff1 100644 (file)
@@ -55,7 +55,7 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
        } // END - if
 
        // Construct FQFN for extension file
-       $extInclude = sprintf("%sinc/extensions/ext-%s.php", PATH, $ext_name);
+       $extInclude = sprintf("inc/extensions/ext-%s.php", $ext_name);
 
        // Is the extension file NOT there?
        if (!FILE_READABLE($extInclude)) {
@@ -67,25 +67,25 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
        } // END - if
 
        // Construct FQFN for language file
-       $langInclude = sprintf("%sinc/language/%s_%s.php", PATH, $ext_name, GET_LANGUAGE());
+       $langInclude = sprintf("inc/language/%s_%s.php", $ext_name, GET_LANGUAGE());
 
        // Is this include there?
        if ((FILE_READABLE($langInclude)) && (!isset($EXT_LOADED['lang'][$ext_name]))) {
                // Then load it
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "--- Language loaded.");
                $EXT_LOADED['lang'][$ext_name] = true;
-               require($langInclude);
+               LOAD_INC_ONCE($langInclude);
        } // END - if
 
        // Construct FQFN for functions file
-       $funcsInclude = sprintf("%sinc/libs/%s_functions.php", PATH, $ext_name);
+       $funcsInclude = sprintf("inc/libs/%s_functions.php", $ext_name);
 
        // Is this include there?
        if ((FILE_READABLE($funcsInclude)) && (!isset($EXT_LOADED['funcs'][$ext_name]))) {
                // Then load it
                //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "--- Functions loaded.");
                $EXT_LOADED['funcs'][$ext_name] = true;
-               require($funcsInclude);
+               LOAD_INC_ONCE($funcsInclude);
        } // END - if
 
        // Extensions are not deprecated by default
@@ -102,7 +102,7 @@ function LOAD_EXTENSION ($ext_name, $EXT_LOAD_MODE = "", $EXT_VER = "", $dry_run
 
        // Include the extension file
        //* DEBUG: */ DEBUG_LOG(__FUNCTION__, __LINE__, "Extension loaded.");
-       require($extInclude);
+       LOAD_INC($extInclude);
 
        // Is this extension deprecated?
        if ($EXT_DEPRECATED == "Y") {
@@ -667,7 +667,7 @@ function CREATE_NEW_EXTENSION_TASK ($admin_id, $subject, $ext) {
        if ((DETERMINE_TASK_ID_BY_SUBJECT($subject) == 0) && (GET_EXT_VERSION($ext) == "")) {
                // Template file
                $tpl = sprintf("%stemplates/%s/html/ext/ext_%s.tpl",
-                       PATH,
+                       constant('PATH'),
                        GET_LANGUAGE(),
                        $ext
                );