first commit
This commit is contained in:
21
plugins/behaviour/compat/compat.xml
Normal file
21
plugins/behaviour/compat/compat.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<extension type="plugin" group="behaviour" method="upgrade">
|
||||
<name>plg_behaviour_compat</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>2023-09</creationDate>
|
||||
<copyright>(C) 2023 Open Source Matters, Inc.</copyright>
|
||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||
<authorEmail>admin@joomla.org</authorEmail>
|
||||
<authorUrl>www.joomla.org</authorUrl>
|
||||
<version>4.4.0</version>
|
||||
<description>PLG_COMPAT_XML_DESCRIPTION</description>
|
||||
<namespace path="src">Joomla\Plugin\Behaviour\Compat</namespace>
|
||||
<files>
|
||||
<folder plugin="compat">services</folder>
|
||||
<folder>src</folder>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">language/en-GB/plg_behaviour_compat.ini</language>
|
||||
<language tag="en-GB">language/en-GB/plg_behaviour_compat.sys.ini</language>
|
||||
</languages>
|
||||
</extension>
|
||||
45
plugins/behaviour/compat/services/provider.php
Normal file
45
plugins/behaviour/compat/services/provider.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Behaviour.compat
|
||||
*
|
||||
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Extension\PluginInterface;
|
||||
use Joomla\CMS\Factory;
|
||||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\DI\Container;
|
||||
use Joomla\DI\ServiceProviderInterface;
|
||||
use Joomla\Event\DispatcherInterface;
|
||||
use Joomla\Plugin\Behaviour\Compat\Extension\Compat;
|
||||
|
||||
return new class () implements ServiceProviderInterface {
|
||||
/**
|
||||
* Registers the service provider with a DI container.
|
||||
*
|
||||
* @param Container $container The DI container.
|
||||
*
|
||||
* @return void
|
||||
* @since 4.4.0
|
||||
*/
|
||||
public function register(Container $container)
|
||||
{
|
||||
$container->set(
|
||||
PluginInterface::class,
|
||||
function (Container $container) {
|
||||
$plugin = PluginHelper::getPlugin('behaviour', 'compat');
|
||||
$dispatcher = $container->get(DispatcherInterface::class);
|
||||
|
||||
$plugin = new Compat($dispatcher, (array) $plugin);
|
||||
$plugin->setApplication(Factory::getApplication());
|
||||
|
||||
return $plugin;
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
41
plugins/behaviour/compat/src/Extension/Compat.php
Normal file
41
plugins/behaviour/compat/src/Extension/Compat.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage Behaviour.compat
|
||||
*
|
||||
* @copyright (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
namespace Joomla\Plugin\Behaviour\Compat\Extension;
|
||||
|
||||
use Joomla\CMS\Plugin\CMSPlugin;
|
||||
use Joomla\Event\SubscriberInterface;
|
||||
|
||||
// phpcs:disable PSR1.Files.SideEffects
|
||||
\defined('_JEXEC') or die;
|
||||
// phpcs:enable PSR1.Files.SideEffects
|
||||
|
||||
/**
|
||||
* Joomla! Compat Plugin.
|
||||
*
|
||||
* @since 4.4.0
|
||||
*/
|
||||
final class Compat extends CMSPlugin implements SubscriberInterface
|
||||
{
|
||||
/**
|
||||
* Returns an array of CMS events this plugin will listen to and the respective handlers.
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @since 4.4.0
|
||||
*/
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
/**
|
||||
* This plugin does not listen to any events.
|
||||
*/
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user