Fix error creating schema files.

If you removed app/Config/Schema and tried to create
schema files, you'd get an error instead of a file.

Fixes #2618
This commit is contained in:
mark_story 2012-02-26 10:25:39 -05:00
parent 2a9a103d62
commit faeb7b4536

View file

@ -384,9 +384,9 @@ class CakeSchema extends Object {
}
$out .= "}\n";
$file = new SplFileObject($path . DS . $file, 'w+');
$file = new File($path . DS . $file, true);
$content = "<?php \n/* generated on: " . date('Y-m-d H:i:s') . " : ". time() . " */\n{$out}";
if ($file->fwrite($content)) {
if ($file->write($content)) {
return $content;
}
return false;