[Foundation] added a check to the Universal class loader
This commit is contained in:
parent
5cdee87b14
commit
67964d0daa
@ -124,7 +124,11 @@ class UniversalClassLoader
|
|||||||
if (0 === strpos($namespace, $ns))
|
if (0 === strpos($namespace, $ns))
|
||||||
{
|
{
|
||||||
$class = substr($class, $pos + 1);
|
$class = substr($class, $pos + 1);
|
||||||
require $dir.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
|
$file = $dir.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
|
||||||
|
if (file_exists($file))
|
||||||
|
{
|
||||||
|
require $file;
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -137,7 +141,11 @@ class UniversalClassLoader
|
|||||||
{
|
{
|
||||||
if (0 === strpos($class, $prefix))
|
if (0 === strpos($class, $prefix))
|
||||||
{
|
{
|
||||||
require $dir.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
|
$file = $dir.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
|
||||||
|
if (file_exists($file))
|
||||||
|
{
|
||||||
|
require $file;
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user