Bug fix & changing loop + array_unshift to array_merge
parent
538cdc914b
commit
7d5e4f76fb
|
@ -84,12 +84,17 @@ class ClassLoader
|
||||||
public function add($prefix, $paths, $prepend = false)
|
public function add($prefix, $paths, $prepend = false)
|
||||||
{
|
{
|
||||||
if (!$prefix) {
|
if (!$prefix) {
|
||||||
foreach ((array) $paths as $path) {
|
|
||||||
if ($prepend) {
|
if ($prepend) {
|
||||||
array_unshift($this->fallbackDirs, $path);
|
$this->fallbackDirs = array_merge(
|
||||||
} else {
|
(array) $paths,
|
||||||
$this->fallbackDirs[] = $path;
|
$this->fallbackDirs
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$this->fallbackDirs = array_merge(
|
||||||
|
$this->fallbackDirs,
|
||||||
|
(array) $paths
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -121,7 +126,7 @@ class ClassLoader
|
||||||
public function set($prefix, $paths)
|
public function set($prefix, $paths)
|
||||||
{
|
{
|
||||||
if (!$prefix) {
|
if (!$prefix) {
|
||||||
$this->fallbackDirs = (array) $path;
|
$this->fallbackDirs = (array) $paths;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue