From fc47bf9e1ddf616df02fe747581b9d1c7f9786e0 Mon Sep 17 00:00:00 2001 From: ADmad Date: Tue, 27 Aug 2013 04:04:39 +0530 Subject: [PATCH 1/3] Avoid reparsing locale definition file. --- lib/Cake/I18n/I18n.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/I18n/I18n.php b/lib/Cake/I18n/I18n.php index a522bdaa8..d3da164b7 100644 --- a/lib/Cake/I18n/I18n.php +++ b/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; } From 17f966196132ee78825d643d76959376decd1d9e Mon Sep 17 00:00:00 2001 From: Andras Kende Date: Mon, 26 Aug 2013 22:59:41 -0700 Subject: [PATCH 2/3] Added mask to File cache docblock --- app/Config/core.php | 3 ++- lib/Cake/Console/Templates/skel/Config/core.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Config/core.php b/app/Config/core.php index d7f140015..181ac15ed 100644 --- a/app/Config/core.php +++ b/app/Config/core.php @@ -255,7 +255,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) diff --git a/lib/Cake/Console/Templates/skel/Config/core.php b/lib/Cake/Console/Templates/skel/Config/core.php index 593fa5e18..a8673f633 100644 --- a/lib/Cake/Console/Templates/skel/Config/core.php +++ b/lib/Cake/Console/Templates/skel/Config/core.php @@ -255,7 +255,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) From c1ae41da510befbc514a59ca486fb79d2a18f158 Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 27 Aug 2013 18:11:04 -0400 Subject: [PATCH 3/3] Correctly generate bigint primary keys in sqlite. generate bigint primary keys correctly. Autoincrement cannot be set as it only works with INTEGER columns[1]. I decided to use some string manipulations as the entire SQL generation bits are a bit janky and I've already re-written them for 3.0. [1] https://www.sqlite.org/autoinc.html Closes #GH-1552 --- lib/Cake/Model/Datasource/Database/Sqlite.php | 13 +++++++++++-- .../Case/Model/Datasource/Database/SqliteTest.php | 11 +++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Model/Datasource/Database/Sqlite.php b/lib/Cake/Model/Datasource/Database/Sqlite.php index da61aa273..8251fc34b 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlite.php +++ b/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; } /** diff --git a/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php b/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php index 564fe593e..a121da575 100644 --- a/lib/Cake/Test/Case/Model/Datasource/Database/SqliteTest.php +++ b/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); } /**