Skip to content
4 changes: 4 additions & 0 deletions libraries/src/Service/Provider/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
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\DI\Container;
use Joomla\DI\ServiceProviderInterface;
use Joomla\Event\DispatcherInterface;
Expand Down Expand Up @@ -127,6 +129,8 @@ function (Container $container)
$mapping = [
SessionGcCommand::getDefaultName() => SessionGcCommand::class,
SessionMetadataGcCommand::getDefaultName() => SessionMetadataGcCommand::class,
ExportCommand::getDefaultName() => ExportCommand::class,
ImportCommand::getDefaultName() => ImportCommand::class,
];

return new WritableContainerLoader($container, $mapping);
Expand Down
20 changes: 20 additions & 0 deletions libraries/src/Service/Provider/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
use Joomla\CMS\Console\SessionGcCommand;
use Joomla\CMS\Console\SessionMetadataGcCommand;
use Joomla\CMS\Session\MetadataManager;
use Joomla\Database\Command\ExportCommand;
use Joomla\Database\Command\ImportCommand;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;

Expand Down Expand Up @@ -59,5 +61,23 @@ function (Container $container)
},
true
);

$container->share(
ExportCommand::class,
function (Container $container)
{
return new ExportCommand($container->get('db'));
},
true
);

$container->share(
ImportCommand::class,
function (Container $container)
{
return new ImportCommand($container->get('db'));
},
true
);
}
}