-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dedicated API for apps' bootstrapping process #20865
Conversation
|
ee55e01
to
8c54e4a
Compare
8587cc3
to
40153ca
Compare
} | ||
|
||
/** | ||
* Now that all register methods have been called, we can delegate the registrations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't have to do this here. we could actually either wait until right before the first boot
method invocation or when the individual services are used
I like it. But I gues we should start to do that differently anyways. And revamp that. So that it actually works as expected. |
285837e
to
1359f2c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 lets do this!
Looks good to me 🚀
Good idea. I have a suggestion for the command implementation: I looked at https://symfony.com/doc/current/console/lazy_commands.html to make occ faster. Eventually loading the apps is the expensive step and not to create all those command objects itself but it's still a good thing to do (because if one calls occ maintenance:repair we only need the RepairCommand object). Here is a POC https://github.com/nextcloud/server/compare/enh/occ-lazy-load?expand=1. The basic requirement is that the name of the command is known before creating the object. Please consider to make the command name a required parameter for the command registration. That makes migration to lazy commands much easier and ensures that apps using the new way to register a command do it right. |
Makes sense, @kesselb. What I would also like to experiment with is proxy services instead of getting the real thing through constructor injection. Because right now you always build this huge tree of instances, when you'll most likely only every use some branches of that. Pimple, however, does not support it right now. The commands are only slowing down occ operations, right? I hope we don't load them for web requests.
Mind pressing the approve button? :P |
@@ -3,12 +3,9 @@ | |||
declare(strict_types=1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotta love this "git rename" ....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, didn't check to deeply nor transition over an app. But let's do it early.
I would like to withdraw my suggestion for commands. It's good to have all the commands definitions in appinfo.xml. If we add a attribute like
Yes
No Actually creating the command instances is not the expensive task. Loading all apps is the expensive one. |
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
1359f2c
to
a2c8bfa
Compare
Fixes #20573
Possible registrations (ticket=implemented there, rest follows in other PRs)
Possible ideas for the register or boot context