1414use Joomla \Component \Media \Administrator \Event \MediaProviderEvent ;
1515use Joomla \Component \Media \Administrator \Provider \ProviderInterface ;
1616use Joomla \Event \DispatcherInterface ;
17+ use Joomla \Event \SubscriberInterface ;
1718use Joomla \Plugin \Filesystem \Local \Adapter \LocalAdapter ;
1819
1920// phpcs:disable PSR1.Files.SideEffects
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