public function batchQueryFromFile($fullSource)
{
$lines = explode("\n", $fullSource);
$sql = '';
$realSql = false;
foreach ($lines as $line) {
$line = trim($line);
// Skip empty lines and comments
if ($line === '' || $line[0] === '-' && $line[1] === '--') {
continue;
}
if ($sql !== '') {
$sql .= ' ';
}
$sql .= "{$line}\n";
// Is this line the end of statement?
$lineCopy = $line;
$lineCopy = preg_replace('/' . preg_quote($this->delimiter, '/') . '$/', '', $lineCopy);
if ($lineCopy != $line) {
// Execute what we have so far and reset the sql string
$realSql = $sql;
$sql = '';
$this->query($realSql);
}
}
return true;
}