Code Duplication    Length = 9-9 lines in 2 locations

src/Database/DblibDatabase.php 1 location

@@ 12-20 (lines=9) @@
9
class DblibDatabase extends AbstractDatabase
10
{
11
12
    public static function prepareEnvironment(UriInterface $uri)
13
    {
14
        $database = preg_replace('~^/~', '', $uri->getPath());
15
16
        $customUri = new Uri($uri->__toString());
17
18
        $dbDriver = Factory::getDbRelationalInstance($customUri->withPath('/')->__toString());
19
        $dbDriver->execute("IF NOT EXISTS(select * from sys.databases where name='$database') CREATE DATABASE $database");
20
    }
21
22
    public function createDatabase()
23
    {

src/Database/MySqlDatabase.php 1 location

@@ 12-20 (lines=9) @@
9
class MySqlDatabase extends AbstractDatabase
10
{
11
12
    public static function prepareEnvironment(UriInterface $uri)
13
    {
14
        $database = preg_replace('~^/~', '', $uri->getPath());
15
16
        $customUri = new Uri($uri->__toString());
17
18
        $dbDriver = Factory::getDbRelationalInstance($customUri->withPath('/')->__toString());
19
        $dbDriver->execute("CREATE SCHEMA IF NOT EXISTS `$database` DEFAULT CHARACTER SET utf8 ;");
20
    }
21
22
    public function createDatabase()
23
    {