Documentation Required b/c break PR-6.0-dev Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
14 Jul 2024

Summary of Changes

This is an effort to remove deprecated code from the system. The Installer class depends on the Adapter class, which in turn has been deprecated for a long time already. This PR removes the code of the Adapter class from the Installer class and replaces it with some sane methods to add adapters when required.

This PR does some cleanup and it adds the following methods:

  • loadAdapters(): This iterates over the set folder and adds all files it finds as available installer adapters. To keep it light, the array only contains the name as key and either the class name as value or an object. The object is instantiated just in time when needed.
  • getAdapters(): This method keeps the behavior of the $custom parameter, but otherwise still just returns the list of available adapters
  • getAdapter(): This new method replaces loadAdapter() and either returns an object which was previously made or instantiates it from the class stored in the $adapters array.
  • loadAdapter(): This one gets deprecated in favour of getAdapter(). Just to keep the naming consistent.
  • setAdapter(): This new method allows to hand in a name for the adapter and either a class name or an instantiated object for the respective adapter type. This would allow you to add custom adapter types and also to overwrite existing adapter types.

I reused some method names from the Adapter class. This PR is a b/c break and thus targeted towards 6.0.

Testing Instructions

Test that installing extensions still works. The behavior shouldn't have changed.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org: joomla/Manual#301

  • No documentation changes for manual.joomla.org needed

avatar Hackwar Hackwar - open - 14 Jul 2024
avatar Hackwar Hackwar - change - 14 Jul 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Jul 2024
Category Administration com_joomlaupdate Libraries
avatar Hackwar Hackwar - change - 14 Jul 2024
Labels Added: b/c break PR-6.0-dev
avatar Hackwar Hackwar - change - 21 Aug 2024
Labels Added: Documentation Required
avatar Hackwar Hackwar - change - 24 Aug 2024
The description was changed
avatar Hackwar Hackwar - edited - 24 Aug 2024

Add a Comment

Login with GitHub to post a comment