aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/AppFramework/App.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/AppFramework/App.php')
-rw-r--r--lib/public/AppFramework/App.php24
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/public/AppFramework/App.php b/lib/public/AppFramework/App.php
index 6860de7c324..c00fde47418 100644
--- a/lib/public/AppFramework/App.php
+++ b/lib/public/AppFramework/App.php
@@ -9,6 +9,7 @@ declare(strict_types=1);
*/
namespace OCP\AppFramework;
+use OC\AppFramework\Utility\SimpleContainer;
use OC\ServerContainer;
use OCP\IConfig;
use OCP\Server;
@@ -57,16 +58,23 @@ class App {
$classNameParts = explode('\\', trim($applicationClassName, '\\'));
foreach ($e->getTrace() as $step) {
- if (isset($step['class'], $step['function'], $step['args'][0]) &&
- $step['class'] === ServerContainer::class &&
- $step['function'] === 'query' &&
- $step['args'][0] === $applicationClassName) {
+ if (isset($step['class'], $step['function'], $step['args'][0])
+ && $step['class'] === ServerContainer::class
+ && $step['function'] === 'query'
+ && $step['args'][0] === $applicationClassName) {
$setUpViaQuery = true;
break;
- } elseif (isset($step['class'], $step['function'], $step['args'][0]) &&
- $step['class'] === ServerContainer::class &&
- $step['function'] === 'getAppContainer' &&
- $step['args'][1] === $classNameParts[1]) {
+ } elseif (isset($step['class'], $step['function'], $step['args'][0])
+ && $step['class'] === ServerContainer::class
+ && $step['function'] === 'getAppContainer'
+ && $step['args'][1] === $classNameParts[1]) {
+ $setUpViaQuery = true;
+ break;
+ } elseif (isset($step['class'], $step['function'], $step['args'][0])
+ && $step['class'] === SimpleContainer::class
+ && preg_match('/{closure:OC\\\\AppFramework\\\\Utility\\\\SimpleContainer::buildClass\\(\\):\\d+}/', $step['function'])
+ && $step['args'][0] === $this) {
+ /* We are setup through a lazy ghost, fine */
$setUpViaQuery = true;
break;
}