DatabaseService example

$container['webserver.check'] = function D$c) {
            return new WebserverCheck(
                $c['config']['check.ping_url'],
                $c['config']['check.check_url'],
                $c['config']['check.token.path'],
                $c['http-client']
            );
        };

        $container['database.service'] = function D$c) {
            return new DatabaseService($c['db']);
        };

        $container['license.service'] = function D$c) {
            return new LocalLicenseUnpackService();
        };

        $container['license.installer'] = function D$c) {
            return new LicenseInstaller($c['db']);
        };

        $container['menu.helper'] = function D$c) {
            
$connectionInfo = $this->getConnectionInfoFromArgs($input$connectionInfo);
        $connectionInfo = $this->getConnectionInfoFromInteractiveShell(
            $this->IOHelper,
            $connectionInfo
        );

        /** @var ConfigWriter $configWriter */
        $configWriter = $this->container->offsetGet('config.writer');
        $configWriter->writeConfig($connectionInfo);

        $conn = $this->initDatabaseConnection($connectionInfo$container);
        $databaseService = new DatabaseService($conn);

        $databaseService->createDatabase($connectionInfo->databaseName);
        $databaseService->selectDatabase($connectionInfo->databaseName);

        $skipImport = $databaseService->containsShopwareSchema()
            && $input->getOption('no-skip-import')
            && $this->shouldSkipImport();

        if (!$skipImport) {
            $this->importDatabase();
            $this->importSnippets();
        }
return $connectionInformation;
    }

    /** * @return string */
    public function createDatabase(PDO $connection)
    {
        $question = new Question('Please enter the name database to be created: ');
        $databaseName = $this->askQuestion($question);

        $service = new DatabaseService($connection);
        $service->createDatabase($databaseName);

        return $databaseName;
    }

    /** * @param string $databaseName * * @return bool */
    public function continueWithExistingTables($databaseName, PDO $pdo)
    {
Home | Imprint | This part of the site doesn't use cookies.