Browse Source

Merge branch '1.3' into merger

Conflicts:
	cake/libs/controller/components/email.php
	cake/tests/cases/console/libs/tasks/fixture.test.php
	lib/Cake/Console/Command/Task/DbConfigTask.php
mark_story 14 years ago
parent
commit
efbeab6199

+ 2 - 2
app/Config/core.php

@@ -196,8 +196,8 @@
  * Will append a querystring parameter containing the time the file was modified. This is
  * useful for invalidating browser caches.
  *
- * Set to `true` to apply timestamps, when debug = 0, or set to 'force' to always enable
- * timestamping.
+ * Set to `true` to apply timestamps when debug > 0. Set to 'force' to always enable
+ * timestamping regardless of debug value.
  */
 	//Configure::write('Asset.timestamp', true);
 /**

+ 3 - 0
lib/Cake/Console/Command/Task/FixtureTask.php

@@ -404,6 +404,9 @@ class FixtureTask extends BakeTask {
 		foreach ($records as $record) {
 			$row = array();
 			foreach ($record[$modelObject->alias] as $field => $value) {
+				if ($schema[$field]['type'] === 'boolean') {
+					$value = (int)(bool)$value;
+				}
 				$row[$field] = $value;
 			}
 			$out[] = $row;

+ 1 - 0
lib/Cake/Test/Case/Console/Command/Task/FixtureTaskTest.php

@@ -187,6 +187,7 @@ class FixtureTaskTest extends CakeTestCase {
 		));
 
 		$this->assertRegExp("/'body' => 'Body \"value\"'/", $result, 'Data has bad escaping');
+		$this->assertRegExp("/'bool' => 1/", $result);
 	}
 
 /**

+ 19 - 1
lib/Cake/Test/Case/Utility/FileTest.php

@@ -399,7 +399,7 @@ class FileTest extends CakeTestCase {
 	public function testDelete() {
 		if (!$tmpFile = $this->_getTmpFile()) {
 			return false;
-		};
+		}
 
 		if (!file_exists($tmpFile)) {
 			touch($tmpFile);
@@ -416,6 +416,24 @@ class FileTest extends CakeTestCase {
 	}
 
 /**
+ * Windows has issues unlinking files if there are
+ * active filehandles open.
+ *
+ * @return void
+ */
+	function testDeleteAfterRead() {
+		if (!$tmpFile = $this->_getTmpFile()) {
+			return false;
+		}
+		if (!file_exists($tmpFile)) {
+			touch($tmpFile);
+		}
+		$file =& new File($tmpFile);
+		$file->read();
+		$this->assertTrue($file->delete());
+	}
+
+/**
  * testCopy method
  *
  * @return void

+ 4 - 0
lib/Cake/Utility/File.php

@@ -268,6 +268,10 @@ class File {
  */
 	public function delete() {
 		clearstatcache();
+		if (is_resource($this->handle)) {
+			fclose($this->handle);
+			$this->handle = null;
+		}
 		if ($this->exists()) {
 			return unlink($this->path);
 		}