[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/plugins/task/sitestatus/services/ -> provider.php (source)

   1  <?php
   2  
   3  /**
   4   * @package     Joomla.Plugin
   5   * @subpackage  Task.SiteStatus
   6   *
   7   * @copyright   (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
   8   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   9   */
  10  
  11  defined('_JEXEC') or die;
  12  
  13  use Joomla\CMS\Extension\PluginInterface;
  14  use Joomla\CMS\Factory;
  15  use Joomla\CMS\Plugin\PluginHelper;
  16  use Joomla\DI\Container;
  17  use Joomla\DI\ServiceProviderInterface;
  18  use Joomla\Event\DispatcherInterface;
  19  use Joomla\Plugin\Task\SiteStatus\Extension\SiteStatus;
  20  use Joomla\Utilities\ArrayHelper;
  21  
  22  return new class implements ServiceProviderInterface
  23  {
  24      /**
  25       * Registers the service provider with a DI container.
  26       *
  27       * @param   Container  $container  The DI container.
  28       *
  29       * @return  void
  30       *
  31       * @since   4.2.0
  32       */
  33      public function register(Container $container)
  34      {
  35          $container->set(
  36              PluginInterface::class,
  37              function (Container $container) {
  38                  $plugin = new SiteStatus(
  39                      $container->get(DispatcherInterface::class),
  40                      (array) PluginHelper::getPlugin('task', 'sitestatus'),
  41                      ArrayHelper::fromObject(new JConfig()),
  42                      JPATH_CONFIGURATION . '/configuration.php'
  43                  );
  44                  $plugin->setApplication(Factory::getApplication());
  45  
  46                  return $plugin;
  47              }
  48          );
  49      }
  50  };


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer