3 Commits
1.0.0 ... 1.0.3

3 changed files with 14 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ use Contao\StringUtil;
use Contao\System;
use Contao\Widget;
use Doctrine\DBAL\Connection;
use Symfony\Component\Filesystem\Filesystem;
class DummyCopierModule extends BackendModule
{
@@ -23,7 +24,8 @@ class DummyCopierModule extends BackendModule
protected function compile(): void
{
$connection = System::getContainer()->get(Connection::class);
/** @var Connection $connection */
$connection = System::getContainer()->get('database_connection');
$this->Template->action = Environment::get('request');
$this->Template->requestToken = \defined('REQUEST_TOKEN') ? REQUEST_TOKEN : '';
@@ -69,8 +71,11 @@ class DummyCopierModule extends BackendModule
);
try {
/** @var DummyCopier $copier */
$copier = System::getContainer()->get(DummyCopier::class);
$copier = new DummyCopier(
$connection,
new Filesystem(),
(string) System::getContainer()->getParameter('kernel.project_dir')
);
$result = $copier->execute($options);
Message::addConfirmation(sprintf(

View File

@@ -6,9 +6,9 @@ namespace Webfarben\DummyCopier\ContaoManager;
use Webfarben\DummyCopier\DummyCopierBundle;
use Contao\CoreBundle\ContaoCoreBundle;
use Contao\ManagerPlugin\Bundle\BundleConfig;
use Contao\ManagerPlugin\Bundle\BundlePluginInterface;
use Contao\ManagerPlugin\Bundle\Config\BundleConfig;
use Contao\ManagerPlugin\Bundle\Parser\ParserInterface;
use Contao\ManagerPlugin\Bundle\Plugin\BundlePluginInterface;
class Plugin implements BundlePluginInterface
{

View File

@@ -8,4 +8,8 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
class DummyCopierBundle extends Bundle
{
public function getPath(): string
{
return \dirname(__DIR__);
}
}