source/Setup/Database.php
public function queryFile($sFilename)
    {
        $fp = @fopen($sFilename, "r");
        if (!$fp) {
            /** @var Setup $oSetup */
            $oSetup = $this->getInstance("Setup");
            // problems with file
            $oSetup->setNextStep($oSetup->getStep('STEP_DB_INFO'));
            throw new Exception(sprintf($this->getInstance("Language")->getText('ERROR_OPENING_SQL_FILE'), $sFilename), Database::ERROR_OPENING_SQL_FILE);
        }

        $sQuery = fread($fp, filesize($sFilename));
        fclose($fp);

        if (version_compare($this->getDatabaseVersion(), "5") > 0) {
            //disable STRICT db mode if there are set any (mysql >= 5).
            $this->execSql("SET @@session.sql_mode = ''");
        }

        $aQueries = $this->parseQuery($sQuery);
        foreach ($aQueries as $sQuery) {
            $this->execSql($sQuery);
        }
    }
public function queryFile($sFilename)
    {
        $fp = @fopen($sFilename, "r");
        if (!$fp) {
            /** @var Setup $oSetup */
            $oSetup = $this->getInstance("Setup");
            // problems with file
            $oSetup->setNextStep($oSetup->getStep('STEP_DB_INFO'));
            throw new Exception(sprintf($this->getInstance("Language")->getText('ERROR_OPENING_SQL_FILE'), $sFilename), Database::ERROR_OPENING_SQL_FILE);
        }

        $sQuery = fread($fp, filesize($sFilename));
        fclose($fp);

        if (version_compare($this->getDatabaseVersion(), "5") > 0) {
            //disable STRICT db mode if there are set any (mysql >= 5).
            $this->execSql("SET @@session.sql_mode = ''");
        }

        $aQueries = $this->parseQuery($sQuery);
        foreach ($aQueries as $sQuery) {
            $this->execSql($sQuery);
        }
    }
public function queryFile ( $ sFilename ) { $ fp = @ fopen ( $ sFilename , "r" ) ; if ( ! $ fp ) { /** @var Setup $oSetup */ $ oSetup = $ this -> getInstance ( "Setup" ) ; // problems with file $ oSetup -> setNextStep ( $ oSetup -> getStep ( 'STEP_DB_INFO' ) ) ; throw new Exception ( sprintf ( $ this -> getInstance ( "Language" ) -> getText ( 'ERROR_OPENING_SQL_FILE' ) , $ sFilename ) , Database :: ERROR_OPENING_SQL_FILE ) ; } $ sQuery = fread ( $ fp , filesize ( $ sFilename ) ) ; fclose ( $ fp ) ; if ( version_compare ( $ this -> getDatabaseVersion ( ) , "5" ) > 0 ) { //disable STRICT db mode if there are set any (mysql >= 5). $ this -> execSql ( "SET @@session.sql_mode = ''" ) ; } $ aQueries = $ this -> parseQuery ( $ sQuery ) ; foreach ( $ aQueries as $ sQuery ) { $ this -> execSql ( $ sQuery ) ; } }
Executes queries stored in passed file

@param string $sFilename file name where queries are stored
Executes queries stored in passed file