diff options
author | Robin Appelman <robin@icewind.nl> | 2019-11-04 19:32:49 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2019-11-04 19:40:08 +0100 |
commit | 5ca27085fcb01db920326ea9ad892cc9a49253ab (patch) | |
tree | 4ae6571ac10666f82b56586e9f02d2d0461ac78a | |
parent | 13960b69da2593dcfb0cbaef222ee8b9a33142c0 (diff) | |
download | nextcloud-server-5ca27085fcb01db920326ea9ad892cc9a49253ab.tar.gz nextcloud-server-5ca27085fcb01db920326ea9ad892cc9a49253ab.zip |
mark getAppContainer as a valid way to construct app containers
this is triggerd (and not cought by the query arm) if an item from an app is queried before the app queries it's own Application instance
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | lib/public/AppFramework/App.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/public/AppFramework/App.php b/lib/public/AppFramework/App.php index 3b42b28758d..fd91d8d058d 100644 --- a/lib/public/AppFramework/App.php +++ b/lib/public/AppFramework/App.php @@ -77,6 +77,8 @@ class App { $e = new \RuntimeException('App class ' . $applicationClassName . ' is not setup via query() but directly'); $setUpViaQuery = false; + $classNameParts = explode('\\', trim($applicationClassName, '\\')); + foreach ($e->getTrace() as $step) { if (isset($step['class'], $step['function'], $step['args'][0]) && $step['class'] === ServerContainer::class && @@ -84,6 +86,12 @@ class App { $step['args'][0] === $applicationClassName) { $setUpViaQuery = true; break; + } else if (isset($step['class'], $step['function'], $step['args'][0]) && + $step['class'] === ServerContainer::class && + $step['function'] === 'getAppContainer' && + $step['args'][1] === $classNameParts[1]) { + $setUpViaQuery = true; + break; } } |