$GLOBALS['db_type'], 'user' => $GLOBALS['db_username'], 'password' => $GLOBALS['db_password'], 'host' => $GLOBALS['db_host'], 'dbname' => $GLOBALS['db_name'], 'port' => $GLOBALS['db_port'] ); $conn = \Doctrine\DBAL\DriverManager::getConnection($params); $conn->getSchemaManager()->dropAndCreateDatabase(); $conn->close(); $conn->connect(); } else { $params = array( 'driver' => 'pdo_sqlite', 'memory' => true ); $conn = \Doctrine\DBAL\DriverManager::getConnection($params); } return $conn; } }