Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: Correctly ignore lazy ghost initialization in debug warning abou…
…t direct constructor call

Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Jun 16, 2025
commit 4a1eb3dc2afa7946d7ad930535e1dc5a4db8a801
6 changes: 4 additions & 2 deletions lib/public/AppFramework/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/
namespace OCP\AppFramework;

use OC\AppFramework\Utility\SimpleContainer;
use OC\ServerContainer;
use OCP\IConfig;
use OCP\Server;
Expand Down Expand Up @@ -70,9 +71,10 @@ public function __construct(string $appName, array $urlParams = []) {
$setUpViaQuery = true;
break;
} elseif (isset($step['class'], $step['function'], $step['args'][0]) &&
$step['class'] === \ReflectionClass::class &&
$step['function'] === 'initializeLazyObject' &&
$step['class'] === SimpleContainer::class &&
preg_match('/{closure:OC\\\\AppFramework\\\\Utility\\\\SimpleContainer::buildClass\\(\\):\\d+}/', $step['function']) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance wise maybe str_starts_with until the end of buildClass?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance in debug mode is not a concern 🤷
But yeah, that would work too, I do not really care which gets merged.

$step['args'][0] === $this) {
/* We are setup through a lazy ghost, fine */
$setUpViaQuery = true;
break;
}
Expand Down
Loading