|
@ -16,6 +16,8 @@ class Load |
|
|
|
|
|
|
|
|
static protected $exclude = array(); |
|
|
static protected $exclude = array(); |
|
|
|
|
|
|
|
|
|
|
|
static protected $builder = null; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Add exclude path for autoload. Should be called before setAutoloadFrom |
|
|
* Add exclude path for autoload. Should be called before setAutoloadFrom |
|
|
* @static |
|
|
* @static |
|
@ -24,12 +26,12 @@ class Load |
|
|
*/ |
|
|
*/ |
|
|
static public function setExclude($exclude = array()) |
|
|
static public function setExclude($exclude = array()) |
|
|
{ |
|
|
{ |
|
|
if(!is_array($exclude)) { |
|
|
|
|
|
|
|
|
if (!is_array($exclude)) { |
|
|
$exclude = array($exclude); |
|
|
$exclude = array($exclude); |
|
|
} |
|
|
} |
|
|
self::$exclude = array_merge(self::$exclude, $exclude); |
|
|
self::$exclude = array_merge(self::$exclude, $exclude); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static public function setAutoloadFrom($file) |
|
|
static public function setAutoloadFrom($file) |
|
|
{ |
|
|
{ |
|
|
self::$file = $file; |
|
|
self::$file = $file; |
|
@ -72,12 +74,14 @@ class Load |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$scan = array(PATH . '/' . APP . '/src', PATH . '/lib'); |
|
|
$scan = array(PATH . '/' . APP . '/src', PATH . '/lib'); |
|
|
$exclude = array_merge(self::$exclude, array(PATH . '/.git', PATH . '/lib/core/tests', PATH . '/lib/core/.git')); |
|
|
|
|
|
|
|
|
$exclude = array_merge(self::$exclude, array(PATH . '/.git', PATH . '/lib/core/tests', PATH . '/lib/core/.git')); |
|
|
|
|
|
|
|
|
require_once(PATH . '/lib/core/util/AutoloadBuilder.php'); |
|
|
|
|
|
|
|
|
|
|
|
$builder = new AutoloadBuilder(self::$file, $scan, $exclude); |
|
|
|
|
|
$builder->build(); |
|
|
|
|
|
|
|
|
if (!self::$builder) { |
|
|
|
|
|
require_once(PATH . '/lib/core/util/AutoloadBuilder.php'); |
|
|
|
|
|
self::$builder = new AutoloadBuilder(self::$file, $scan, $exclude); |
|
|
|
|
|
} |
|
|
|
|
|
self::$builder->build(); |
|
|
ignore_user_abort(false); |
|
|
ignore_user_abort(false); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |