Make sure we create an app's Application class just once
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
This commit is contained in:
parent
a373fd5848
commit
f6a79338d4
|
@ -727,7 +727,7 @@ class OC {
|
||||||
// Make sure that the application class is not loaded before the database is setup
|
// Make sure that the application class is not loaded before the database is setup
|
||||||
if ($systemConfig->getValue("installed", false)) {
|
if ($systemConfig->getValue("installed", false)) {
|
||||||
OC_App::loadApp('settings');
|
OC_App::loadApp('settings');
|
||||||
$settings = new \OCA\Settings\AppInfo\Application();
|
$settings = \OC::$server->query(\OCA\Settings\AppInfo\Application::class);
|
||||||
$settings->register();
|
$settings->register();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -371,7 +371,7 @@ class Router implements IRouter {
|
||||||
$applicationClassName = $appNameSpace . '\\AppInfo\\Application';
|
$applicationClassName = $appNameSpace . '\\AppInfo\\Application';
|
||||||
|
|
||||||
if (class_exists($applicationClassName)) {
|
if (class_exists($applicationClassName)) {
|
||||||
$application = new $applicationClassName();
|
$application = \OC::$server->query($applicationClassName);
|
||||||
} else {
|
} else {
|
||||||
$application = new App($appName);
|
$application = new App($appName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,8 +100,9 @@ class ServerContainer extends SimpleContainer {
|
||||||
if (!isset($this->hasNoAppContainer[$namespace])) {
|
if (!isset($this->hasNoAppContainer[$namespace])) {
|
||||||
$applicationClassName = 'OCA\\' . $sensitiveNamespace . '\\AppInfo\\Application';
|
$applicationClassName = 'OCA\\' . $sensitiveNamespace . '\\AppInfo\\Application';
|
||||||
if (class_exists($applicationClassName)) {
|
if (class_exists($applicationClassName)) {
|
||||||
new $applicationClassName();
|
$app = new $applicationClassName();
|
||||||
if (isset($this->appContainers[$namespace])) {
|
if (isset($this->appContainers[$namespace])) {
|
||||||
|
$this->appContainers[$namespace]->offsetSet($applicationClassName, $app);
|
||||||
return $this->appContainers[$namespace];
|
return $this->appContainers[$namespace];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue