concrete/src/Package/Package.php
public static function installDB($xmlFile)
    {
        if (file_exists($xmlFile)) {
            $app = ApplicationFacade::getFacadeApplication();
            $db = $app->make(Connection::class);
            /* @var Connection $db */
            $db->beginTransaction();

            $parser = Schema::getSchemaParser(simplexml_load_file($xmlFile));
            $parser->setIgnoreExistingTables(false);
            $toSchema = $parser->parse($db);

            $fromSchema = $db->getSchemaManager()->createSchema();
            $comparator = new SchemaComparator();
            $schemaDiff = $comparator->compare($fromSchema, $toSchema);
            $saveQueries = $schemaDiff->toSaveSql($db->getDatabasePlatform());

            foreach ($saveQueries as $query) {
                $db->query($query);
            }

            $db->commit();

            $result = new stdClass();
            $result->result = false;
        } else {
            $result = false;
        }

        return $result;
    }
public static function installDB($xmlFile)
    {
        if (file_exists($xmlFile)) {
            $app = ApplicationFacade::getFacadeApplication();
            $db = $app->make(Connection::class);
            /* @var Connection $db */
            $db->beginTransaction();

            $parser = Schema::getSchemaParser(simplexml_load_file($xmlFile));
            $parser->setIgnoreExistingTables(false);
            $toSchema = $parser->parse($db);

            $fromSchema = $db->getSchemaManager()->createSchema();
            $comparator = new SchemaComparator();
            $schemaDiff = $comparator->compare($fromSchema, $toSchema);
            $saveQueries = $schemaDiff->toSaveSql($db->getDatabasePlatform());

            foreach ($saveQueries as $query) {
                $db->query($query);
            }

            $db->commit();

            $result = new stdClass();
            $result->result = false;
        } else {
            $result = false;
        }

        return $result;
    }
public static function installDB ( $ xmlFile ) { if ( file_exists ( $ xmlFile ) ) { $ app = ApplicationFacade :: getFacadeApplication ( ) ; $ db = $ app -> make ( Connection :: class ) ; /* @var Connection $db */ $ db -> beginTransaction ( ) ; $ parser = Schema :: getSchemaParser ( simplexml_load_file ( $ xmlFile ) ) ; $ parser -> setIgnoreExistingTables ( false ) ; $ toSchema = $ parser -> parse ( $ db ) ; $ fromSchema = $ db -> getSchemaManager ( ) -> createSchema ( ) ; $ comparator = new SchemaComparator ( ) ; $ schemaDiff = $ comparator -> compare ( $ fromSchema , $ toSchema ) ; $ saveQueries = $ schemaDiff -> toSaveSql ( $ db -> getDatabasePlatform ( ) ) ; foreach ( $ saveQueries as $ query ) { $ db -> query ( $ query ) ; } $ db -> commit ( ) ; $ result = new stdClass ( ) ; $ result -> result = false ; } else { $ result = false ; } return $ result ; }
Installs a package database from an XML file.

@param string $xmlFile Path to the database XML file

@throws \Doctrine\DBAL\ConnectionException

@return bool|stdClass Returns false if the XML file could not be found
Installs a package database from an XML file .