Skip to content

Commit 4f98b92

Browse files
authored
[5.4] Local Filesystem plugin use SubscriberInterface (joomla#45703)
1 parent 59b343e commit 4f98b92

File tree

1 file changed

+18
-2
lines changed
  • plugins/filesystem/local/src/Extension

1 file changed

+18
-2
lines changed

plugins/filesystem/local/src/Extension/Local.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Joomla\Component\Media\Administrator\Event\MediaProviderEvent;
1515
use Joomla\Component\Media\Administrator\Provider\ProviderInterface;
1616
use Joomla\Event\DispatcherInterface;
17+
use Joomla\Event\SubscriberInterface;
1718
use Joomla\Plugin\Filesystem\Local\Adapter\LocalAdapter;
1819

1920
// phpcs:disable PSR1.Files.SideEffects
@@ -27,7 +28,7 @@
2728
*
2829
* @since 4.0.0
2930
*/
30-
final class Local extends CMSPlugin implements ProviderInterface
31+
final class Local extends CMSPlugin implements SubscriberInterface, ProviderInterface
3132
{
3233
/**
3334
* Affects constructor behavior. If true, language files will be loaded automatically.
@@ -36,6 +37,7 @@ final class Local extends CMSPlugin implements ProviderInterface
3637
* @since 4.0.0
3738
*/
3839
protected $autoloadLanguage = true;
40+
3941
/**
4042
* The root directory path
4143
*
@@ -44,6 +46,20 @@ final class Local extends CMSPlugin implements ProviderInterface
4446
*/
4547
private $rootDirectory;
4648

49+
/**
50+
* Returns an array of events this subscriber will listen to.
51+
*
52+
* @return array
53+
*
54+
* @since __DEPLOY_VERSION__
55+
*/
56+
public static function getSubscribedEvents(): array
57+
{
58+
return [
59+
'onSetupProviders' => 'onSetupProviders',
60+
];
61+
}
62+
4763
/**
4864
* Constructor.
4965
*
@@ -95,7 +111,7 @@ public function getID()
95111
*/
96112
public function getDisplayName()
97113
{
98-
return $this->getLanguage()->_('PLG_FILESYSTEM_LOCAL_DEFAULT_NAME');
114+
return $this->getApplication()->getLanguage()->_('PLG_FILESYSTEM_LOCAL_DEFAULT_NAME');
99115
}
100116

101117
/**

0 commit comments

Comments
 (0)