- md5
- f2abc7ea38506f2616a542bedbe28ba6
- sha1
- ddd96b15ceeac7c00cdc527f18d06cb8835ad32f
- sha256
- a5552b1ada4853a51b12669d195999be7db6db26bd5135694c373ea9232ceff1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
<?php
/**
* @package Joomla.Installation
* @subpackage Service
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\CMS\Installation\Service\Provider;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Error\Renderer\JsonRenderer;
use Joomla\CMS\Factory;
use Joomla\CMS\Installation\Application\InstallationApplication;
use Joomla\CMS\Log\Log;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
/**
* Application service provider
*
* @since 4.0
*/
class Application implements ServiceProviderInterface
{
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
*
* @since 4.0
*/
public function register(Container $container)
{
$container->share(
'InstallationApplicationWeb',
function (Container $container)
{
$config = null;
// Load the global configuration file if available
if (file_exists(JPATH_CONFIGURATION . '/configuration.php'))
{
$config = Factory::getConfig();
}
$app = new InstallationApplication(null, $config, null, $container);
// The session service provider needs JFactory::$application, set it if still null
if (Factory::$application === null)
{
Factory::$application = $app;
}
$app->setDispatcher($container->get('Joomla\Event\DispatcherInterface'));
$app->setLogger(Log::createDelegatedLogger());
$app->setSession($container->get('Joomla\Session\SessionInterface'));
return $app;
},
true
);
// Inject a custom JSON error renderer
$container->share(
JsonRenderer::class,
function (Container $container)
{
return new \Joomla\CMS\Installation\Error\Renderer\JsonRenderer;
}
);
}
}
No other release has this exact content. See every version of this file.