Backend\Core\Installer\ModuleInstaller::importSQL PHP Method

importSQL() protected method

Imports the sql file
protected importSQL ( string $filename )
$filename string The full path for the SQL-file.
    protected function importSQL($filename)
    {
        // load the file content and execute it
        $content = trim(file_get_contents($filename));
        // file actually has content
        if (!empty($content)) {
            /**
             * Some versions of PHP can't handle multiple statements at once, so split them
             * We know this isn't the best solution, but we couldn't find a beter way.
             */
            $queries = preg_split("/;(\r)?\n/", $content);
            // loop queries and execute them
            foreach ($queries as $query) {
                $this->getDB()->execute($query);
            }
        }
    }