Fixed an issue with lookup of namespaces in UniversalLoader #2

Closed
wants to merge 1 commit into
from
@@ -194,15 +194,16 @@ public function loadClass($className)
foreach($this->namespaces as $namespace => $path)
{
- if(0 === strpos($className, $namespace))
+ if(0 === strpos($className, $namespace . $this->namespaceSeparator))
{
$rest = strrchr($className, $this->namespaceSeparator);
$replacement =
str_replace($this->namespaceSeparator, '/', substr($className, 0, strlen($className) - strlen($rest))).
str_replace(array('_', $this->namespaceSeparator), '/', $rest);
require($path.$replacement.$this->extensions[$namespace]);
+
return true;
- }
+ }
}
return false;
} // end loadClass();