[4.0][CLI] Add a task to discover extensions#31524
[4.0][CLI] Add a task to discover extensions#31524HLeithner merged 23 commits intojoomla:4.0-devfrom
Conversation
|
@astridx Could you check and fix PHP code style errors reported by drone here https://ci.joomla.org/joomla/joomla-cms/37913/1/6? Thanks in advance |
|
@laoneo @richard67 Thank you. I fixed the copy and pasted mistakes. |
|
@astridx Thanks. It might be that system tests are failing in drone for your PR, but this is very likely unrelated. But if you want to have it nice, you can update your branch to latest 4.0-dev of the CMS, then the system tests will pass and all will be green, which looks nicer ;-) |
|
Now it is nice and green :) |
Co-authored-by: Brian Teeman <brian@teeman.net>
|
I have tested this item ✅ successfully on 4a1e74f This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31524. |
|
Does this find the extensions or does it install them? |
|
@brianteeman is right - can we name this to discover install - because we should add a separate discover task which covers the 'refresh' task in github https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_installer/controllers/discover.php#L26-L33 |
|
I have tested this item ✅ successfully on b4ffab6 Copied the following free 3rd party extensions to modules and the PR detected and installed them: This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31524. |
| */ | ||
| public function processDiscover($eid): bool | ||
| { | ||
| $jInstaller = new Installer; |
There was a problem hiding this comment.
Can you also inject the installer the same way as the database.
There was a problem hiding this comment.
Installer isn’t available in the container. So I think we should make it optionally injectable in the constructor for testing. But still fine to run the init in the constructor if nothing is passed in
There was a problem hiding this comment.
You can create the instance in the serviceprovider
There was a problem hiding this comment.
@laoneo @wilsonge
I would like to leave it that way in this PR because it is implemented in the same way in other places.
For example here:
I think it is confusing when things are different in a CMS. I agree with you that it should be changed. But then in all places. I would do this in a separate PR.
@wilsonge I don't understand what you mean with this. |
|
I guess he means to rename the class to ExtensionDiscoverInstallCommand. |
|
Renamed the classes, can be tested now. |
|
Joomla 4.0 is in feature freeze can you please rebase this on j4.1 or I can do this for you, thanks |
|
This is not a feature, it is an enhancement. And I need it for testing extensions in j4. So no way to rebase to 4.1. |
|
And I need joomla 4 ready to ship |
|
And postponing this to 4.1 will help? |
|
Ok, I give up. Do whatever you want with it. I'm building it on my own |
ExtensionDiscoverInstall renamed to ExtensionDiscoverInstallCommand
|
after the latest commit this is needed ExtensionDiscoverInstall renamed to ExtensionDiscoverInstallCommand |
ExtensionDiscoverInstall renamed to ExtensionDiscoverInstallCommand
|
I have tested this item ✅ successfully on 1381942 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31524. |
…extension has a problem
|
thanks and sorry |
Summary of Changes
i added a CLI task to discover extensions. I took #28666 as an example
Testing Instructions
Apply this PR
Copy or symlink an extension to your Joomla installation
Run
php ./cli/joomla.php extension:discover --eid=122php ./cli/joomla.php extension:discoverinstall --eid=122for discovering the extension with the ID 122or
Run the command without a parameter (like this
php ./cli/joomla.php extension:discoverphp ./cli/joomla.php extension:discoverinstall) for discovering all extensions, that are copied to Joomla but not installed.Run
php ./cli/joomla.php listor onlyphp ./cli/joomla.phpand check the entry in the list.Run
php ./cli/joomla.php help extension:discoverphp ./cli/joomla.php help extension:discoverinstallto check the help information.Documentation Changes Required
I would add it here: https://docs.joomla.org/J4.x:CLI_Update