+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'pool=' . $pool.' - END');
+
+ // Remove it
+ initIncludePool($pool);
+}
+
+// Loads an include file and logs any missing files for debug purposes
+function loadInclude ($inc) {
+ // Do we have cache?
+ if (!isset($GLOBALS['inc_loaded'][$inc])) {
+ // Is the include file there?
+ if (!isIncludeReadable($inc)) {
+ // Not there so log it
+ reportBug(__FUNCTION__, __LINE__, sprintf("Include file %s not found or deprecated.", $inc));
+ } // END - if
+
+ // Add the path. This is why we need a trailing slash in config.php
+ $GLOBALS['inc_loaded'][$inc] = getPath() . $inc;
+ } // END - if
+
+ // Try to load it
+ include($GLOBALS['inc_loaded'][$inc]);
+}
+
+// Loads an include file once
+function loadIncludeOnce ($inc) {
+ // Is it not loaded?
+ if (!isset($GLOBALS['load_once'][$inc])) {
+ // Mark it as loaded
+ $GLOBALS['load_once'][$inc] = 'loaded';
+
+ // Then try to load it
+ loadInclude($inc);
+ } // END - if
+}
+
+// Checks whether an include file (non-FQFN better) is readable
+function isIncludeReadable ($inc) {
+ // Do we have cache?
+ if (!isset($GLOBALS['inc_readable'][$inc])) {
+ // Construct FQFN
+ $FQFN = getPath() . $inc;
+
+ // Is it readable and at least 50 byte large? Include file sizes < 50 byte are always deprecated
+ $GLOBALS['inc_readable'][$inc] = ((isFileReadable($FQFN)) && (filesize($FQFN) >= 50));
+ } // END - if
+
+ // Return result
+ return $GLOBALS['inc_readable'][$inc];