Exemplo n.º 1
0
 public static function init()
 {
     $directoryIterator = new RecursiveDirectoryIterator(__DIR__);
     $iterator = new RecursiveIteratorIterator($directoryIterator);
     $dirs = [];
     foreach ($iterator as $file) {
         if ($file->isDir()) {
             $dirs[] = $file->getRealPath();
         }
     }
     $dirs = array_unique($dirs);
     self::$dirs = $dirs;
 }
Exemplo n.º 2
0
 /**
  * Registers an array of directories to load from.
  * 
  * @access public
  * @static
  * @param array $files An array of directories to load from
  */
 public static function registerDirectories($dirs)
 {
     self::$dirs = array_merge(self::$dirs, $dirs);
 }
Exemplo n.º 3
0
 public static function register(array $dirs)
 {
     self::$dirs = array_merge(array(__DIR__), $dirs);
     spl_autoload_register(array('AutoLoader', 'load'));
 }