Skip to content
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

[6.0] Installer: Remove dependency on Adapter class #43792

Open
wants to merge 4 commits into
base: 6.0-dev
Choose a base branch
from

Conversation

Hackwar
Copy link
Member

@Hackwar Hackwar commented Jul 14, 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: CMS Adapter removed Manual#301

  • No documentation changes for manual.joomla.org needed

@Hackwar Hackwar added the b/c break This item changes the behavior in an incompatible why. HEADS UP label Jul 14, 2024
@Hackwar Hackwar requested a review from rdeutz as a code owner July 14, 2024 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b/c break This item changes the behavior in an incompatible why. HEADS UP Documentation Required Feature PR-6.0-dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants