+
+ // Skip here if no dev-mode
+ if (defined('DEVELOPER')) return;
+
+ // IS the cache there?
+ if (file_exists($this->listCacheFQFN)) {
+ // Get content
+ $cacheContent = file_get_contents($this->listCacheFQFN);
+
+ // And convert it
+ $this->classes = unserialize($cacheContent);
+
+ // List has been restored from cache!
+ $this->listCached = true;
+ } // END - if
+
+ // Does the class cache exist?
+ if (file_exists($this->classCacheFQFN)) {
+ // Then include it
+ require($this->classCacheFQFN);
+
+ // Mark the class cache as loaded
+ $this->classesCached = true;
+ } // END - if
+ }
+
+ /**
+ * The destructor makes it sure all caches got flushed
+ *
+ * @return void
+ */
+ public function __destruct () {
+ // Skip here if dev-mode
+ if (defined('DEVELOPER')) return;
+
+ // Skip here if already cached
+ if ($this->listCached === false) {
+ // Writes the cache file of our list away
+ $cacheContent = serialize($this->classes);
+ file_put_contents($this->listCacheFQFN, $cacheContent);
+ } // END - if
+
+ // Skip here if already cached
+ if ($this->classesCached === false) {
+ // Generate a full-cache of all classes
+ $cacheContent = "";
+ foreach ($this->loadedClasses as $fqfn) {
+ // Load the file
+ $cacheContent .= file_get_contents($fqfn);
+ } // END - foreach
+
+ // And write it away
+ file_put_contents($this->classCacheFQFN, $cacheContent);
+ } // END - if