Browse Source

Merge branch 'master' into 2.4

mark_story 12 years ago
parent
commit
f18d354f55

+ 2 - 1
app/Config/core.php

@@ -285,7 +285,8 @@
  * 		'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
  * 		'prefix' => 'cake_', //[optional]  prefix every cache file with this string
  * 		'lock' => false, //[optional]  use file locking
- * 		'serialize' => true, [optional]
+ * 		'serialize' => true, //[optional]
+ * 		'mask' => 0664, //[optional]
  *	));
  *
  * APC (http://pecl.php.net/package/APC)

+ 2 - 1
lib/Cake/Console/Templates/skel/Config/core.php

@@ -276,7 +276,8 @@
  * 		'path' => CACHE, //[optional] use system tmp directory - remember to use absolute path
  * 		'prefix' => 'cake_', //[optional]  prefix every cache file with this string
  * 		'lock' => false, //[optional]  use file locking
- * 		'serialize' => true, [optional]
+ * 		'serialize' => true, //[optional]
+ * 		'mask' => 0664, //[optional]
  *	));
  *
  * APC (http://pecl.php.net/package/APC)

+ 1 - 1
lib/Cake/I18n/I18n.php

@@ -326,7 +326,7 @@ class I18n {
 				if (is_file($localeDef)) {
 					$definitions = self::loadLocaleDefinition($localeDef);
 					if ($definitions !== false) {
-						$this->_domains[$domain][$this->_lang][$this->category] = self::loadLocaleDefinition($localeDef);
+						$this->_domains[$domain][$this->_lang][$this->category] = $definitions;
 						$this->_noLocale = false;
 						return $domain;
 					}

+ 11 - 2
lib/Cake/Model/Datasource/Database/Sqlite.php

@@ -407,10 +407,19 @@ class Sqlite extends DboSource {
 			return null;
 		}
 
-		if (isset($column['key']) && $column['key'] === 'primary' && $type === 'integer') {
+		$isPrimary = (isset($column['key']) && $column['key'] === 'primary');
+		if ($isPrimary && $type === 'integer') {
 			return $this->name($name) . ' ' . $this->columns['primary_key']['name'];
 		}
-		return parent::buildColumn($column);
+		$out = parent::buildColumn($column);
+		if ($isPrimary && $type === 'biginteger') {
+			$replacement = 'PRIMARY KEY';
+			if ($column['null'] === false) {
+				$replacement = 'NOT NULL ' . $replacement;
+			}
+			return str_replace($this->columns['primary_key']['name'], $replacement, $out);
+		}
+		return $out;
 	}
 
 /**

+ 11 - 0
lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php

@@ -264,6 +264,17 @@ class SqliteTest extends CakeTestCase {
 		$result = $this->Dbo->buildColumn($data);
 		$expected = '"huge" bigint(20) NOT NULL';
 		$this->assertEquals($expected, $result);
+
+		$data = array(
+			'name' => 'id',
+			'type' => 'biginteger',
+			'length' => 20,
+			'null' => false,
+			'key' => 'primary',
+		);
+		$result = $this->Dbo->buildColumn($data);
+		$expected = '"id" bigint(20) NOT NULL PRIMARY KEY';
+		$this->assertEquals($expected, $result);
 	}
 
 /**