Skip to content
This repository
Browse code

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
  • Loading branch information...
commit faeb7b4536eecf59b057e3848994596b41140e78 1 parent 2a9a103
Mark Story authored February 26, 2012

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  lib/Cake/Model/CakeSchema.php
4  lib/Cake/Model/CakeSchema.php
@@ -384,9 +384,9 @@ public function write($object, $options = array()) {
384 384
 		}
385 385
 		$out .= "}\n";
386 386
 
387  
-		$file = new SplFileObject($path . DS . $file, 'w+');
  387
+		$file = new File($path . DS . $file, true);
388 388
 		$content = "<?php \n/* generated on: " . date('Y-m-d H:i:s') . " : ". time() . " */\n{$out}";
389  
-		if ($file->fwrite($content)) {
  389
+		if ($file->write($content)) {
390 390
 			return $content;
391 391
 		}
392 392
 		return false;

0 notes on commit faeb7b4

Please sign in to comment.
Something went wrong with that request. Please try again.