Commit graph

1055 commits

Author SHA1 Message Date
mark_story
6ce10b28c9 Update doc blocks. 2013-08-12 14:37:43 -04:00
euromark
f3018cc532 refactor methods to avoid else block on returning early 2013-08-12 19:06:34 +02:00
euromark
b09dc7213a deprecate Controller::flash() and adjust some other deprecation messages. 2013-08-12 12:51:12 +02:00
Jose Lorenzo Rodriguez
9d07fc4330 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Console/ShellDispatcher.php
	lib/Cake/Utility/CakeNumber.php
	lib/Cake/View/Elements/sql_dump.ctp
2013-08-11 23:31:10 +02:00
k-halaburda
74eb32696a Some more space / tabs issues [Travis PHPCS=1 fail] 2013-08-09 11:51:19 +02:00
k-halaburda
2655d16c13 Fixed tabbing in some places 2013-08-09 11:17:12 +02:00
k-halaburda
3855c0690e Fixed tabing formating 2013-08-09 10:26:44 +02:00
k-halaburda
c033df3218 Fixed duplication of Model's afterFind callback in HABTM relation and content of array passed to that callback [ticket 3970] 2013-08-09 09:56:33 +02:00
euromark
fc2d28974b remove undocumented code and uncessary in_array() checks + cleanup 2013-08-08 03:56:58 +02:00
mark_story
e36c537cf6 Switch from LEFT to INNER joins.
INNER joins are often more efficient as they can result in fewer rows
being examined before a result set is generated.

Fixes #3968
2013-08-07 12:50:02 -04:00
ADmad
38b050a711 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Console/Command/ConsoleShell.php
2013-08-04 19:26:55 +05:30
ADmad
473e4f991f Fixed bug when using multi model fieldList and whitelists for all models are not provided.
Fixes #3948
2013-08-03 02:49:41 +05:30
mark_story
2d2721d2d9 Update docs for MySQL
MySQL supports a few non-standard options. Document them.
2013-07-19 23:01:16 -04:00
Mike Scarborough
c780ded512 add SSL support to MySQL PDO connections 2013-07-19 22:56:51 -04:00
euromark
7a1a3e593d Always create user agent hash in session 2013-07-18 12:02:42 +02:00
mark_story
e03d3df0fe Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Test/Case/View/HelperTest.php
	lib/Cake/VERSION.txt
2013-07-17 22:40:09 -04:00
Phally
1fe424a62b Moves code out of the try/catch blocks in the connect() methods.
That code wouldn't throw a PDOException, so having it in the
try/catch block is pointless. Moving it out makes it easier to
read.
2013-07-15 12:59:46 +02:00
ADmad
d161b21ae1 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Controller/Component/AuthComponent.php
2013-07-14 10:58:55 +05:30
euromark
a643295e4c remove @access and unnecessary $name 2013-07-08 15:50:50 +02:00
ADmad
4ded269549 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Controller/Component/Auth/BlowfishAuthenticate.php
	lib/Cake/VERSION.txt
2013-07-07 12:22:12 +05:30
euromark
af455b4121 correct return types in doc blocks 2013-07-05 17:19:22 +02:00
euromark
e7f380d2b7 doublespace to single space 2013-07-05 14:36:40 +02:00
euromark
c989624f80 whitespace coding standards 2013-07-05 14:15:18 +02:00
mark_story
c597855fe4 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Test/Case/Network/CakeRequestTest.php
2013-07-03 14:21:09 -04:00
euromark
f389435bae coding standards and else block simplification 2013-07-03 19:27:17 +02:00
euromark
a90cb29c0f simplify else cases 2013-07-03 01:14:41 +02:00
euromark
7cb19b97db coding standards and simplification of else cases as well as some minor fixes 2013-07-03 00:52:48 +02:00
Jose Lorenzo Rodriguez
58149f2315 Backporting from 2.4 fix for booleans in mysql when running PHP 5.5 2013-07-02 16:51:29 -04:30
Marc Würth
ff1f80349a Removed superfluous break
In every case of the if clause it will return, so break is not needed.
2013-07-02 21:00:24 +02:00
mark_story
f09693f6e8 Merge branch 'master' into 2.4 2013-06-29 23:26:26 -04:00
Marc Würth
aabeaada0f Fixed @return statement in DboSource::disconnect 2013-06-27 17:38:46 +02:00
Marc Würth
070a6f0ad5 Added a related cookbook link to DataSource.php 2013-06-26 22:07:52 +02:00
Jose Lorenzo Rodriguez
489d1db7d1 More edge case handlignfor native_type in mysql for older versions of
php
2013-06-24 14:15:15 +02:00
Jose Lorenzo Rodriguez
b8bbf0b4a9 Preventing notice in older versions of php 2013-06-24 14:03:50 +02:00
Jose Lorenzo Rodriguez
f6eac9a175 Fixing boolean type introspection for Mysql in PHP 5.5 2013-06-24 13:42:29 +02:00
mark_story
dcf7df39d2 Merge branch 'master' into 2.4 2013-06-21 17:47:37 -04:00
euromark
1b1943954b CakeSession improvements 2013-06-18 23:49:42 +02:00
ADmad
12da3b1f27 Merge branch 'master' into 2.4 2013-06-16 13:07:44 +05:30
Mark Story
b2a40c787d Merge pull request #1327 from pafuinlu/patch-2
Added a clear() function to Model.php (2.4 branch)
2013-06-14 06:18:37 -07:00
Thom Seddon
305b3f4688 Unify modified/created times
The former implementation meant that it was not guarantee that
the times automatically generated for the modified/created fields
would be exactly the same for a given operation.
2013-06-12 13:51:56 +01:00
mark_story
cd3c54bb9d Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/VERSION.txt
2013-06-10 22:12:10 -04:00
euromark
42777b7809 incorrect tab to space - whitespace coding standards 2013-06-09 21:01:01 +02:00
ADmad
636cc8c103 Merge branch 'master' into 2.4 2013-06-09 18:08:32 +05:30
Pafu Inlu
08cef539f9 Update Model.php
fixed comment spacing
2013-06-08 05:53:35 -06:00
Pafu Inlu
089c9e1139 Added a clear() function to Model.php (2.4 branch)
1.) Changed Pull Request from master branch to 2.4 (Old Pull Request: https://github.com/cakephp/cakephp/pull/1323)

2.) Updated return value in comment
2013-06-04 15:59:54 -06:00
mark_story
cbf3228c34 Fix inconsistent name/alias usage.
TranslateBehavior should always use name instead of alias when
creating/updating/saving new translate records. It already uses name
when finding translations and the mismatch was causing translations to
not be found when saved from an aliased model.

Thanks to Joost de Keijzer for providing the initial patch.

Fixes #3865
2013-06-02 13:50:23 -04:00
ADmad
3303a2cda1 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Console/Templates/skel/Config/Schema/db_acl.php
	lib/Cake/Console/Templates/skel/Config/Schema/i18n.php
	lib/Cake/Console/Templates/skel/Config/Schema/sessions.php
	lib/Cake/Console/Templates/skel/Config/acl.ini.php
	lib/Cake/Console/Templates/skel/Config/acl.php
	lib/Cake/Console/Templates/skel/Config/bootstrap.php
	lib/Cake/Console/Templates/skel/Config/core.php
	lib/Cake/Console/Templates/skel/Config/database.php.default
	lib/Cake/Console/Templates/skel/Config/email.php.default
	lib/Cake/Console/Templates/skel/Config/routes.php
	lib/Cake/Console/Templates/skel/Console/Command/AppShell.php
	lib/Cake/Console/Templates/skel/Console/cake.bat
	lib/Cake/Console/Templates/skel/Console/cake.php
	lib/Cake/Console/Templates/skel/Controller/AppController.php
	lib/Cake/Console/Templates/skel/Controller/PagesController.php
	lib/Cake/Console/Templates/skel/Model/AppModel.php
	lib/Cake/Console/Templates/skel/View/Errors/error400.ctp
	lib/Cake/Console/Templates/skel/View/Errors/error500.ctp
	lib/Cake/Console/Templates/skel/View/Helper/AppHelper.php
	lib/Cake/Console/Templates/skel/View/Layouts/Emails/html/default.ctp
	lib/Cake/Console/Templates/skel/View/Layouts/ajax.ctp
	lib/Cake/Console/Templates/skel/View/Layouts/default.ctp
	lib/Cake/Console/Templates/skel/View/Layouts/error.ctp
	lib/Cake/Console/Templates/skel/View/Layouts/flash.ctp
	lib/Cake/Console/Templates/skel/View/Pages/home.ctp
	lib/Cake/Console/Templates/skel/index.php
	lib/Cake/Console/Templates/skel/webroot/index.php
	lib/Cake/Console/Templates/skel/webroot/test.php
2013-06-02 18:03:59 +05:30
Marc Würth
4c9f0414cb Improved the DocBlocks and other code cleanup
Fixed @license tag, url comes first
Whitespace and other minor code cleanup
Added some docblocks
2013-05-31 00:11:19 +02:00
Marc Würth
2bbd391972 Synced PHP version annotations
CakePHP seems to be just "PHP 5" as opposed to the PEAR header comment standard "PHP version 5"
http://pear.php.net/manual/en/standards.header.php
2013-05-29 20:19:14 +02:00
Damien Biasotto
e1c27af9e9 Fix typo variable name in _deleteDependent().
It's not a big deal but there was a typo in _deleteDependent() method. 

$savedAssociatons instead of $savedAssociations.
2013-05-29 14:25:39 +03:00
Mark Story
b111750494 Merge pull request #1308 from Jippi/hotfix/sql-bug-with-not-in-with-one-key
Hotfix/sql bug with NOT in with one key
2013-05-28 10:21:21 -07:00
Christian Winther
9e6120c86a This fixes an issue where attempting to use "!=" in a condition with an array with only a single element generates invalid SQL.
Example:
$condition['Model.id !='] = array(1, 2); //Generates Model.id NOT IN (1, 2) as expected
$condition['Model.id !='] = array(1); //Generates Model.id != = (1) which is invalid SQL

Patch will cause the above to generate Model.id != (1);

This an implimentation of @markstory's suggestion on PR 1232
2013-05-28 11:54:31 +00:00
ADmad
36c592e72e Merge branch 'master' into 2.4 2013-05-26 11:23:53 +05:30
mark_story
9ee610757e Throw exceptions when invalid permission keys are used.
Silently 'failing' to save permissions is bad, throw exceptions instead.

Fixes #3851
2013-05-24 21:47:22 -04:00
mark_story
408aac4798 Update return types. 2013-05-21 15:45:22 -04:00
mark_story
72b75660e5 Merge branch 'master' into 2.4 2013-05-16 21:31:27 -04:00
ADmad
4d434ec9f3 Fix CS errors 2013-05-13 23:51:32 +05:30
euromark
8aa0f5a8e9 adjust dbo source for sqlLogs variable 2013-05-06 14:32:47 +02:00
ADmad
a10275fb8b Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Test/Case/Model/Datasource/Database/PostgresTest.php
2013-05-05 14:36:46 +05:30
ADmad
db26e24cb7 Remove error setting when reading/deleting non-existent key.
Fixes #3813
2013-05-04 03:16:33 +05:30
mark_story
3d682ba5e4 Update limit() in SQLServer to handle large page numbers as well. 2013-05-02 23:29:10 -04:00
mark_story
d4036310e4 Update limit() for Postgres
It should work like the parent class.
2013-05-02 23:27:26 -04:00
mark_story
00569ea405 Update limit() for Sqlite.
It should behave as the parent class does.
2013-05-02 23:25:13 -04:00
mark_story
7b0af659a9 Stop calling limit() twice on the same data.
DboSource::limit() now follows its documented input types, passing an
already formatted LIMIT string will result in LIMIT 0. Remove useless
array merging as well.
2013-05-02 23:12:38 -04:00
mark_story
2096d3f632 Clamp limit values to be unsigned integers.
This solves large page numbers potentially turning into scientific
notation when being formatted into queries. It also further safeguards
against SQL manipulation.

Refs #GH-1263
2013-05-02 22:36:50 -04:00
ADmad
19f8274a95 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/VERSION.txt
2013-04-25 03:06:04 +05:30
Ceeram
ef90850801 Removing extra whitespace, phpcs fix 2013-04-23 12:54:48 +02:00
Simon Males
77feac9ef6 Second parameter of ClassRegistry::init() is a boolean, not a string 2013-04-22 14:06:30 +08:00
mark_story
62660c6706 Re-assign $db after beforeSave.
This allows model/behavior methods to change the datasource in the
beforeSave callback. If you use drivers from different SQL platforms
things will go very poorly.

Fixes #3606
2013-04-21 21:15:44 -04:00
ADmad
06a5c509c0 Merge branch 'master' into 2.4 2013-04-21 19:15:55 +05:30
mark_story
0f3d28c6ea Fix condition parsing in mysql specific cases.
When using collation + array values the incorrect operator would be
used. IN should be used over =.

Fixes #3772
2013-04-18 21:52:22 -04:00
ADmad
79ad8ab95a Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Utility/File.php
2013-04-14 00:05:18 +05:30
mark_story
b210849b95 Expand doc blocks for Model::query()
There were some undocumented options that had test cases.

Refs #3748
2013-04-10 21:43:25 -04:00
mark_story
5c83bc177d Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Model/Model.php
	lib/Cake/VERSION.txt
2013-04-09 22:09:56 -04:00
ADmad
819d9e2cbc docblock tweaks for apigen 2013-04-08 00:26:59 +05:30
mark_story
853e19e70e Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Model/Model.php
2013-04-07 14:35:23 -04:00
ADmad
20047c5060 Tweak docblock for api generator 2013-04-07 23:13:03 +05:30
ADmad
56df02f720 Improved docblocks 2013-04-07 18:53:32 +05:30
Rémi Dewitte
c70a3868a9 schema update CREATEs non-existing tables instead of ALTER 2013-04-03 17:37:09 +02:00
ADmad
d809b1480e Fix CS errors 2013-04-01 02:16:52 +05:30
mark_story
041c2d289f Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Console/Shell.php
2013-03-26 20:31:54 -04:00
Andy Dawson
e92e3df2fb Even less queries 2013-03-25 09:46:02 +01:00
Andy Dawson
8ea0212265 make tree recovery much, much simpler 2013-03-24 22:03:20 +00:00
mark_story
729ef8fe58 Fix default null not being reflected by SqlServer
Apply patch from 'Josh Rehm' to fix null default values from being
stomped on when reflecting table schema.

Fixes #3615
2013-03-19 21:02:27 -04:00
mark_story
81dc4c1e85 Merge branch 'master' into 2.4 2013-03-13 20:30:25 -04:00
Ceeram
8374eb92cc fix failing tests. test and mocked sources would cause exceptions 2013-03-13 22:31:23 +01:00
Ceeram
dde0912d1e Throw exceptions only when datasource has wrong package, not check for instance of Datasource 2013-03-13 17:56:51 +01:00
mark_story
3d4ebc038c Throw exceptions when non Datasource classes are used as Datasources.
Using models as datasources can cause segmentation faults. Guard against
that by checking types and raising exceptions early.

Fixes #3694
2013-03-12 21:59:45 -04:00
mark_story
8209097bc3 Merge branch 'master' into 2.4 2013-03-09 12:40:59 -05:00
Rémi Dewitte
ab510d1700 Add settings array to connection parameters that executes SET statements once connected 2013-03-07 23:45:42 +01:00
Adam Taylor
433dd09ec4 Fix typos 2013-03-05 00:05:14 -07:00
mark_story
4b13e0a5f2 Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/VERSION.txt
2013-03-04 21:55:29 -05:00
Rémi Dewitte
9ecbdf4971 better with strict comparison 2013-03-01 15:51:15 +01:00
Rémi Dewitte
e2e5dfb91e Keep default=false for boolean columns 2013-03-01 15:43:14 +01:00
mark_story
1d3095ece5 Fix formatting and expand find() docs. 2013-02-26 22:00:55 -05:00
mark_story
33bd7a571a Restore whitelist when save fails.
Fixes whitelist not being restored when save fails due to no data.

Fixes #3646
2013-02-25 20:57:56 -05:00
mark_story
d1c88ebf8a Merge branch 'master' into 2.4
Conflicts:
	lib/Cake/Log/Engine/FileLog.php
	lib/Cake/Utility/Validation.php
	lib/Cake/View/Helper/HtmlHelper.php
2013-02-24 20:24:26 -05:00
ADmad
b32e855a3d Fixing behavior prioritizing 2013-02-24 22:52:31 +05:30
nojimage
84725993e5 Postgres datasource support regular expression operators. 2013-02-22 10:14:06 +09:00
José Lorenzo Rodríguez
ef592363d6 Merge pull request #1123 from dogmatic69/model-cache
Breaking out the find so that it can be easily overloaded for caching
2013-02-16 06:05:11 -08:00
Mark
3b02013f7d Merge pull request #1127 from dereuromark/master-strict-comparison
Strict comparison for strings where applicable
2013-02-14 01:10:48 -08:00
nojimage
fbb1a812dd Create rename field statements in postgres
Refs #3622
2013-02-13 22:24:21 -05:00
mark_story
0d9ef854ff Fix FULLTEXT column generation
Fixes #3618
2013-02-12 09:00:57 -05:00
euromark
111366d5c8 == to === and != to !== where applicable 2013-02-12 03:38:08 +01:00
dogmatic69
e9a385e790 Adding the _findAll method
Now there are no special checks for find('all') and the find can be overloaded like you would
with any other find(*) methods.
2013-02-10 21:06:29 +00:00
dogmatic69
83a11b7189 adjusting the changes and adding some docs 2013-02-10 11:13:22 +00:00
dogmatic69
00abe27ef8 Breaking out the find so that it can be easily overloaded for caching
Before this commit you have to do some hacks to cache model finds easily. When using
custom find methods like `find('foo')` => `_findFoo(...)` it is common for the
method to adjust the query params.

Trying to cache a query using a hash of the query params :

	function find($type, $query) {
		$query = $this->_beforeFind($query);
		$cacheKey = $type . '_' . md5(selialize($query));

		$cache = Cache::read($cachKey, 'my_cache');
		if ($cacheKey !== false) {
			return $cache;
		}

		$results = $this->_afterFind($type, $query);
		Cache::write($cacheKey, $results, 'my_cache');

		return $results;
	}

Before this commit you either have to completely overload find and rewrite it in the AppModel or call
the before to get the modified `$query` and let cake run the before again.
2013-02-09 16:20:46 +00:00
ADmad
13029cc2bc Merge branch 'master' into 2.4 2013-02-09 02:20:16 +05:30
Graham Weldon
26a08c6780 Updated copyright 2013-02-08 21:28:17 +09:00
Graham Weldon
66d856d883 Added extra line for referencing license file for copyright 2013-02-08 21:22:51 +09:00
Graham Weldon
7b860debe4 This commit is dedicated to Mark Story, who has put in much dedicated time and effort into CakePHP over the years.
I just wanted to ruin his evening, because this change needs to be merged into CakePHP 3.0.
2013-02-08 20:59:49 +09:00
mark_story
1ceb17589a Merge branch 'master' into 2.4 2013-02-06 21:05:03 -05:00
Marc Würth
02e2fbe800 Fixed wrong statement in Sqlserver class header
http://www.php.net/manual/en/ref.pdo-sqlsrv.php

--> PDO_SQLSRV is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to MS SQL Server (starting with SQL Server 2005) and SQL Azure databases.
2013-02-05 18:32:40 +01:00
Marc Würth
fa118a73a9 Fix for CakeShell schema generate for Sqlsrv
Do not generate invalid schema.php when using SQLServer

Refs #3559
2013-02-04 21:19:56 -05:00
euromark
05546aff32 coding standards 2013-02-04 09:26:50 +01:00
Perry
af71d5528f apply code convention 2013-02-01 09:30:45 +08:00
ADmad
fb7fbcf01b Added option to disable counter caches updating.
Closes #3109
2013-01-31 18:14:39 +05:30
Perry
5ac5e784de fix a DboDataSource buildJoinStatement bug that table prefix is appended to subquery 2013-01-31 17:01:59 +08:00
mark_story
4af6039107 Merge branch 'master' into 2.3
Conflicts:
	lib/Cake/Console/Command/Task/ModelTask.php
	lib/Cake/Model/Model.php
2013-01-26 21:16:26 -05:00
Ceeram
16be9d4990 remove unused local vars 2013-01-23 17:22:06 +01:00
mark_story
efadf3dcd3 Make sure sessions are started before destroying them.
Fixes #3551
2013-01-21 20:46:41 -05:00
mark_story
7790bcacff Allow afterFind() to fully remove an associated record.
By returnning array() or unsetting the 0'th result an afterFind
callback should be able to fully remove data from the results.

Fixes #3541
2013-01-17 20:35:37 -05:00
mark_story
18e282f3aa Fix space between function + parenthesis. 2013-01-17 19:36:46 -05:00
Renan Gonçalves
23d4807933 Fixing expected value from find when it results in failure.
When a behavior callback (eg: beforeFind) stops the event, find will return null. False is really never returned from find().
2013-01-17 13:00:56 +01:00
euromark
19cfe40fd1 fix return type in docblock 2013-01-12 16:26:44 +01:00
euromark
11a88042bd fix doc block endings 2013-01-11 15:06:54 +01:00
Majna
6d75d90c25 Code cleanup
Remove unneeded sprintf.
Fix doc blocks.
Remove duplicated keys in tests assertions.
Use boolean value for CakeRequest $parseEnvironment param.
2012-12-28 23:37:58 +01:00
Graham Weldon
a9293aa385 Merge remote-tracking branch 'origin/master' into 2.3
Conflicts:
	lib/Cake/Console/Templates/skel/Config/core.php
2012-12-27 22:42:18 +09:00
mark_story
965f0e87c5 Fix SQL errors in TreeBehavior.
SQL errors were caused by escapeField() usage in TreeBehavior. Quoted
fields were not correctly unquoted.

Fixes #3491
2012-12-26 20:55:07 -05:00
Saleh Souzanchi
ed761320df Disabled callbacks in _getMax() & _getMin()
This fixes issues where model/behavior callbacks append into the query
conditions without checking that its an array. Disabling callbacks
should also improve performance a tiny bit.

Refs #GH-1049
2012-12-26 14:09:45 -05:00
Ceeram
3f4d24bfc0 remove unused local variables and a few improvements 2012-12-23 13:53:13 +01:00
euromark
b811afbc44 double spaces to single ones 2012-12-22 23:48:15 +01:00
ravage84
bd71f8aa25 Update lib/Cake/Model/Model.php
Corrected an unlogic link from Model:find to an appropriate page in the docs
2012-12-21 15:06:43 +01:00
Mark Story
69248dfb1a Merge pull request #1001 from dogmatic69/refactor-uuid-checks
Refactor uuid checks into a method
2012-12-20 17:46:07 -08:00
euromark
2b1e5b02b5 code cleanup 2012-12-21 00:40:12 +01:00
mark_story
554d5794ce Merge branch 'master' into 2.3 2012-12-19 21:18:52 -05:00
mark_story
08cde9f5a2 Fix foreach error when useTable = false.
When calling model->create() with useTable = false, an error should not
be triggered.

Fixes #3480
2012-12-19 21:18:34 -05:00
mark_story
d70730d722 Fix issues with TreeBehavior and nested deletes.
Fixes #3481
2012-12-19 20:48:51 -05:00
euromark
ce93e7c206 (isset($contain[0]) && $contain[0] === null) always false 2012-12-18 01:28:05 +01:00
mark_story
4bdaa2b5a0 Merge branch 'master' into 2.3 2012-12-16 13:32:38 -05:00
mark_story
1528b5c382 Don't return true when there is nothing to save.
Model::save() should not return true when no work has been done.

Fixes #3469
2012-12-16 13:19:14 -05:00
Ceeram
54607ba0fa fix coding standards, double whitespace 2012-12-15 18:24:29 +01:00
mark_story
6f5ff4d7dd Merge branch 'master' into 2.3
Conflicts:
	lib/Cake/Model/CakeSchema.php
	lib/Cake/Test/Case/Model/Datasource/Database/MysqlTest.php
2012-12-13 20:20:42 -05:00
Mark Story
45f6ade800 Merge pull request #997 from rhelms/2.2.5-text-index-in-fixture
Cater for length part of TEXT field in indexes for MySQL'

Fixes #3428
2012-12-12 17:27:30 -08:00
Reuben Helms
07dbc4a527 Cater for length part of TEXT field in indexes for MySQL
Cater for length on TEXT column in index for _alterIndexes

Handle nested arrays in schemas

Used when writing indexes containg TEXT field for MySQL

Change comment style from code review

Remove stray space

Only generate length part of TEXT index column field when necessary

Override buildIndex() in Mysql instead of name()
Revert DboSource::buildIndex to previous state
Update Mysql::_alterIndexes for code reuse
Update MysqlTest to handle quoted index names.

Make code clearer, as per code review

Adjust function comments, as per code review
2012-12-13 08:33:43 +10:00
ADmad
c159854a17 Improve docblock 2012-12-11 00:44:42 +05:30
Ceeram
a8eca60fc5 fix coding standards 2012-12-10 17:40:12 +01:00
dogmatic69
49ea72e53e rename the method and fix docblock return type 2012-12-08 13:10:12 +00:00
Mark Story
38c592928d Merge pull request #1000 from dogmatic69/validation-simplify
Validation simplify

Simplify internals in Model/Validation
2012-12-07 19:00:46 -08:00
mark_story
8b0a7ee13d Merge branch 'master' into 2.3
Conflicts:
	lib/Cake/VERSION.txt
2012-12-07 20:53:10 -05:00
dogmatic69
b3dba95b7d making uuid field check protected 2012-12-07 02:24:12 +00:00
dogmatic69
521a759911 refactor uuid checks into a method 2012-12-07 02:22:24 +00:00
Mark Story
00d178fa28 Merge pull request #999 from dogmatic69/model-simplify
Simplify some model code
2012-12-05 18:18:50 -08:00
euromark
881127ef4d unify new lines at the end of the file 2012-12-05 15:00:24 +01:00
dogmatic69
b92b7c2d2d removing variables that are unnecessarily used 2012-12-05 10:55:11 +00:00
dogmatic69
0ada30f3bc removing nested if statement 2012-12-05 10:54:30 +00:00
dogmatic69
b99066ddd9 simplify some model code
remove nested if's and else where possible and early return.
2012-12-04 02:06:20 +00:00
dogmatic69
03882f4b55 fix up the fails 2012-12-04 01:58:57 +00:00
dogmatic69
24abed969a simplify validation code 2012-12-03 15:51:20 +00:00
mark_story
002700071d Fix incorrectly quoted fields when using the || operator.
Fixes #3404
2012-12-02 20:59:56 -05:00
Thomas Ploch
7f0085cd4e Added type hinting to Model::validator()
Added missing param and fixed typo in method's phpdoc.

Used 'assertSame' and 'assertNotSame'. Removed piped NULL type from phpdoc.

Simplify condition in Model::validator()
2012-11-28 21:32:00 -05:00
mark_story
ffcf71c810 Merge branch 'master' into 2.3 2012-11-28 21:30:15 -05:00
mark_story
f250592fee Fix multi-model validators with deep & atomic.
Apply patch from 'Christian Buffin' to fix validateMany() and
validateAssociated() when atomic=false & deep=true are used in
conjunction. Using Hash to flatten the nested set of validation results
yields the correct results.

Fixes #3352
2012-11-28 21:26:40 -05:00
ADmad
72d6ca636f Docblock fixes 2012-11-29 04:36:29 +05:30
mark_story
82d20ed948 Merge branch 'master' into 2.3
Conflicts:
	lib/Cake/Test/Case/Model/ModelReadTest.php
	lib/Cake/Test/Case/View/MediaViewTest.php
2012-11-24 15:44:52 -05:00
Mark Story
780b6f01b4 Merge pull request #962 from srwebs/feature/empty-bool-operators
Fix: check if bool operators in find conditions are empty.
2012-11-24 10:14:22 -08:00
Sam Mousa
8ef3034482 Added the table name to the cacheKey used by DboSource::fields. #3394 2012-11-24 12:22:17 +01:00
Ceeram
eadc3a75e5 fix coding standards 2012-11-21 15:39:03 +01:00
mark_story
27d7e2865e Merge branch 'master' into 2.3
Conflicts:
	lib/Cake/Console/Command/ConsoleShell.php
	lib/Cake/Network/CakeSocket.php
	lib/Cake/Network/Http/HttpResponse.php
	lib/Cake/Utility/Folder.php
	lib/Cake/View/MediaView.php
	lib/Cake/basics.php
2012-11-20 23:02:33 -05:00
ceeram
4611c987db Merge pull request #959 from ceeram/phpcsw
Make phpcs pass
2012-11-19 15:10:47 -08:00
Nicolas
9c7f357029 Check if bool operators in find conditions are empty. 2012-11-17 12:39:08 +01:00
Ceeram
6d0e32e642 fix coding standards, remove break after return/continue 2012-11-15 12:09:14 +01:00
mark_story
a7f192c606 Merge branch 'master' into 2.3 2012-11-14 21:50:29 -05:00
Mark Story
7206254166 Merge pull request #955 from dereuromark/master-tree-fixes
Asserting that tree behavior generates valid sql in recover

Fixes #3366
2012-11-14 18:03:05 -08:00
Ceeram
e02eab05d5 Remove all todo from core, create tickets for them 2012-11-14 14:59:51 +01:00
Ceeram
56225bcca3 fix all warnings except TODO warnings 2012-11-14 12:56:10 +01:00
euromark
b7e75a6399 more whitespace coding standards 2012-11-14 12:36:55 +01:00
euromark
8f78b1e05b fix coding standards for whitespaces 2012-11-14 12:24:08 +01:00
euromark
354069d229 cascade false for recover 2012-11-13 21:12:46 +01:00
ADmad
ac087ec938 Fix rules set being updated with array instead of CakeValidationRule objects. Closes #3367 2012-11-13 22:13:15 +05:30
euromark
22f65f7cb5 asserting that tree behavior generates valid sql in recover 2012-11-13 11:18:17 +01:00
mark_story
e0aab77dab Merge branch 'master' into 2.3
Conflicts:
	app/Config/Schema/i18n.php
	lib/Cake/I18n/Multibyte.php
	lib/Cake/Test/Case/Log/CakeLogTest.php
	lib/Cake/Test/Case/Routing/DispatcherTest.php
2012-11-10 21:33:26 -05:00
ADmad
7360abb0fe Added query logging to DboSource::insertMulti(). Closes #3354 2012-11-09 16:51:51 +05:30
Ceeram
aaf2d2ef71 fix remaining cs errors 2012-11-04 13:56:13 +01:00
Ryan Morris
fa759231da Update checkRequired to simply check if an array key is present rather than isset (which fails if the value is null) 2012-11-03 14:41:06 +09:00
mark_story
60f9626838 Merge branch 'master' into 2.3
Conflicts:
	lib/Cake/Test/Case/View/MediaViewTest.php
2012-11-02 16:52:51 -04:00
Ceeram
093275aef6 Use correct value when using virtualFields in conditions and IN (), refs PR#897
Squashed commit of the following:

commit 6a986953e16601fb34a132df24ae16f882f218cf
Merge: babd714 118dd8c
Author: Ceeram <c33ram@gmail.com>
Date:   Fri Nov 2 13:02:15 2012 +0100

    Merge branch 'master' into virtualcondition

commit babd714d80178c68b0e3fbcc21fc53b846484fd8
Author: Ceeram <c33ram@gmail.com>
Date:   Fri Nov 2 00:22:43 2012 +0100

    fix incorrect tests

commit 9a46c13e1aa13905b8e5474947933676e03009ce
Author: Ceeram <c33ram@gmail.com>
Date:   Thu Nov 1 11:44:19 2012 +0100

    add test for regular fields and conditionKeysToString with IN

commit 3aa62e5cb93aa0c7bbb47e874fc1446873dd0d27
Merge: a8f0c3d 1f31340
Author: Ceeram <c33ram@gmail.com>
Date:   Thu Nov 1 11:37:01 2012 +0100

    Merge branch 'master' into virtualcondition

commit a8f0c3d918761ff2c456cc3a53f1e3ee5b1c6173
Author: Ceeram <c33ram@gmail.com>
Date:   Thu Oct 11 16:46:10 2012 +0200

    use correct value when using virtualFields in conditions and IN ()
2012-11-02 14:29:38 +01:00
Ceeram
b8607ca2ed fix fieldlist, refs PR808 and PR851
Squashed commit of the following:

commit 7007dba0eb836f852aaca95fada103bc4ba993a9
Merge: 3ca4d23 7d84486
Author: Ceeram <c33ram@gmail.com>
Date:   Fri Nov 2 10:53:39 2012 +0100

    Merge branch '2.3' into calinseciu-2.3

commit 3ca4d231bf80d2bb1c0572196f633da68c1a0db7
Author: Ceeram <c33ram@gmail.com>
Date:   Sun Sep 23 12:45:00 2012 +0200

    more tests added

commit e6b12532655671aff2b966a9be89b2625a715e8f
Author: Ceeram <c33ram@gmail.com>
Date:   Tue Sep 18 09:18:32 2012 +0200

    change methodname and visbilty

commit 70396265025190ab2fbc159911ec3e064cc44fb2
Author: Ceeram <c33ram@gmail.com>
Date:   Thu Sep 6 17:26:52 2012 +0200

    fix fieldlist, refs PR #808

commit e9db96bfe163609eeefba430d8353c822aabacb0
Merge: 99b798f adb8142
Author: Ceeram <c33ram@gmail.com>
Date:   Thu Sep 6 16:26:40 2012 +0200

    Merge branch '2.3' of git://github.com/calinseciu/cakephp into calinseciu-2.3

commit adb8142d2694692ec71a063ac2ad1b275f3a67c9
Author: calinseciu <calinseciu@gmail.com>
Date:   Thu Aug 30 17:57:50 2012 +0300

    Add foreignKey to whitelist in saveAssociated()

    Association's foreignKey doesn't get saved when saving hasMany associations since it's not in the model's whitelist after validation.
    This happens if you don't send the foreignKey with the associated records data.
2012-11-02 10:56:49 +01:00
mark_story
1f31340a2a Fix issue with Model::saveAssociated() and TranslateBehavior
When combining saveAssociated() with validate=first and
TranslateBehavior. Saving data for multiple locales was not done
correctly.

Fixes #3272
2012-10-31 23:13:56 -04:00
Kyle Robinson Young
f10c669813 Code standards fixes 2012-10-29 08:14:17 -07:00
mark_story
c24bec679b Merge branch 'master' into 2.3
Conflicts:
	lib/Cake/View/Helper/FormHelper.php
2012-10-27 21:13:53 -04:00
euromark
0f978195d6 coding standards regarding whitespaces 2012-10-27 00:46:12 +02:00
Rachman Chavik
e61483126c CakeSchema: adds empty line between tables 2012-10-26 13:27:47 +07:00
Ber Clausen
c741f60367 Make Model::find('first') always return an array. 2012-10-25 17:57:37 -03:00
dogmatic69
641ba9f3e6 Merge branch '2.3' into type-checks
Conflicts:
	lib/Cake/Error/ExceptionRenderer.php
	lib/Cake/Routing/Dispatcher.php
2012-10-24 19:03:44 +01:00
ADmad
1763f46340 Merge branch 'master' into 2.3
Conflicts:
	lib/Cake/bootstrap.php
2012-10-23 16:53:01 +05:30
Mark Story
746eaf9389 Merge pull request #894 from dereuromark/comp-fix-save-all
BC mod for saveAll()
2012-10-22 18:40:38 -07:00
mark_story
a0a61b5980 Fix issue where createSchema() would omit primary keys sometimes.
Fix missing primary key SQL when using the primary flag + other indexes.

Fixes #3292
2012-10-22 20:46:10 -04:00
Jose Lorenzo Rodriguez
c00d58b4ef Fixed problems with resetSequence() not using the correct sequence name
in postgres
2012-10-21 16:32:52 +02:00
mark_story
0b0b361e48 Merge branch 'master' into 2.3
Conflicts:
	lib/Cake/Test/Case/Model/Behavior/ContainableBehaviorTest.php
2012-10-20 20:48:11 -04:00
mark_story
08556ab879 Fix saveAssociated() with validate=first, atomic=false
When using the above options & validation errors on the associated
models, saving would not be aborted.

Fixes #3285
2012-10-20 15:12:05 -04:00
mark_story
888b1f4795 Fix issue with using contain() and query[contain]
When contain() and query['contain'] = array(...) were used together
the query['contain'] values where not respected.

Fixes #3287
2012-10-20 14:51:52 -04:00
mark_story
1aea9ac0c9 Merge branch 'master' into 2.3
Conflicts:
	lib/Cake/Event/CakeEventManager.php
	lib/Cake/VERSION.txt
	lib/Cake/View/ViewBlock.php
2012-10-15 21:46:49 -04:00
Adam Taylor
4090c2e932 Remove trailing whitespace from comments
See http://groups.google.com/d/topic/cakephp-core/fuHTYMKVJno/discussion
2012-10-15 18:19:37 -06:00
mark_story
3e0fa0009b Show the last 200 queries instead of the first 200.
Fixes #3273
2012-10-14 21:30:28 -04:00
euromark
1e2ac0b9c8 comp mod for saveAll()
better approach

test case to assert saveAll still behaves like previous versions
2012-10-11 14:03:59 +02:00
ADmad
f06bdde8c6 Fix docblock 2012-10-11 12:33:46 +05:30
ADmad
5de492fb25 Allow saving new records with pre specified primary key value with treebehavior. 2012-10-11 01:03:49 +05:30
Mark Story
4acc687dcd Merge pull request #890 from dereuromark/master-not-empty-validation
Fix validation error domain for notEmpty
2012-10-09 14:52:11 -07:00
ADmad
33a879ff41 Fix find('count') with 'group' when result has only one group. Closes #1677 2012-10-09 10:43:27 +05:30
ADmad
a1aa73c1a2 Cache character set names 2012-10-07 21:58:49 +05:30
euromark
e85b2a072a fix validation error domain for notEmpty
$this->_validationDomain for default notEmpty message

notEmpty default error message
2012-10-07 14:17:31 +02:00
dogmatic69
408e619c9f Merge branch '2.3' into type-checks
Conflicts:
	lib/Cake/Console/Command/Task/ModelTask.php
	lib/Cake/Controller/Component/RequestHandlerComponent.php
	lib/Cake/Model/Datasource/Database/Mysql.php
	lib/Cake/Utility/CakeNumber.php
2012-10-01 02:08:00 +01:00
mark_story
59e948fb1b Merge branch 'master' into 2.3 2012-09-28 21:20:24 -04:00
James Michael DuPont
2d46fc60be Fixing undefined variable usage
Squash of pull request #872
2012-09-28 20:46:25 -04:00
euromark
b7f1740d2b correcting coding-standards 2012-09-28 13:49:51 +02:00
mark_story
0fc9a2c29c Update query building in TranslateBehavior.
* Reduce duplicate checks for Alias.*.
* Allow both the quoted and non quoted version of Alias.*

Fixes #3210
2012-09-25 21:01:19 -04:00
Jose Lorenzo Rodriguez
c870044262 Fixed typo 2012-09-25 17:05:41 +02:00
Jose Lorenzo Rodriguez
d5c9d97dc1 Merge remote-tracking branch 'origin/master' into 2.3
Conflicts:
	lib/Cake/Model/Behavior/TranslateBehavior.php
	lib/Cake/Model/CakeSchema.php
	lib/Cake/Utility/CakeTime.php
	lib/Cake/Utility/ClassRegistry.php
	lib/Cake/View/MediaView.php
2012-09-25 16:36:03 +02:00
dogmatic69
cd99b7d6ff fixing error pointed out by dereuromark with recursive https://github.com/cakephp/cakephp/pull/846#commitcomment-1884073 2012-09-21 23:40:21 +01:00
dogmatic69
36314e6d37 converting if ($foo != "") to if ($foo) 2012-09-21 23:34:37 +01:00
dogmatic69
8dc4de5de8 converting if ($foo != false) to if ($foo) 2012-09-21 23:32:52 +01:00
dogmatic69
b1f26b59a3 converting if ($foo != null) to if ($foo) 2012-09-21 23:30:43 +01:00
José Lorenzo Rodríguez
2818ec6eb4 Merge pull request #859 from dereuromark/2.3-format-delta
adding CakeNumber::formatDelta() and fixing issue with format()
2012-09-21 00:18:35 -07:00
dogmatic69
6d4f4b57d7 adding a plugin propery to models wwith tests for ticket #85
Merge pull request #696
2012-09-20 21:31:31 -04:00
Ber Clausen
aaefbf1c2f Add MySQL FULLTEXT support.
Minor optimizations and testing added.
Merge pull request #862 from bar/mysql-fulltext

Fixes #262
2012-09-20 20:42:30 -04:00
mark_story
a9750264e4 Revert "Add MySQL FULLTEXT support."
This reverts commit 36c99a358f.
2012-09-20 20:39:02 -04:00
Mark Story
f4a639cbfa Merge pull request #862 from bar/mysql-fulltext
Add MySQL FULLTEXT support.

Fixes #262
2012-09-20 17:20:23 -07:00
Ber Clausen
36c99a358f Add MySQL FULLTEXT support.
Minor optimizations and testing added.
2012-09-20 00:35:42 -03:00
euromark
213d4caa85 coding standards 2012-09-20 01:50:15 +02:00
ADmad
d12f50a2b6 Removing unneeded App::uses() calls 2012-09-20 02:40:54 +05:30
mark_story
99cbd22969 Fix coding standards. 2012-09-18 14:52:46 -04:00
mark_story
a1838a0c85 Implement missing bits for automatic sequence resetting.
Refs #3206
2012-09-18 14:12:23 -04:00
mark_story
55dcb9c3b3 Implement resetSequence()
This is an optional method in DboSource that allows datasources to
resetSequence values in tables.  This is useful for datasources like
Postgres, and makes using fixtures much easier.

Fixes #3026
2012-09-17 20:50:05 -04:00
dogmatic69
a38a616cba changing join() to implode() for consistency 2012-09-15 11:06:02 +01:00
mark_story
d6e2b6f83e Re-format long lines. 2012-09-14 22:08:52 -04:00
Mark Story
89c98233b5 Merge pull request #843 from dereuromark/2.3-ticket-3172
check() for CookieComponent and Configure
2012-09-14 18:22:34 -07:00
euromark
6d3e0a25b2 save some memory usage (PHP < 5.4) in case of huge content and cut off the isset call 2012-09-15 02:33:05 +02:00
dogmatic69
f5a8eb6bbf ADmads comments 2012-09-14 19:57:51 +01:00
dogmatic69
cfadc4dbb0 strict type checks and removing some duplicate count() calls by setting a variable 2012-09-14 19:26:00 +01:00
dogmatic69
22a2e1b51e converting $foo == / $foo == 0 to !$foo (and a few $foo === 0) 2012-09-14 18:42:25 +01:00
dogmatic69
cf8fccae96 converting $foo == null / $foo == false to !$foo 2012-09-14 18:26:30 +01:00
mark_story
7d2cbec79d Revert "Fix null not stopping model callbacks."
This reverts commit 82a8400def.

The previous change broke a number of tests as existing tests expect
that a return value of null will not stop events.
2012-09-13 22:49:17 -04:00
mark_story
82a8400def Fix null not stopping model callbacks.
Add a compatibility shim into CakeEventManager to fix `null` not
breaking model callbacks.  This was a regression created when model
callbacks were re-factored to use the event manager. This code should be
removed in 3.x as its inconsistent with events used everywhere else in
the framework.

Fixes #3123
2012-09-13 22:11:46 -04:00
mark_story
fb9360767e Make connection exceptions more helpful.
Fixes #3204
2012-09-12 22:31:07 -04:00
Kyle Robinson Young
bc40ac7d3f Remove unused variables and code 2012-09-05 17:19:13 -07:00
mark_story
6664acba79 Merge branch 'master' into 2.3
Conflicts:
	lib/Cake/VERSION.txt
2012-09-05 20:15:36 -04:00
Kyle Robinson Young
200dd2dc9b Code standards fixes, unneeded break statements 2012-09-04 11:30:52 -07:00
mark_story
3cb501f1c5 Fix issue created in [e8b5d81fd7]
Query conditions with `-` and no surrounding spaces were quoted
incorrectly.

Fixes #3178
2012-09-03 13:24:38 -04:00
mark_story
571c8bc08c Merge branch 'master' into 2.3
Conflicts:
	lib/Cake/Console/Command/Task/TestTask.php
2012-09-01 13:51:40 +01:00