Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cf95577
Deprecate registerListeners method
Fedik Apr 28, 2024
614c6a8
Deprecate use of use DispatcherAwareInterface
Fedik Apr 28, 2024
33d0394
Deprecate use of use DispatcherAwareInterface
Fedik Apr 28, 2024
7d65887
Deprecate use of use DispatcherAwareInterface
Fedik Apr 28, 2024
a54943a
Deprecate use of use DispatcherAwareInterface
Fedik Apr 28, 2024
ad7dbb4
Message about deprecation
Fedik May 5, 2024
1991db1
Message about deprecation
Fedik May 6, 2024
e6f50f0
Clean up
Fedik May 8, 2024
267054c
Merge branch '5.2-dev' into plugin-deprecation-registerListeners
Fedik May 12, 2024
f475e0d
Merge branch '5.3-dev' into plugin-deprecation-registerListeners
laoneo Mar 2, 2025
21ed5c7
version
Fedik Mar 2, 2025
32e355c
Merge branch '5.3-dev' into plugin-deprecation-registerListeners
Fedik Mar 10, 2025
b81a90a
tst
Fedik Mar 10, 2025
1ce8a96
tst
Fedik Mar 10, 2025
029459a
PluginWithSubscriberInterface
Fedik Mar 13, 2025
c077e5f
Merge branch '5.3-dev' into plugin-deprecation-registerListeners
Fedik Mar 13, 2025
8ae523a
PluginWithSubscriberInterface
Fedik Mar 13, 2025
cdbd280
Merge branch '5.3-dev' into plugin-deprecation-registerListeners
laoneo Apr 28, 2025
e8c139c
Revert "PluginWithSubscriberInterface"
Fedik May 15, 2025
21e3dda
Revert "PluginWithSubscriberInterface"
Fedik May 15, 2025
bff97f4
Merge branch '5.4-dev' into plugin-deprecation-registerListeners
Fedik May 15, 2025
ad154f6
Update libraries/src/Plugin/PluginHelper.php
HLeithner May 17, 2025
bb9a233
Merge branch '5.4-dev' into plugin-deprecation-registerListeners
richard67 May 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libraries/src/Extension/PluginInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ interface PluginInterface extends DispatcherAwareInterface
* @return void
*
* @since 4.0.0
*
* @deprecated __DEPLOY_VERSION__ will be removed in 7.0
* Plugin should implement SubscriberInterface.
* These plugins will be added to dispatcher in PluginHelper::import().
*/
public function registerListeners();
}
15 changes: 15 additions & 0 deletions libraries/src/Plugin/CMSPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ public function loadLanguage($extension = '', $basePath = JPATH_ADMINISTRATOR)
* @return void
*
* @since 4.0.0
*
* @deprecated __DEPLOY_VERSION__ will be removed in 7.0
* Plugin should implement SubscriberInterface.
* These plugins will be added to dispatcher in PluginHelper::import().
*/
public function registerListeners()
{
Expand All @@ -232,6 +236,8 @@ public function registerListeners()
return;
}

@trigger_error('The plugin should implement SubscriberInterface.', \E_USER_DEPRECATED);

$reflectedObject = new \ReflectionObject($this);
$methods = $reflectedObject->getMethods(\ReflectionMethod::IS_PUBLIC);

Expand Down Expand Up @@ -287,6 +293,9 @@ public function registerListeners()
* @return void
*
* @since 4.0.0
*
* @deprecated __DEPLOY_VERSION__ will be removed in 7.0
* Plugin should implement SubscriberInterface.
*/
final protected function registerLegacyListener(string $methodName)
{
Expand Down Expand Up @@ -335,6 +344,9 @@ function (AbstractEvent $event) use ($methodName) {
* @return void
*
* @since 4.0.0
*
* @deprecated __DEPLOY_VERSION__ will be removed in 7.0
* Plugin should implement SubscriberInterface.
*/
final protected function registerListener(string $methodName)
{
Expand All @@ -349,6 +361,9 @@ final protected function registerListener(string $methodName)
* @return boolean
*
* @since 4.0.0
*
* @deprecated __DEPLOY_VERSION__ will be removed in 7.0
* Plugin should implement SubscriberInterface.
*/
private function parameterImplementsEventInterface(\ReflectionParameter $parameter): bool
{
Expand Down
1 change: 1 addition & 0 deletions libraries/src/Plugin/PluginHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ protected static function import($plugin, $autocreate = true, ?DispatcherInterfa
return;
}

// @TODO: Starting from 7.0 it should use $dispatcher->addSubscriber($plugin); for plugins which implement SubscriberInterface.
$plugin->registerListeners();
}

Expand Down