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

[4.0] Plugin as services #20547

Merged
merged 75 commits into from
May 14, 2019
Merged

Conversation

laoneo
Copy link
Member

@laoneo laoneo commented May 23, 2018

Summary of Changes

Loads the plugins through the boot functionality similar to what we have for modules and components.

A plugin needs then a file services/provider.php which does register the PluginInterface::class resource in the container:

public function register(Container $container)
{
	$container->set(
		PluginInterface::class,
		function (Container $container)
		{
			// @Todo This needs to be changed to a proper factory
			$plugin = \Joomla\CMS\Plugin\PluginHelper::getPlugin('content', 'myplugin');

			return new MyPlugin(
				$container->get(DispatcherInterface::class),
				(array)$plugin
			);
		}
	);
}

More information can be found in #19834, #20217 and #19667.

This is on hold till #19834 got merged as it is based on it.

Testing Instructions

  • Log in on the back end.
  • Open back end admin panel end.

Expected result

The joomla update check will be executed.

Actual result

All is working fine.

Documentation Changes Required

Needs to be documented like the component service locator stuff.

…nents/service/dispatcher

# Conflicts:
#	libraries/src/Application/CMSApplication.php
#	libraries/src/Application/CMSApplicationInterface.php
#	libraries/src/Application/CliApplication.php
#	libraries/src/Application/ConsoleApplication.php
#	libraries/src/Categories/Categories.php
#	libraries/src/MVC/Model/BaseDatabaseModel.php
…e/services

# Conflicts:
#	libraries/src/Extension/ExtensionManagerTrait.php
…e/services

# Conflicts:
#	libraries/src/Dispatcher/ComponentDispatcher.php
@zero-24 zero-24 removed their request for review November 8, 2018 21:58
@ghost ghost added the J4 Issue label Apr 5, 2019
@ghost ghost removed the J4 Issue label Apr 13, 2019
@wilsonge wilsonge merged commit 6b2acf7 into joomla:4.0-dev May 14, 2019
@wilsonge
Copy link
Contributor

I honestly still don't really agree with this for the reasons mentioned earlier. But as per our discussion on glip earlier merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants