- md5
- a214b940ebaf1975217b7f7d5a23d536
- sha1
- 73acced2a1cf433a250281933938c8b09800c3da
- sha256
- ca07b22048712c5e6fc5349955c373d575f6dbd463a7d052418cf33c5fcbc851
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
<?php
/**
* @package Joomla.Libraries
* @subpackage Service
*
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
*/
namespace Joomla\CMS\Service\Provider;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Console\SessionGcCommand;
use Joomla\CMS\Console\SessionMetadataGcCommand;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
/**
* Service provider for the application's console services
*
* @since 4.0
*/
class Console 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(
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('db'));
},
true
);
}
}
The same content is in 2 releases, Joomla 4.0.0-alpha5 to 4.0.0-alpha6. See them all, or every version of this file.