Browse Source

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>
tags/v18.0.0beta1
Robin Appelman 4 years ago
parent
commit
5ca27085fc
No account linked to committer's email address
1 changed files with 8 additions and 0 deletions
  1. 8
    0
      lib/public/AppFramework/App.php

+ 8
- 0
lib/public/AppFramework/App.php View File

@@ -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;
}
}


Loading…
Cancel
Save