buildAppNamespace already has the fallback

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-03-22 10:13:14 +01:00
parent 67909cf87b
commit 9208f6379c
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 1 additions and 11 deletions

View File

@ -373,15 +373,6 @@ class DIContainer extends SimpleContainer implements IAppContainer {
});
}
private function getFallbackNamespace($name) {
$segments = explode('\\', $name);
if (count($segments) >= 2) {
return $segments[0] . '\\' . ucfirst(strtolower($segments[1]));
} else {
return null;
}
}
public function query($name) {
$name = $this->sanitizeName($name);
@ -392,8 +383,7 @@ class DIContainer extends SimpleContainer implements IAppContainer {
return parent::query($name);
} else if ($this['AppName'] === 'core' && strpos($name, 'OC\\Core\\') === 0) {
return parent::query($name);
} else if (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName'])) === 0 ||
$this->getFallbackNamespace($name) === \OC\AppFramework\App::buildAppNamespace($this['AppName'])) {
} else if (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']) . '\\') === 0) {
return parent::query($name);
}
}