- /**
- * 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
- }
-
- /**
- * Fall-back method. Please replace loadClasses() with scanClassPath() !
- *
- * @param $basePath The relative base path to 'base_path' constant for all classes
- * @param $ignoreList An optional list (array forced) of directory and file names which shall be ignored
- * @return void
- * @deprecated
- * @todo Rewrite your apps to scanClassPath()
- */
- public function loadClasses ($basePath, array $ignoreList = array() ) {
- // This outputs an ugly message because you need to change to scanClassPath
- print __METHOD__." is deprecated. Use scanClassPath() to make this warning go away.<br />\n";
-
- // Call our new method
- $this->scanClassPath($basePath, $ignoreList);
- }
-