protected function writeMigrationFile($data, $last, $append = false)
{
$file = (string) $this->files[$this->hash]['file'];
if ($this->fs->exists($file) && $append === false) {
$this->setError(true)->setErrorMessage("Specified file '{$file}' already exists!");
return false;
}
try {
$this->fs->touch($file);
} catch (IOException $e) {
$this->setError(true)->setErrorMessage("Specified file '{$file}' can not be created!");
return false;
}
// Write them out
return $this->files[$this->hash]['handler']->addRecord($data, $last);
}