-
Notifications
You must be signed in to change notification settings - Fork 29
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
[BLUEPRINT] Module registration #151
Comments
Thanks for this Oliver; very informative. |
The ability to list all installed packages is not only useful for composer commands, but also for the Web UI and plugin management at a later date. Have you considered how the initial composer commands may relate to or interact with the Web UI related system in future, or will these be handled separately? |
I don't see a problem with a package being relatively small an simple. This package will conflict with the In addition, I need a relatively small package for the automated tests for the module registration code in the core. I'd like to use the "empty start page" module for this. |
I'll make the code that finds out which modules are installed available as a class that can be used also outside the Composer scripts. In our conference call with Michiel, we decided to not add a UI for Composer (i.e., also for the module management) at the moment. |
Both sound good to me. @michield Please can you review and comment? |
Update on the approach after more research and some prototyping: It is not possible to use parameters (like %kernel.application_dir%) when importing configuration files. So the approach for the generated, application-wide configuration files will not work (and I'll need to find out a way to include an application-wide parameters file). However, it is possible to have installed bundles automatically include their configuration. I'm planning to use this. I'm going to update the blueprint accordingly. |
Looks good. I think the most important part of modules is to have good documentation and an example one that does some basic things, possibly a few with different capabilities (eg https://github.com/michield/phplist-plugin-subscribeexample) The threshold to start coding modules should be as low as possible. The issue on conflicting modules should be handled by a module manager. For example only one module can offer a particular service and the choice which one is with the person managing it (either during config or possibly in the UI). For example the way that phpList3 has the "editorprovider" and now the "emailsenderplugin" and "authenticationplugin". There can only be one of each. Modules should also be allowed to add to the commandline processes. I also think it will be good to standardise (and enforce) the way they are configured and log their output via a central system. In general I would encourage the modules to use the rest api to do things. |
@michield Thanks for the feedback! |
@oliverklee Can't we rely on composer for this?
@oliverklee Would it be simpler for third party modules to use Symfony routing, or the REST API? Or perhaps have the choice of either? |
Yes, that's the plan: to figure out and document how to use Composer for this.
In general, they have the choice:
|
I think there should be a clear recommendation from core developers to third party module developers about this, as to which is the better approach. If software is using the REST API to interact with phpList 4 core, then it would seem to be more of an app than a module -- less integrated, more flexible, with no requirement to run on the same server (presumably). Any opinions on this? |
Agreed. I'll take care adding this to the documentation. |
This is now all done. Closing. |
This is the plan for how module registration for phpList 4 should work. Comments and feedback welcome.
Principles
phplist-module
defined in thecomposer.json
.require
section of thecomposer.json
).composer.json
and then running acomposer update
. It will not be possible for a package to be in an "installed, but not activated" state.base-distribution
package, both with automated tests as well as manual tests. (The module package usually will depend on at least thephplist4-core
package, though.)composer.json
to conflict with each (or more specifically: with other packages that provide the same capabilities) (TODO: document how to do this)Technical approach
extra
section of itscomposer.json
.phplist4-core
package will provide a composer script that lists all installed modules (i.e., all installed composer packages that have the corresponding type). (The core might need to read vendor/composer/installed.json for this. I'll need to check this.) This script will be there mainly for convenience, and also to keep the PRs relatively small. This script will also be accessible via abin/console
command.phplist4-core
package will provide a composer script that runs through all installed module packages, reads their composer.json file, and generates the root application bundle classes file. This script will listen to the update and install events of all phplist 4 packages (including the core). It will also listen to the package creation event of thebase-distribution
package. (NB: Scripts will always only be executed for the current root package, not for any dependencies.)base-distribution
package (as long as theweb-frontend
package does not provide any usable content). This package will conflict with theweb-frontend
package as both provide the/
route (i.e., the root route). This package will also be used by the automated tests for module registration in thephplist4-core
package.(Planned) Pull requests
phplist4-core
package. This will include a PHP class for this that can also be used for other things.phplist4-core
package, move the REST API configuration and the "empty start page" configuration there, and add it to Git. (At this stage, thephplist4-core
still has hard-coded references to therest-api
package.) (This config file will be removed once auto-generation of the config file is added.)phplist4-core
package and delete the old manual configuration file. Add composer listeners for update and install to thephplist4-core
package and add the file to the.gitignore
.base-distribution
package, add composer listeners for update and install to thephplist4-core
package and add the file to the.gitignore
.rest-api
package.phplist4-core
package.The text was updated successfully, but these errors were encountered: