ContainerProvider example

use Shopware\Recovery\Install\Service\LocalLicenseUnpackService;
use Shopware\Recovery\Install\Service\ShopService;
use Shopware\Recovery\Install\Service\ThemeService;
use Shopware\Recovery\Install\Service\TranslationService;
use Shopware\Recovery\Install\Struct\DatabaseConnectionInformation;
use Shopware\Recovery\Install\Struct\LicenseUnpackRequest;
use Slim\Slim;
use voku\helper\AntiXSS;

$config = require __DIR__ . '/../config/production.php';
$container = new Container();
$container->register(new ContainerProvider($config));

/** @var Slim $app */
$app = $container->offsetGet('slim.app');

// After instantiation $sessionPath = str_replace('index.php', '', $app->request()->getScriptName());
$app->config('cookies.path', $sessionPath);

if (!isset($_SESSION)) {
    session_cache_limiter(false);
    session_set_cookie_params(600, $sessionPath);
    
/** * @param string $env */
    public function __construct($env)
    {
        $this->registerErrorHandler();

        parent::__construct('Shopware Installer', '1.0.0');

        $config = require __DIR__ . '/../../config/' . $env . '.php';
        $this->container = new Container();
        $this->container->register(new ContainerProvider($config));

        $this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', $env));
    }

    /** * @return Container */
    public function getContainer()
    {
        return $this->container;
    }

    
Home | Imprint | This part of the site doesn't use cookies.