Commit graph

6543 commits

Author SHA1 Message Date
Florian Krämer
43f7fcc735 Adding a few more ways to detect HTTP headers, extensions and the accept header. 2014-11-27 01:00:44 +01:00
euromark
d0f75a03af Allow RLIKE in conditions. 2014-11-26 19:56:58 +01:00
Tsuyoshi Sadakata
1f4402cd4c check ob_get_level() before ob_flush() 2014-11-26 17:25:10 +09:00
mark_story
1e6d22b8cb Make the version option function as intended.
The version option is documented but does not work. While this 'breaks'
behavior, it also fixes what I think is a more important issue.

Refs #5234
2014-11-24 22:38:00 -05:00
Lawrence Barsanti
9631b54244 remove space 2014-11-24 16:36:43 -05:00
Lawrence Barsanti
bb5088cda3 PHPUnit can be included as a phar file.
No need to install phpunit in order to run unit tests.  Simply place
'phpunit.phar' in the vendors folder.
2014-11-24 14:51:36 -05:00
Sebastien Barre
20e2882bf6 Remove duplicate class declaration 2014-11-23 21:49:29 -05:00
Sebastien Barre
5ac47487f9 Merge branch 'ticket-5041' of github.com:sebastienbarre/cakephp into ticket-5041
Conflicts:
	lib/Cake/Test/Case/Controller/Component/AuthComponentTest.php
2014-11-22 13:38:11 -05:00
Sebastien Barre
a2e7896038 Fix uses, style 2014-11-22 13:31:39 -05:00
Sebastien Barre
7da48669c8 Have BaseAuthenticate implement CakeEventListener instead 2014-11-22 13:31:38 -05:00
Sebastien Barre
50e5b5e8fe Move App::uses() again 2014-11-22 13:31:38 -05:00
Sebastien Barre
d7b353dcf9 Move App::uses(), rename helper class to avoid conflict 2014-11-22 13:31:38 -05:00
Sebastien Barre
43413f029e Ticket 5041: have Auth::login() send Auth.afterIdentify event 2014-11-22 13:31:38 -05:00
mark_story
b6caddcf49 Fix file_map being regenerated on every request.
A mistake a few months ago caused the file_map to always be regenerated
as Configure::write() would cause both Configure and Hash to be loaded,
invalidating the file map. By entering bootstrap mode earlier we can
avoid that.

Refs #5229
2014-11-22 12:21:28 -05:00
Florian Krämer
4ff07b745a Adding a test for the new json and xml detectors that were added to the CakeRequest class. 2014-11-22 17:30:53 +01:00
Florian Krämer
83eb8ce7de Changes to Cake/Network/CakeRequest.php as discussed on Github for the detector code changes. Fixed the description of a few doc blocks, removed the use of getallheaders(), removed the failsafe (based on extension) for the xml and json detectors. 2014-11-22 12:55:22 +01:00
Florian Krämer
17e5d41e55 Restructuring the CakeRequest::is() code and related code a little. 2014-11-21 18:49:36 +01:00
Stephen Cuppett
ffb7e86641 Enable sslmode for PostgreSQL connections
By default, PHP 5.5 and PostgreSQL PDO will not allow SSL connections. This adds the default of "allow", but also the user may override the setting to "require" or any of the other potential values. 

See: http://php.net/manual/en/function.pg-connect.php
2014-11-20 22:37:39 -05:00
Florian Krämer
24c4cab4f3 phpcs fix in Cake/Test/Case/Network/CakeRequestTest.php 2014-11-20 22:50:12 +01:00
Florian Krämer
3f5f8cbc15 phpcs fixes in Cake/Network/CakeRequest.php 2014-11-20 22:16:36 +01:00
Florian Krämer
728764c543 Adding a test for the refactored CakeRequest code. 2014-11-20 21:14:17 +01:00
Florian Krämer
88bfa70cad Refactoring the detector code for CakeRequest::is() and adding default detectors for JSON and XML. 2014-11-20 21:14:07 +01:00
Rachman Chavik
a37e007d9f BC fix for css() and script() with identical resource names 2014-11-19 11:20:37 +07:00
Rachman Chavik
7bea96f534 Add test for css() and script() with the same resource identifier 2014-11-19 11:20:37 +07:00
mark_story
fe6d3e36d5 Bump version number to 2.7.0-dev
Open a branch for any development on 2.7.x which will be a 2.x API
compatible release.
2014-11-18 23:06:24 -05:00
mark_story
23c5805763 Fix mistake with previous commit.
I forgot to put the correct variable into the query like a doofus.

Refs #4168
2014-11-18 22:03:30 -05:00
Mark Story
5dab175aa9 Merge pull request #5196 from cakephp/issue-5140
Gracefully handle invalid chunks in HttpSocket
2014-11-18 21:58:41 -05:00
Mischa ter Smitten
f2c84602b9 Bugfix for: Memcached Engine segfaults with memcached client version < 2.0.0
Fixes #5028
2014-11-18 21:26:57 +01:00
ndm2
bae556e73f Prevent zero only lines from being emptied 2014-11-18 17:26:31 +01:00
mark_story
ddc3eee84c Use name() instead of hand quoting sequence names.
By using name() we can easily accomodate postgres sequences that exist
out side of sequences.

Fixes #4168
2014-11-17 22:47:07 -05:00
mark_story
8cbf975943 Gracefully handle invalid chunks in HttpSocket
When invalid chunks are detected we should assume the server is
incorrect and handle the remaining content as a single large chunk.

Refs #5140
2014-11-17 22:23:46 -05:00
mark_story
e00aa596b1 Merge branch '2.6' of github.com:cakephp/cakephp into 2.6 2014-11-14 21:25:24 -05:00
mark_story
decce4daf2 Merge branch 'master' into 2.6 2014-11-14 21:25:09 -05:00
Mark Story
f570f931ce Merge pull request #5159 from cakephp/issue-5155
Add order=>false to all treebehavior queries.

Refs #5155
2014-11-14 10:02:17 -05:00
mark_story
4b6dba0c0a Add order=>false to all treebehavior queries.
Models can define default order conditions that will cause issues with
postgres. By setting order=>false on all the queries emitted by
TreeBehavior, we can avoid this issue and not have issues with models
that define a default ordering.

Refs #5155
2014-11-13 21:21:47 -05:00
Bryan Crowe
e3e54d40fa Fix CS, remove extra space 2014-11-13 16:47:10 -05:00
mark_story
6092c168a9 Fix issues with sqlite field parsing.
The previous attempt would still fail on unions or derived table join
queries. This new approach is a bit slower but more robust.

Refs #3972
2014-11-12 20:49:19 -05:00
mark_story
93a6fd5648 Fix SQLite parsing fields incorrectly when using subqueries.
When using subqueries or joining against tables containing FROM the
results were bizzare and unexpected. By tokenizing the entire query we
can more accurately grab the fields.

Refs #3972
2014-11-11 23:16:08 -05:00
watermark
8712dc01df Cleanup of isUnique
isUnique takes the count of the args multiple times.  Store the count in a variable to cut down on overhead.
2014-11-11 16:13:16 -05:00
euromark
8e18e5a1c7 Correct argument order for assert. 2014-11-11 01:51:46 +01:00
euromark
2990c2143c Correct assert argument order. 2014-11-11 01:49:19 +01:00
mark_story
3095187952 Merge branch 'master' into 2.6
Conflicts:
	lib/Cake/VERSION.txt
2014-11-10 19:38:31 -05:00
mark_story
7718d473c4 Remove singularization on schema class names.
Using camelize() does the transformation we want without also
singularizing the name. This makes user input more transparent and fixes
issues around plugin schemas with plural names.

Refs #4993
2014-11-09 21:52:10 -05:00
mark_story
9ce3d89c81 Clean up formatting and make a failure exit non-zero.
Console tools should exit non-zero when a comman fails.

Refs #4993
2014-11-09 21:21:42 -05:00
ndm2
f0b6657113 Make unsetting the email pattern work as expected.
When set to `null`, only `filter_var()` should be used. This is a
partial backport of #5111
2014-11-09 16:33:57 +01:00
Mark Story
4242ce453f Merge pull request #5093 from cakephp/2.6-returns
Simplify return types.

Update code to use documented return types where possible, and reduce number of return types.
2014-11-08 14:58:22 -05:00
euromark
41c646c5a1 Simplification of return types. No need to return more mixed than necessary. 2014-11-08 20:07:47 +01:00
mark_story
cc1fd33d0b Update version number to 2.6.0-RC1 2014-11-07 20:36:25 -05:00
mark_story
c151ea585d Update version number to 2.5.6 2014-11-07 20:35:12 -05:00
mark_story
0e4fb9d648 Merge branch 'master' into 2.6 2014-11-07 15:13:46 -05:00
mark_story
6aaac6b7e2 Fix HttpSocket mishandling encoded URIs
The HTTP specs seem to indicate that the Location header should contain
an 'absoluteURI' which includes encoded data. In order to avoid
a regression with the issue fixed in b9ee4fc9f1
we'll continue to replace `%2F` and no longer decode the entire URI.

Fixes #5076
2014-11-05 22:18:48 -05:00
mark_story
dac8b7b644 Update return type for Model::saveField().
Fixes #5086
2014-11-05 20:37:43 -05:00
Sebastien Barre
4bada05028 Fix doc/style 2014-11-05 18:37:20 -05:00
Sebastien Barre
ee73c1732b Have BaseAuthenticate implement CakeEventListener instead 2014-11-05 18:03:26 -05:00
euromark
345a18f15f Merge branch 'master' into 2.6 2014-11-05 23:29:06 +01:00
Sebastien Barre
f78e6c0621 Move App::uses() again 2014-11-05 13:46:45 -05:00
Sebastien Barre
4c59ab6eca Move App::uses(), rename helper class to avoid conflict 2014-11-05 13:36:29 -05:00
Sebastien Barre
0cdb93b265 Ticket 5041: have Auth::login() send Auth.afterIdentify event 2014-11-05 12:34:25 -05:00
euromark
0d5d6b19b5 Wording correction. 2014-11-05 13:14:45 +01:00
euromark
768f2c809c Correct doc block return types. 2014-11-05 13:03:27 +01:00
mark_story
07c91d4b3e Merge branch '2.6' of github.com:cakephp/cakephp into 2.6 2014-11-04 22:44:28 -05:00
mark_story
48101e6bf5 Merge branch 'master' into 2.6 2014-11-04 22:44:11 -05:00
Mark Story
96b82e4226 Merge pull request #5021 from dereuromark/master-mysql
Fix IN replacement in virtual fields for MYSQL.
2014-11-04 08:24:03 -05:00
euromark
a6bd133413 Correct typos. 2014-11-02 22:41:17 +01:00
euromark
e7f76a983a Add a method for generating pagination meta links. 2014-11-02 22:29:02 +01:00
euromark
00432fa427 Show stack trace for fatal errors if xdebug is loaded. 2014-11-02 20:44:17 +01:00
Sebastien Barre
2995d9319c Prepend model alias for safety 2014-11-01 09:36:59 -04:00
Sebastien Barre
417c137d11 Fix DigestAuthenticate test 2014-10-31 21:42:18 -04:00
Sebastien Barre
544ddac08c Fix indentation 2014-10-31 16:38:09 -04:00
Sebastien Barre
60917974bf Add test for userFields and related models 2014-10-31 16:35:55 -04:00
Sebastien Barre
f6c71024c5 Add test for the 'contain' setting, which was missing (unrelated to feature) 2014-10-31 16:04:09 -04:00
Sebastien Barre
2f62ee2cde ticket #5017 add userFields setting to BaseAuthenticate 2014-10-31 15:00:19 -04:00
mark_story
579b16d90b Merge branch 'master' into 2.6 2014-10-30 21:20:53 -04:00
euromark
0f9890720e Correct test 2014-10-31 01:45:41 +01:00
euromark
bb67df4305 Simplify test 2014-10-31 01:18:08 +01:00
Mark Story
a8c5b70b22 Merge pull request #4489 from busgurlu/patch-1
to correctly return SET() type
2014-10-30 19:56:47 -04:00
euromark
70acd2fe3f doc block update. 2014-10-30 19:15:23 +01:00
euromark
e5b45bcdea Fix IN replacement in virtual fields for MYSQL. 2014-10-30 19:14:04 +01:00
mark_story
1e8f12f9f5 Bump the depth of variables in stack traces to 4.
Giving more context allows developer to look at request/response data
more easily.

Fixes #5005
2014-10-29 21:43:18 -04:00
Mark Story
94d56a3d74 Merge pull request #4985 from fixon/issue-2172
Make CakeResponse::file() accept ranges even when download option is fal...
2014-10-29 07:52:09 -04:00
José Lorenzo Rodríguez
9d0390ca63 Merge pull request #4953 from jrbasso/2.6-route-set-state
Implementing __set_state for CakeRoute
2014-10-28 09:36:42 +01:00
Juan Basso
6171ef69c3 Update test cases for CakeRoute::__set_state
It removes the eval and test the __set_state more explicitly.
2014-10-27 23:45:46 -04:00
mark_story
d228d83b1e Relative paths should be created relative to pwd.
If create() is called with a relative directory and the path does not
exist, it should be created inside of the folder->pwd() and not inside
the process' cwd.

Refs #4990
2014-10-27 21:32:28 -04:00
mark_story
ebc1bcb624 Add additional useful tests for autoLink()
These new tests cover an important case that could easily be missed in
the future. Links with URL's should not be re-linked.

Refs #4998
2014-10-27 21:03:03 -04:00
mark_story
177b797aab Merge branch 'master' into 2.6 2014-10-26 21:25:05 -04:00
José Lorenzo Rodríguez
431578d956 Merge pull request #4931 from jrbasso/2.6-router-optimization
Simplified way to add new prefixes to the router
2014-10-26 22:09:17 +01:00
Marek Władysz
65cb186652 Use assertNotSame() instead of assertTrue($result !== false) 2014-10-26 14:19:19 +01:00
Jan Ptacek
797635d26b fixing testcases + do not disable the hidden input on partial disables 2014-10-25 21:05:37 +02:00
Marek Władysz
090e85a5a4 Make CakeResponse::file() accept ranges even when download option is false. 2014-10-25 19:49:56 +02:00
mark_story
4b5783c5fe Add deterministic ordering to translate associations.
Having a deterministic ordering based on the primary key resolves
tests potentially failing when postgres returns data in a non-sequential
order.
2014-10-24 22:21:06 -04:00
mark_story
b5050db643 Merge branch '2.6' of github.com:cakephp/cakephp into 2.6 2014-10-24 22:06:03 -04:00
mark_story
b98d2a3365 Merge branch 'master' into 2.6 2014-10-24 22:05:46 -04:00
ptica
abb0c7cb9d Update FormHelper.php
disabled multiple checkbox input should not generate an enabled hidden input,
as it leads to saving empty data upon submission -> carrying the disabled attribute to the hidden input prevents this
2014-10-24 18:25:31 +02:00
Juan Basso
f7320cd8cd Fixed PHPCS issues 2014-10-21 23:47:17 -04:00
Juan Basso
b2a92f9cd8 Implementing __set_state for CakeRoute
It helps the applications to cache the routes using var_export when possible.
2014-10-21 23:04:08 -04:00
Bryan Crowe
6f4c3b2765 Fix views overwrite warning text 2014-10-21 14:39:09 -04:00
Juan Basso
833ca68a55 Replaced for loops by foreach 2014-10-20 16:43:11 -04:00
Juan Basso
9b4379b17d Simplified way to add new prefixes to the router 2014-10-19 21:55:33 -04:00
Juan Basso
ba0901d40e Removed the code that was never being executed 2014-10-19 18:56:02 -04:00
dmromanov
959a22a8b2 Documentation correction 2014-10-19 00:05:08 +04:00
mark_story
cdc67116c5 Handle query string arguments in digest auth data.
Handle &, ? in digest auth data uri.

Refs #4908
2014-10-17 23:12:41 -04:00
Marc Würth
2ad181b6e1 Now the tableParameters array gets escaped through values(), too 2014-10-16 19:10:52 +02:00
Marc Würth
b3770974f1 Added tests for MySQL table comment feature 2014-10-16 16:44:09 +02:00
Marc Würth
84b0fe1c88 Added comment to $tableParameters array 2014-10-16 16:06:33 +02:00
mark_story
4c93f103c7 Merge branch 'master' into 2.6 2014-10-15 23:28:27 -04:00
mark_story
afcd0312bf Fix Memcached test failures.
The Memcached extension does not provide enough information to PHP's
Reflection API to allow mock objects to be generated correctly. We'll
skip the affected tests until php-memcached-dev/php-memcached#126 has
been resolved.
2014-10-15 11:11:50 -04:00
mark_story
b86aae4d8b Add default prefix to RedisEngine
This makes redis work like the other cache engines. Also by having
a default prefix the clear() method will not wipe all the data in the
current redis database.

Refs #4876
2014-10-14 22:47:34 -04:00
José Lorenzo Rodríguez
e686a43524 Merge pull request #4867 from cakephp/issue-4694
Fix getMockForModel() using the incorrect datasource.
2014-10-14 14:13:01 +02:00
mark_story
1c440e2cb2 Merge branch '2.6' of github.com:cakephp/cakephp into 2.6 2014-10-13 21:11:52 -04:00
mark_story
87fcc9f0b9 Merge branch 'master' into 2.6
Conflicts:
	lib/Cake/VERSION.txt
2014-10-13 21:11:38 -04:00
mark_story
b55a88508f Fix PHPCS and PHP5.3 error. 2014-10-13 21:07:08 -04:00
mark_story
50b3893e65 Make rule sniff less complicated and tidy up doc block.
Refs #4871
2014-10-13 17:59:31 -04:00
Rachman Chavik
dcb605c700 Possible fix for isUnique backward compatibility 2014-10-13 19:46:10 +07:00
Rachman Chavik
dc7b8cbb89 Add BC test for #4851 2014-10-13 19:40:30 +07:00
mark_story
9b9e886df6 Fix getMockForModel() using the incorrect datasource.
Because getMockForModel() does not go through the test datasource
injection in ClassRegistry::init() we need to duplicate the basics of
that logic here. Thankfully, we already have a mock so we can do that
datasource switching without reflection. Of course this means there will
be limitations to how/when this will work, but I feel those scenarios
can probably be solved by not using mocks, or by mocking out the
problematic methods. This set of changes makes getMockForModel() work
with secondary datasources, as one would expect it to do, but I'm not
sure it ever did.

Refs #4694
2014-10-12 22:30:22 -04:00
ADmad
6dc98afa1e Merge branch 'master' into 2.6
Conflicts:
	lib/Cake/VERSION.txt
2014-10-12 20:20:14 +05:30
ADmad
ecf030796b Fix docblock 2014-10-11 19:37:22 +05:30
Mark Story
63ffb2215b Merge pull request #4853 from ceeram/2.6-atomic-translate
TranslateBehavior now uses original atomic option value, if set
2014-10-10 17:48:31 -04:00
Ceeram
43e998422e Fix PHPCS errors 2014-10-10 16:52:01 +02:00
Ceeram
12ebf8b427 add test for atmoic save of TranslateBehavior 2014-10-10 16:44:01 +02:00
Ceeram
1dfd3405a4 TranslateBehavior now uses original atomic option value, if set 2014-10-10 14:17:16 +02:00
mark_story
39011cd9d8 Fix Model::isUnique() not working as a validator.
While it *did* work for single fields, isUnique could not be used to
validate the uniqueness across multiple fields as documented. Because
validation methods pass arguments in an order the validator did not
expect the validation method would not work correctly.

Fixes #4571
2014-10-09 22:49:17 -04:00
mark_story
0ff9545e5a Add test for find() and array conditions.
Add a test for conditions using an array with only one element.

Closes #4848
2014-10-09 19:58:18 -04:00
ADmad
94e718372a Make CakeSession::read() return null for all failure cases. 2014-10-09 19:27:27 +05:30
Bryan Crowe
e16bef1868 Fix missing 'r' from your 2014-10-08 15:06:30 -04:00
suzuki86
e4c0dee6ee Fix small typo 2014-10-08 23:37:38 +09:00
mark_story
7b44d5d7a3 Update version number to 2.6.0-beta 2014-10-04 23:01:03 -04:00
mark_story
ce98a1ff57 Update version number to 2.5.5 2014-10-04 22:59:03 -04:00
Ceeram
fcffe3961f Revert "add test to prove requesthandler works correct with Angular wonky accept headers"
This reverts commit 8507ef83f1.

Incorrect header was used for this test, Cake cannot safely determine correct header.
To get CakePHP to respond with json, you can modify the angular common headers.
2014-10-02 22:12:35 +02:00
Ceeram
8507ef83f1 add test to prove requesthandler works correct with Angular wonky accept headers 2014-10-02 16:07:10 +02:00
Mark Story
d99d9bc37f Merge pull request #4780 from Schlaefer/timeAgoInWords-futureString
adds option for future string to CakeTime::timeAgoInWords & code cleanup
2014-10-01 20:34:41 -04:00
mark_story
2ee0827161 Fix PHPCS errors. 2014-10-01 20:34:33 -04:00
Hunter Perrin
be8c591dd8 Fixed coding standard violations. 2014-10-01 12:40:22 -07:00
Hunter Perrin
050e368bd0 Improvements to Hash::expand and Hash::merge.
Because of the recursion in these functions, processing very large
arrays would take a very long time. I rewrote the functions to
eliminate any unnecessary recursion and function calls. Large arrays
are now processed much faster.
2014-10-01 12:08:43 -07:00
Schlaefer
fd2dd58360 code formatting, fixes PHPCS errors 2014-10-01 11:25:24 +02:00
Schlaefer
388e412a82 fixes failing test cases from last CakeTime::timeAgoInWords changes
at b96eb1fb46
2014-10-01 11:09:00 +02:00
Schlaefer
b96eb1fb46 cleans up CakeTime::timeAgoInWords and adds option for custom futures string 2014-10-01 10:35:41 +02:00
mark_story
af43bc1706 Merge branch 'master' into 2.6 2014-09-25 22:39:51 -04:00
euromark
9c8ab826bf Correct a few more misleading assert orders. 2014-09-24 14:34:24 +02:00
euromark
fce16189d5 Fix tests 2014-09-24 14:25:18 +02:00
euromark
af7916b1a7 Fix bug in CakeEmail::reset() 2014-09-24 14:02:18 +02:00
mark_story
1877cab341 Fix UUID primary key columns not being reflected properly.
When UUID columns are converted into varchar(36) they should also be
default = null, null = false.

Fixes #4695
2014-09-23 22:16:18 -04:00
Yves
b70cb132fd Fix Hash::remove() removing data even if the path is not matched 2014-09-23 22:00:49 +02:00
mark_story
249dc5650b Merge branch 'relative-sprintf' into 2.6
Refs #4550
2014-09-22 20:56:33 -04:00
mstra001
d6abfcaf90 Update tests for strfime() in timeAgoInWords()
Add test asserts for testTimeAgoInWordsWithFormat with strftime format
2014-09-22 20:50:37 -04:00
mstra001
244acc724d Add strftime() support to CakeTime::timeAgoInWords()
When an absolute date is generated CakeTime will automatically use
strftime() if the format string contains %. This allows for simpler
localization.

Refs #4550
2014-09-22 20:49:20 -04:00
mark_story
cf45d3fab8 Merge branch 'master' into 2.6 2014-09-22 20:46:28 -04:00
Mischa ter Smitten
a69e9bc63b Cs fixes 2014-09-18 10:50:35 +02:00
euromark
4d1a65ede2 Add intl email test. 2014-09-16 10:14:00 +02:00
wisoot
eb14a64d0b Check whether the filter key is a valid class name before assuming that value is class settings 2014-09-15 15:29:30 +10:00