-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
GPM always connects to getgrav server, even when only want to get Local Packages #1742
Comments
Cool, i'll look forward to your PR. |
I would use DI to lazy load remote packages only if they are needed. |
Me too @mahagr, that's my idea as well. There is not dependency injection manager/framework in this project yet. Changing to DI is not straight forward now since it could break other things where the GPM is used (plugins for instance). |
Grav uses DI, but inits all the classes early, eg. it doesn't lazy load most things. |
Well, Pimple is a service locator, not a proper dependency injection manager that's why I said that Grav is not using DI manager, and yes, it does not lazy load dependencies, which is also bad. |
…nnect to Remote repositories even if only Local package was needed
PR added to solve this issue |
…o Remote repositories even if only Local package was needed (#1746) All good, thanks!
@aguvillalba You may want to take a look into the issue as your change was reverted because of it broke plugin/theme installation. |
I have disabled the option enable_auto_updates_check:
enable_auto_updates_check: false
The partial template user/plugins/admin/themes/grav/templates/partials/nav.html.twig tries to get the number of installed plugins:
{{ admin.plugins|length }} (line 61)
This calls to:
Grav\Plugin\Admin\Admin::plugins(true) --->
Grav\Plugin\Admin\Admin::gpm() --->
Grav\Common\GPM::__construct()
And in that construct you have this code:
So, independently of whether I want to the local plugins (Admin::plugins(true)) or not, the constructor of GPM will always try to connect to getgrav.org server to get the plugins repository.
IMHO this does not makes sense, since I want the local plugins, there is no need to connect to the external server.
The connection to external server to get the remote packages should be removed from the constructor and place it in a explicit function that is called whenever is needed to grab the remote repository.
I will try to make a pull request to fix this.
Thank you!
The text was updated successfully, but these errors were encountered: