Skip to content
Snippets Groups Projects
Commit a45a62db authored by Frank Morgner's avatar Frank Morgner
Browse files

refs #12803

* revert former new namespacing of GetGenericController method at finc\Controller\Factory
parent d9c4f90e
No related merge requests found
...@@ -60,14 +60,25 @@ class Factory extends FactoryBase ...@@ -60,14 +60,25 @@ class Factory extends FactoryBase
{ {
// Prepend the current namespace unless we receive a FQCN: // Prepend the current namespace unless we receive a FQCN:
$class = (strpos($name, '\\') === false) $class = (strpos($name, '\\') === false)
? __NAMESPACE__ . '\\' . $name : $name; ? static::getNamespace() . '\\' . $name : $name;
if (!class_exists($class) && strpos($name, '\\') === false) { if (!class_exists($class)) {
$class = "\\VuFind\\Controller\\$name"; throw new \Exception('Cannot construct ' . $class);
}
if (!class_exists($class)) {
throw new \Exception('Cannot construct ' . $class);
} }
return new $class($sm->getServiceLocator()); return new $class($sm->getServiceLocator());
}
/**
* Get namespace of class
*
* @return string Namespace
* @access private
*/
private static function getNamespace()
{
return substr(
static::class, 0,
strrpos(static::class, '\\')
);
} }
/** /**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment