ExtensionInstallCommand more consistent with administrator #43700
+116
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Maybe mark this with RFC?
Summary of Issues
Deletion of package
with --path
processPathInstallation
would delete the package file if it's placed in thetmp_path
.There are two flaws with this:
tmp_path
it is deleted, otherwise it's not. This is inconsistent.So --path should only clean up the extracted files. (--path does not accept a URL as parameter, it never downloads a file)
Inconsistent names with the web interface
In the web interface we have 'URL', 'folder' and 'package' (and web, that one is not applicable for the CLI)
'URL' can be found in
extension:install
, no problems there.--path is slightly ambiguous, at a first glance you might expect this to point to a folder. Only after careful reading of the help information, it is clear that it must be a package.
An option to install from a folder is missing at all
To be more consistent,
extension:install
should support 'folder' and 'package' as wellSummary of Changes
- adding an option --package to point to a zip file (
processPackageInstallation
)- Adding an option --folder to point to a folder with extracted files (
processFolderInstallation
)- Modifying --path to accept a folder or a file (B/C). Delegating the work to
processPackageInstallation
orprocessFolderInstallation
- Package installation only deletes the extracted files. Not the original package.
- Minor changes to the help info,
extension:install
can update as well.- Added short versions of the parametersTesting Instructions
--url is omitted.
Ensure the CLI command is executed with the right permissions. Installation fails otherwise without a clear messsage.
Actual result BEFORE applying this Pull Request
-
php joomla extension:install --path <zipfile>
- works-
php joomla extension:install --path <tmp_dir/zipfile>
- works - file deleted-
php joomla extension:install --path <folder>
- failsExpected result AFTER applying this Pull Request
-
php joomla extension:install --path <zipfile>
- works (B/C)-
php joomla extension:install --path <folder>
- works-
php joomla extension:install --path <tmp_dir/zipfile>
- works - zipfile not deleted-
php joomla extension:install --package | -p <folder>
- works-
php joomla extension:install --folder | -f <folder>
- works-
php joomla extension:install --package | -p <folder>
- fails-
php joomla extension:install --folder | -f <zipfile>
- fails