createPDOConnection example



        return $shop;
    }

    /** * @return PDO */
    protected function initDatabaseConnection(DatabaseConnectionInformation $connectionInfo, Container $container)
    {
        $databaseFactory = new DatabaseFactory();
        $conn = $databaseFactory->createPDOConnection($connectionInfo);
        $container->offsetSet('db', $conn);

        return $conn;
    }

    /** * @return bool */
    protected function shouldSkipImport()
    {
        if (!$this->IOHelper->isInteractive()) {
            


if (!isset($_SESSION['parameters'])) {
    $_SESSION['parameters'] = [];
}

if (isset($_SESSION['databaseConnectionInfo'])) {
    $connectionInfo = $_SESSION['databaseConnectionInfo'];

    try {
        $databaseFactory = new DatabaseFactory();
        $connection = $databaseFactory->createPDOConnection($connectionInfo);

        // Init db in container         $container->offsetSet('db', $connection);
    } catch (\Exception $e) {
        // Jump to form         throw $e;
    }
}

/** * @return array|string */
Home | Imprint | This part of the site doesn't use cookies.