Pimcore\Model\Tool\Setup\Dao::database PHP Метод

database() публичный Метод

public database ( )
    public function database()
    {
        $mysqlInstallScript = file_get_contents(PIMCORE_PATH . "/modules/install/mysql/install.sql");
        // remove comments in SQL script
        $mysqlInstallScript = preg_replace("/\\s*(?!<\")\\/\\*[^\\*]+\\*\\/(?!\")\\s*/", "", $mysqlInstallScript);
        // get every command as single part
        $mysqlInstallScripts = explode(";", $mysqlInstallScript);
        // execute every script with a separate call, otherwise this will end in a PDO_Exception "unbufferd queries, ..." seems to be a PDO bug after some googling
        foreach ($mysqlInstallScripts as $m) {
            $sql = trim($m);
            if (strlen($sql) > 0) {
                $sql .= ";";
                $this->db->query($m);
            }
        }
        // set table search_backend_data to InnoDB if MySQL Version is > 5.6
        $this->db->query("ALTER TABLE search_backend_data /*!50600 ENGINE=InnoDB */;");
        // reset the database connection
        \Pimcore\Db::reset();
    }