Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorry, wrong branch :( #9024

Closed
wants to merge 329 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
329 commits
Select commit Hold shift + click to select a range
bff49bd
Added tests for all expression that are capable of accepting
lorenzo Mar 24, 2016
a4c1222
Adding doc blocks and fixing some failing tests
lorenzo Mar 24, 2016
a5e410c
Renamed trait
lorenzo Mar 25, 2016
770016d
Using the new trait and simplifying code
lorenzo Mar 25, 2016
838c5fd
Fix typos in doc blocks.
markstory Mar 24, 2016
799c7c2
Making sure ValuesExpression also casts values to expressions
lorenzo Mar 25, 2016
3cbb89c
It turns out that SQLite 3.7.11+ implements multi-inserts!
lorenzo Mar 25, 2016
cb42f90
Adding integration test for the Type to expression casting
lorenzo Mar 26, 2016
1b00624
Simplifying code
lorenzo Mar 26, 2016
2e3782e
Making tests pass in postgresql
lorenzo Mar 26, 2016
17c3bef
Adding a function traslator for the SUBSTR function in SQL Server
lorenzo Mar 26, 2016
480a1f0
Fixed CS
lorenzo Mar 26, 2016
6dc1b3f
Fix up typos and add doc blocks.
markstory Mar 26, 2016
f52cea8
More CS fixes
lorenzo Mar 26, 2016
e248f6f
Add argument support for detectors
jadb Mar 27, 2016
3cc3074
Add new argument to docblock
jadb Mar 27, 2016
64ec05c
Missing templates should raise exceptions.
markstory Mar 28, 2016
73cafe7
Revert "Missing templates should raise exceptions."
markstory Mar 28, 2016
71c5e98
Missing templates should raise exceptions.
markstory Mar 28, 2016
ce76580
Merge pull request #8492 from CVO-Technologies/email-subject-decode
lorenzo Mar 28, 2016
bb014d2
Merge branch 'master' into 3.next
markstory Mar 29, 2016
9ffc1de
Merge branch '3.next' of github.com:cakephp/cakephp into 3.next
markstory Mar 29, 2016
c3256ab
Merge pull request #8550 from cakephp/3.3-request-detectors-arguments
markstory Mar 30, 2016
26591df
Merge pull request #8555 from cakephp/issue-8554
markstory Mar 31, 2016
67c7d95
Merge branch 'master' into 3.next
markstory Apr 2, 2016
0b92431
Added test for value object in conditions
lorenzo Apr 2, 2016
1aba0c3
Merge branch 'master' into 3.next
markstory Apr 4, 2016
e5632f3
Merge branch 'master' into 3.next
markstory Apr 4, 2016
5541862
Merge pull request #8526 from cakephp/expression-types
lorenzo Apr 4, 2016
82d6fcf
Add MiddlewareStack.
markstory Apr 4, 2016
1c068b4
Fix import ordering.
markstory Apr 4, 2016
2f37224
Get 100% coverage!
markstory Apr 5, 2016
b89a845
Implement the middleware runner.
markstory Apr 5, 2016
4e685e6
Merge pull request #8590 from cakephp/middleware-stack
lorenzo Apr 5, 2016
bc18e90
Merge remote-tracking branch 'origin/master' into 3.next
lorenzo Apr 5, 2016
1c2a9d9
allow requirePresence to pass array to validate multiple fields
Graziel Apr 6, 2016
219f22a
doc block update
Graziel Apr 6, 2016
ed8cbc1
Add RequestFactory and RequestTransformer.
markstory Apr 6, 2016
9fbb51f
Fix PHPCS errors.
markstory Apr 7, 2016
1e2e0ab
Merge remote-tracking branch 'origin/master' into 3.next
lorenzo Apr 7, 2016
d2828ff
Merge pull request #8599 from cakephp/middleware-runner
lorenzo Apr 7, 2016
91799c4
Merge branch 'master' into 3.next
markstory Apr 7, 2016
5fb587b
Don't output two welcome messages.
markstory Apr 7, 2016
35c51bb
fix grammar
Graziel Apr 8, 2016
7243769
i should double read mail first : )
Graziel Apr 8, 2016
9989334
Added option to check for NULL values on IsUnique
Apr 8, 2016
466ecf9
added tests
JayPHP Apr 9, 2016
3a6372e
added tests + corrections
JayPHP Apr 9, 2016
621c410
Removed note
JayPHP Apr 9, 2016
b8ab699
Removed whitespace
JayPHP Apr 9, 2016
36c7d1c
Added whitespace
JayPHP Apr 9, 2016
0aced1a
Corrected uppercase and formatting issues
JayPHP Apr 9, 2016
3913bc0
Fix CS errors.
ADmad Apr 10, 2016
a6f3ee8
Merge pull request #8622 from cakephp/request-transformer
lorenzo Apr 10, 2016
ac7a912
Add the ResponseTransformer
markstory Apr 10, 2016
13adf44
Fixed CS error
lorenzo Apr 10, 2016
a79ff82
Fixed another CS error
lorenzo Apr 10, 2016
7a59f20
Changed option name
Apr 11, 2016
c453418
Using pre-existing fixture + CS Fix
Apr 11, 2016
6fb1641
Added back tags fixture
Apr 11, 2016
be6c1f2
Merge pull request #8623 from cakephp/response-transformer
lorenzo Apr 12, 2016
7974693
Changed name to allow instead of permit
Apr 12, 2016
9ecb20a
Merge pull request #8609 from cakephp/less-welcome
markstory Apr 13, 2016
88138af
Merge pull request #8621 from JayPHP/checkNull_on_IsUnique
lorenzo Apr 13, 2016
7c68802
Merge pull request #8601 from Graziel/requirePresence_array
lorenzo Apr 13, 2016
71ac75f
Add standalone ControllerFactory.
markstory Apr 14, 2016
cce106b
Remove duplicate code.
markstory Apr 14, 2016
389415f
Fix failing tests.
markstory Apr 16, 2016
50dcf3b
Disallow controller names with / in them.
markstory Apr 16, 2016
553bd5d
Merge pull request #8643 from cakephp/controller-factory
lorenzo Apr 16, 2016
71623f5
Add ActionDispatcher to new Http lib
markstory Apr 16, 2016
5a90c3d
Add constructor injection for the eventManager.
markstory Apr 17, 2016
268de40
Integrate the new ActionDispatcher into Dispatcher
markstory Apr 17, 2016
366484c
Don't double bind dispatch filters.
markstory Apr 19, 2016
d65fd83
Fix error message.
markstory Apr 21, 2016
023cf73
Fix test for error message...
markstory Apr 21, 2016
cb642f3
Change date's default json encode format to valid ISO8601.
ADmad Apr 21, 2016
7c104a9
#8671 Improving Table::findOrCreate()
Apr 21, 2016
656adb7
#8687 Minor code improvements
Apr 21, 2016
99c05d9
Run travis job on php nightly to get newer ICU lib.
ADmad Apr 21, 2016
bef8694
Fix doc block tag.
markstory Apr 22, 2016
90ce428
Merge pull request #8667 from cakephp/action-dispatcher
markstory Apr 22, 2016
3c75006
Skip datetime string formatting test for old ICU.
ADmad Apr 22, 2016
91234f4
Add Server and BaseApplication.
markstory Apr 23, 2016
3d61835
Use already available INTL_ICU_VERSION constant.
ADmad Apr 23, 2016
87ba9c7
Merge pull request #8685 from cakephp/datetime-jsonencode
markstory Apr 23, 2016
9651600
Update comments based on peer feedback.
markstory Apr 25, 2016
4697b8e
Merge branch 'master' into 3.next
markstory Apr 25, 2016
8b36769
Removing the useless string callback from the findOrCreate
Apr 25, 2016
1130d27
Updating the doc block for findOrCreate
Apr 25, 2016
5d866f0
Move Http\Client into Http package.
markstory Apr 26, 2016
78be1ec
Make return value of Controller:referer() consistent when returning l…
ADmad Apr 19, 2016
85bd4ed
#8671 Adding documentation and another assert.
Apr 26, 2016
4e515b4
Remove un-necessary imports.
markstory Apr 27, 2016
bb1ed0f
Merge pull request #8710 from cakephp/controller-referrer
markstory Apr 27, 2016
c379ad2
Merge pull request #8696 from cakephp/psr-server
lorenzo Apr 27, 2016
fbf3de3
Add ErrorHandling Middleware
markstory Apr 28, 2016
65c36e5
Don't autoload aliased classes.
markstory Apr 29, 2016
50dabae
Instead of triggering a fatal error, modify the response.
markstory Apr 29, 2016
6cda83e
Revert "Don't autoload aliased classes."
markstory Apr 29, 2016
d618bfb
Merge pull request #8722 from cakephp/error-middleware
lorenzo Apr 29, 2016
3ed6b06
Merge branch 'master' into 3.next
lorenzo Apr 29, 2016
e80d765
Move backwards compatible shims.
markstory Apr 30, 2016
637b994
Implement a PSR7 routing middleware
markstory Apr 30, 2016
c8edd81
Load fixtures to fix failing tests.
markstory Apr 30, 2016
bdf965d
Fix PHPCS error.
markstory Apr 30, 2016
590d135
Making jsonSerialize be called recursively in entities
lorenzo Apr 30, 2016
74e70e6
Merge pull request #8709 from cakephp/psr7-client
lorenzo Apr 30, 2016
d553414
Move aliases to compatbility shims.
markstory Apr 30, 2016
aa1eb13
Merge pull request #8751 from cakephp/alias-stubs
lorenzo Apr 30, 2016
8553f1e
Fixed CS error
lorenzo Apr 30, 2016
c6c1888
Merge pull request #8745 from cakephp/routing-middleware
lorenzo Apr 30, 2016
6ba01e8
Merge branch 'master' into 3.next
ADmad Apr 30, 2016
4b9095c
Read schema defaults when generating field using EntityContext.
ADmad Apr 29, 2016
35af288
Fix issue when providing explicit default value for input.
ADmad Apr 29, 2016
e84a83d
Update signature of `ContextInterface::val()`
ADmad Apr 30, 2016
edbb319
Update signature of NullContext::val().
ADmad Apr 30, 2016
2c07444
Merge pull request #8707 from burzum/feature/find-or-create
lorenzo May 3, 2016
cc9271b
Merge pull request #8750 from cakephp/recursive-to-json
markstory May 4, 2016
fee6746
Add AssetMiddleware
markstory May 4, 2016
4de7bae
Move middleware into more relevant packages.
markstory May 4, 2016
fccfc6e
Add ability to define model factories statically
Marlinc Apr 26, 2016
ed4d394
Merge pull request #8713 from CVO-Technologies/model-factory-static
lorenzo May 4, 2016
f884130
Remove unused use statement from bootstrap
Marlinc May 4, 2016
c262b9b
Merge pull request #8771 from CVO-Technologies/model-factory-static
markstory May 4, 2016
1b0a9ce
Fix use ordering.
markstory May 4, 2016
b4e4f99
Merge pull request #8768 from cakephp/move-middleware
lorenzo May 5, 2016
d7e1ab3
Merge pull request #8767 from cakephp/asset-middleware
lorenzo May 5, 2016
9f31c70
Merge branch 'master' into 3.next
markstory May 6, 2016
18c3009
Add the LocaleSelectorMiddleware.
markstory May 6, 2016
1f50eec
Fix grammar and use an early return.
markstory May 6, 2016
a537e9c
Start deprecating duplicate methods and adding PSR7 traits.
markstory May 7, 2016
92081fa
Make header(), version() and method() play nice with PSR7
markstory May 7, 2016
2e97ed6
Make url() interoperable with PSR7
markstory May 7, 2016
76882b4
Fix wording.
markstory May 7, 2016
11e6529
Make body() interoperable with PSR7 methods.
markstory May 7, 2016
2e52015
Move body serialization into the Request.
markstory May 7, 2016
a495cb0
Get client tests passing.
markstory May 7, 2016
592daec
Update Oauth adapter to parse encoded body data.
markstory May 8, 2016
1bf62e0
Define the protocol property on the response.
markstory May 8, 2016
66b59c2
Fix PHPCS errors.
markstory May 8, 2016
334c40d
Fix parameter types in client\request.
markstory May 8, 2016
60a01c8
allowEmpty and notEmpty to take field as list
Graziel May 9, 2016
4178a46
some cs
Graziel May 9, 2016
fd64ba4
docBlock update
Graziel May 9, 2016
664201b
Merge pull request #8776 from cakephp/locale-filter
markstory May 10, 2016
9c92270
revert auto formatting
Graziel May 11, 2016
9e96ecc
doc block fix
Graziel May 11, 2016
27f52f2
another batch of revese changes
Graziel May 11, 2016
503a74f
Merge branch 'master' into 3.next
markstory May 11, 2016
6769a6c
Merge branch '3.next' into allowEmpty_notEmpty_array
Graziel May 11, 2016
76ec4e0
fix message
Graziel May 11, 2016
d9f362e
add messege test to allowEmpty when set as array
Graziel May 12, 2016
6189452
Merge pull request #8787 from cakephp/psr7-client-request
markstory May 12, 2016
86e64ba
Fix err() to highlight error as red similar to warn() which is yellow.
dereuromark May 12, 2016
4491622
Fix up tests.
dereuromark May 13, 2016
b7114a0
Fix up tests.
dereuromark May 13, 2016
456c6fc
Throw exception if marshaller encounter missing/invalid associations …
Antoniossss May 14, 2016
27c3a0d
Merge pull request #8811 from cakephp/fix-err-console
markstory May 14, 2016
7727e20
Code refactoring due to comments @ https://github.com/cakephp/cakephp…
Antoniossss May 15, 2016
3943052
Merge branch 'master' into 3.next
markstory May 16, 2016
010f727
Remove duplicate code.
markstory May 16, 2016
3f58c7d
Start making Http\Client\Response PSR7 compatible.
markstory May 12, 2016
aa90dce
Add getEncoding()
markstory May 12, 2016
fec9e58
Add new psr7-like methods for reading cookie data.
markstory May 14, 2016
62a3a29
Refactor to use new methods.
markstory May 14, 2016
e3ce83f
Use PSR7 interface methods in doc blocks.
markstory May 14, 2016
609224e
Fix PHPCS errors.
markstory May 14, 2016
602704f
Fail with a slightly more helpful error messages.
markstory May 14, 2016
17fb598
Previously added assertion was wrong...
markstory May 16, 2016
fc6cddc
Merge pull request #8822 from cakephp/psr7-client-response
lorenzo May 16, 2016
ae3d4a9
Fix PHPCS build.
markstory May 16, 2016
c03a217
Give Http\Client\Request a more useful constructor.
markstory May 17, 2016
38d3cc5
Start using PSR7 interfaces more internally.
markstory May 17, 2016
01f016a
Use PSR7 interfaces internally in auth plugins.
markstory May 17, 2016
e869e26
Merge pull request #8824 from Antoniossss/issue-8808
markstory May 18, 2016
e47c09b
Fix formatting and spacing.
markstory May 18, 2016
a219020
Fix PHPCS errors.
markstory May 19, 2016
43e8926
Merge pull request #8800 from Graziel/allowEmpty_notEmpty_array
markstory May 19, 2016
5a4a786
Formatting and doc block improvements.
markstory May 19, 2016
253e0b6
Merge pull request #8837 from cakephp/psr7-client-internals
lorenzo May 19, 2016
3027fc1
Add a branch alias for 3.next to installation easier.
markstory May 21, 2016
1b40a06
Merge pull request #8868 from cakephp/3.3-branch-alias
markstory May 22, 2016
208a355
Merge branch 'master' into 3.next
markstory May 22, 2016
e97a125
Merge branch '3.next' of github.com:cakephp/cakephp into 3.next
markstory May 22, 2016
4ce2da2
add caches shell
May 26, 2016
a71cc74
Merge branch 'master' into 3.next
markstory May 27, 2016
86e24ef
Fix failing tests in IsUnique rule.
markstory May 27, 2016
05fa655
Use Query methods instead of digging into internals.
markstory May 27, 2016
c6a93d9
Fix issue with identifier quoting.
markstory May 27, 2016
d1a0ff1
Fix more failures around identifier quoting.
markstory May 27, 2016
08bb082
Remove branch aliases.
markstory May 27, 2016
6d8d7a7
rename CachesShell to CacheShell
May 27, 2016
087c614
Add warnings if cache engine is ApcEngine or WincacheEngine
May 27, 2016
602e0f9
fix typo in description
May 27, 2016
a60e844
convert FQCNs to use statements
May 27, 2016
933f814
Merge pull request #8900 from chris48s/7368-cache-shell
markstory May 28, 2016
57e7877
Fix typo in documentation.
markstory May 29, 2016
b5e77bf
Merge remote-tracking branch 'origin/master' into 3.next
lorenzo May 29, 2016
cb65936
Using same trick as fbefore in the hope on pleasing travis' gods
lorenzo May 29, 2016
9b32402
No more code coverage, it's got problems
lorenzo May 29, 2016
14f9199
Remove $options argument from ContextInterface::val() to maintain BC.
ADmad May 29, 2016
2cb3803
Making test more resilient for SQL Server
lorenzo May 29, 2016
6aa63ba
Removing unused line in travis.yaml
lorenzo May 29, 2016
2c7fa4a
Seems like SQL Server is missing the ids for a fixture without autoin…
lorenzo May 29, 2016
f7251c2
Another try at fixing SQL Server
lorenzo May 29, 2016
12936a4
Another try at fixing SQL Server
lorenzo May 29, 2016
50f90ba
Pretty please?
lorenzo May 29, 2016
665254c
One last try for the day
lorenzo May 29, 2016
ec65adc
Skipping a test temporarilly
lorenzo May 29, 2016
5b5a383
Fixed dumb mistake
lorenzo May 29, 2016
f9e013e
Ensure the app is always last in the middleware stack.
markstory May 30, 2016
d13a550
Save a few function calls.
markstory May 30, 2016
e02b884
Make allowMultipleNulls a constructor argument.
markstory May 30, 2016
a65a4f5
Merge pull request #8904 from cakephp/fix-travis-all-the-way
lorenzo May 30, 2016
3b8e5a0
Fix PHPCS / docs errors.
markstory Jun 1, 2016
33bbf84
Raise an exception in insertBefore()
markstory Jun 1, 2016
2b3b365
Merge pull request #8735 from cakephp/3.3-context-schema-default
markstory Jun 1, 2016
c849f80
Fix typo.
markstory Jun 2, 2016
be0dcc0
Merge pull request #8920 from cakephp/insert-before-exception
lorenzo Jun 2, 2016
d7c52d5
Merge pull request #8913 from cakephp/app-last
markstory Jun 3, 2016
051560c
Merge branch 'master' into 3.next
markstory Jun 4, 2016
82393d1
Merge pull request #8914 from cakephp/is-unique-options
markstory Jun 5, 2016
6c0844f
Merge branch 'master' into 3.next
markstory Jun 9, 2016
138f50f
Merge branch 'master' into 3.next
ADmad Jun 12, 2016
9f0820d
Start sketching out the PSR7 IntegrationTest work.
markstory Jun 13, 2016
0ef9d47
Rough out Middleware Dispatcher
markstory Jun 14, 2016
43f8ed3
Make IntegrationTestCase::_buildRequest return an array.
markstory Jun 15, 2016
d086c6f
Small fixes.
dereuromark Jun 15, 2016
d43864b
Remove unused import.
markstory Jun 16, 2016
618457e
Fix PHPUnit getMock warnings in 3.next.
markstory Jun 16, 2016
9114949
Add Collection::transpose method (#8957)
dilab Jun 17, 2016
2f4f433
Clean up Collection::transpose().
markstory Jun 17, 2016
fc6cfe8
Update PSR7 integration tests based on feedback.
markstory Jun 17, 2016
632a525
Merge pull request #9000 from cakephp/phpunit-warnings
antograssiot Jun 17, 2016
f7fb9b7
Make stream error handling method public to handle errors in custom s…
Marlinc Jun 18, 2016
da39cd3
Allow PSR7 requests to store the session as an attribute.
markstory Jun 18, 2016
61ef064
Add session support for PSR7 requests.
markstory Jun 18, 2016
3af2377
Remove TODOs
markstory Jun 18, 2016
93a8836
Allow request bodies to be transformed.
markstory Jun 18, 2016
a8567c5
Add integration tests for PSR7 + request bodies.
markstory Jun 18, 2016
745aefc
Don't call getSize()
markstory Jun 19, 2016
3eb2982
Merge pull request #8992 from cakephp/psr7-integration-test
lorenzo Jun 19, 2016
a3ef37d
Merge branch 'master' into 3.next
markstory Jun 21, 2016
bd4dc9a
Merge branch '3.next' of github.com:cakephp/cakephp into 3.next
markstory Jun 21, 2016
b2f1c72
Convert cookies from CakePHP responses to PSR7 ones.
markstory Jun 22, 2016
6a72463
Add cookie parsing to convert from psr7 to cakephp.
markstory Jun 22, 2016
cadeb64
Add integration test for cookies + psr7
markstory Jun 22, 2016
38c903b
Merge pull request #9019 from cakephp/integration-test-cases
lorenzo Jun 22, 2016
db36ed0
Basic Idea
Jun 22, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ env:
services:
- memcached
- redis-server
- postgresql

addons:
postgresql: "9.4"

cache:
directories:
Expand Down Expand Up @@ -76,8 +80,5 @@ script:

- if [[ $PHPCS = 1 ]]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi

after_success:
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.* ]]; then bash <(curl -s https://codecov.io/bash); fi

notifications:
email: false
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
// @license http://www.opensource.org/licenses/mit-license.php MIT License
// +--------------------------------------------------------------------------------------------+ //
////////////////////////////////////////////////////////////////////////////////////////////////////
3.2.11
3.3.0-dev
8 changes: 5 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@
"ext-mbstring": "*",
"cakephp/chronos": "*",
"aura/intl": "1.1.*",
"psr/log": "1.0"
"psr/log": "1.0",
"zendframework/zend-diactoros": "~1.0"
},
"suggest": {
"ext-openssl": "To use Security::encrypt() or have secure CSRF token generation."
"ext-openssl": "To use Security::encrypt() or have secure CSRF token generation."
},
"require-dev": {
"phpunit/phpunit": "*",
Expand All @@ -46,11 +47,12 @@
"autoload-dev": {
"psr-4": {
"Cake\\Test\\": "tests",
"Company\\TestPluginThree\\Test\\": "tests/test_app/Plugin/Company/TestPluginThree/tests",
"TestApp\\": "tests/test_app/TestApp",
"TestPlugin\\": "tests/test_app/Plugin/TestPlugin/src",
"TestPlugin\\Test\\": "tests/test_app/Plugin/TestPlugin/tests",
"TestPluginTwo\\": "tests/test_app/Plugin/TestPluginTwo/src",
"Company\\TestPluginThree\\": "tests/test_app/Plugin/Company/TestPluginThree/src",
"Company\\TestPluginThree\\Test\\": "tests/test_app/Plugin/Company/TestPluginThree/tests",
"PluginJs\\": "tests/test_app/Plugin/PluginJs/src"
}
},
Expand Down
12 changes: 0 additions & 12 deletions config/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,6 @@

define('TIME_START', microtime(true));

// @deprecated Backward compatibility with 2.x series
if (PHP_VERSION_ID < 70000) {
class_alias('Cake\Utility\Text', 'Cake\Utility\String');
}

// @deprecated Backward compatibility with 2.x, 3.0.x
class_alias('Cake\Mailer\AbstractTransport', 'Cake\Network\Email\AbstractTransport');
class_alias('Cake\Mailer\Transport\DebugTransport', 'Cake\Network\Email\DebugTransport');
class_alias('Cake\Mailer\Email', 'Cake\Network\Email\Email');
class_alias('Cake\Mailer\Transport\MailTransport', 'Cake\Network\Email\MailTransport');
class_alias('Cake\Mailer\Transport\SmtpTransport', 'Cake\Network\Email\SmtpTransport');

require CAKE . 'basics.php';

// Sets the initial router state so future reloads work.
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/BaseAuthorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function __construct(ComponentRegistry $registry, array $config = [])
/**
* Checks user authorization.
*
* @param array $user Active user data
* @param array|\ArrayAccess $user Active user data
* @param \Cake\Network\Request $request Request instance.
* @return bool
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/ControllerAuthorize.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function controller(Controller $controller = null)
/**
* Checks user authorization using a controller callback.
*
* @param array $user Active user data
* @param array|\ArrayAccess $user Active user data
* @param \Cake\Network\Request $request Request instance.
* @return bool
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Auth/Storage/MemoryStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function read()
/**
* {@inheritDoc}
*/
public function write(array $user)
public function write($user)
{
$this->_user = $user;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Auth/Storage/SessionStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ public function read()
*
* The session id is also renewed to help mitigate issues with session replays.
*
* @param array $user User record.
* @param array|\ArrayAccess $user User record.
* @return void
*/
public function write(array $user)
public function write($user)
{
$this->_user = $user;

Expand Down
4 changes: 2 additions & 2 deletions src/Auth/Storage/StorageInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public function read();
/**
* Write user record.
*
* @param array $user User record.
* @param array|\ArrayAccess $user User record.
* @return void
*/
public function write(array $user);
public function write($user);

/**
* Delete user record.
Expand Down
28 changes: 28 additions & 0 deletions src/Collection/CollectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -945,4 +945,32 @@ public function isEmpty();
* @return \Iterator
*/
public function unwrap();

/**
* Transpose rows and columns into columns and rows
*
* ### Example:
*
* ```
* $items = [
* ['Products', '2012', '2013', '2014'],
* ['Product A', '200', '100', '50'],
* ['Product B', '300', '200', '100'],
* ['Product C', '400', '300', '200'],
* ]
*
* $transpose = (new Collection($items))->transpose()->toList();
*
* // Returns
* // [
* // ['Products', 'Product A', 'Product B', 'Product C'],
* // ['2012', '200', '300', '400'],
* // ['2013', '100', '200', '300'],
* // ['2014', '50', '100', '200'],
* // ]
* ```
*
* @return \Cake\Collection\CollectionInterface
*/
public function transpose();
}
20 changes: 20 additions & 0 deletions src/Collection/CollectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use Cake\Collection\Iterator\ZipIterator;
use Countable;
use LimitIterator;
use LogicException;
use RecursiveIteratorIterator;
use Traversable;

Expand Down Expand Up @@ -658,4 +659,23 @@ public function _unwrap()
{
return $this->unwrap();
}

/**
* {@inheritDoc}
*
* @return \Cake\Collection\CollectionInterface
*/
public function transpose()
{
$arrayValue = $this->toList();
$length = count(current($arrayValue));
$result = [];
foreach ($arrayValue as $column => $row) {
if (count($row) != $length) {
throw new LogicException('Child arrays do not have even length');
}
$result[] = array_column($arrayValue, $column);
}
return new Collection($result);
}
}
8 changes: 4 additions & 4 deletions src/Console/Shell.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public function runCommand($argv, $autoMethod = false, $extra = [])
if ($this->hasTask($command) && isset($subcommands[$command])) {
$this->startup();
array_shift($argv);
return $this->{$method}->runCommand($argv, false);
return $this->{$method}->runCommand($argv, false, ['requested' => true]);
}

if ($this->hasMethod('main')) {
Expand Down Expand Up @@ -640,11 +640,11 @@ public function out($message = null, $newlines = 1, $level = Shell::NORMAL)
*
* @param string|array|null $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @return void
* @return int|bool Returns the number of bytes returned from writing to stderr.
*/
public function err($message = null, $newlines = 1)
{
$this->_io->err($message, $newlines);
return $this->_io->err('<error>' . $message . '</error>', $newlines);
}

/**
Expand All @@ -671,7 +671,7 @@ public function info($message = null, $newlines = 1, $level = Shell::NORMAL)
*/
public function warn($message = null, $newlines = 1)
{
return $this->err('<warning>' . $message . '</warning>', $newlines);
return $this->_io->err('<warning>' . $message . '</warning>', $newlines);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/Controller/Component/AuthComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ protected function _setDefaults()
* Each adapter will be checked in sequence, if any of them return true, then the user will
* be authorized for the request.
*
* @param array|null $user The user to check the authorization of.
* @param array|\ArrayAccess|null $user The user to check the authorization of.
* If empty the user fetched from storage will be used.
* @param \Cake\Network\Request|null $request The request to authenticate for.
* If empty, the current request will be used.
Expand Down Expand Up @@ -622,11 +622,11 @@ public function deny($actions = null)
* The storage class is configured using `storage` config key or passing
* instance to AuthComponent::storage().
*
* @param array $user Array of user data.
* @param array|\ArrayAccess $user User data.
* @return void
* @link http://book.cakephp.org/3.0/en/controllers/components/authentication.html#identifying-users-and-logging-them-in
*/
public function setUser(array $user)
public function setUser($user)
{
$this->storage()->write($user);
}
Expand Down Expand Up @@ -767,7 +767,7 @@ public function identify()
}
foreach ($this->_authenticateObjects as $auth) {
$result = $auth->authenticate($this->request, $this->response);
if (!empty($result) && is_array($result)) {
if (!empty($result)) {
$this->_authenticationProvider = $auth;
$event = $this->dispatchEvent('Auth.afterIdentify', [$result, $auth]);
if ($event->result !== null) {
Expand Down
13 changes: 12 additions & 1 deletion src/Controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,18 @@ public function referer($default = null, $local = false)

$referer = $this->request->referer($local);
if ($referer === '/' && $default && $default !== $referer) {
return Router::url($default, !$local);
$url = Router::url($default, !$local);
if ($local
&& $this->request->base
&& strpos($url, $this->request->base) === 0
) {
$url = substr($url, strlen($this->request->base));
if ($url[0] !== '/') {
$url = '/' . $url;
}
return $url;
}
return $url;
}
return $referer;
}
Expand Down
16 changes: 11 additions & 5 deletions src/Core/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,19 +126,22 @@ function namespaceSplit($class)
* In terminals this will act similar to using print_r() directly, when not run on cli
* print_r() will also wrap <pre> tags around the output of given variable. Similar to debug().
*
* This function returns the same variable that was passed.
*
* @param mixed $var Variable to print out.
* @return void
* @see debug()
* @return mixed the same $var that was passed to this function
* @link http://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#pr
* @see debug()
*/
function pr($var)
{
if (!Configure::read('debug')) {
return;
return $var;
}

$template = (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') ? '<pre class="pr">%s</pre>' : "\n%s\n\n";
printf($template, trim(print_r($var, true)));
return $var;
}

}
Expand All @@ -150,19 +153,22 @@ function pr($var)
* In terminals this will act similar to using json_encode() with JSON_PRETTY_PRINT directly, when not run on cli
* will also wrap <pre> tags around the output of given variable. Similar to pr().
*
* This function returns the same variable that was passed.
*
* @param mixed $var Variable to print out.
* @return void
* @return mixed the same $var that was passed to this function
* @see pr()
* @link http://book.cakephp.org/3.0/en/core-libraries/global-constants-and-functions.html#pj
*/
function pj($var)
{
if (!Configure::read('debug')) {
return;
return $var;
}

$template = (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') ? '<pre class="pj">%s</pre>' : "\n%s\n\n";
printf($template, trim(json_encode($var, JSON_PRETTY_PRINT)));
return $var;
}

}
Expand Down
42 changes: 40 additions & 2 deletions src/Database/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,11 +548,12 @@ public function supportsDynamicConstraints()
* ```
* $connection->transactional(function ($connection) {
* $connection->newQuery()->delete('users')->execute();
* });
* }, Connection::SERIALIZABLE);
* ```
*/
public function transactional(callable $callback)
public function transactional(callable $callback, $isolationLevel = null)
{
$this->isolationLevel($isolationLevel);
$this->begin();

try {
Expand Down Expand Up @@ -695,6 +696,38 @@ public function log($sql)
$this->logger()->log($query);
}

/**
* Check if cross talk is supported between two connections
*
* @param ConnectionInterface $target Connection to check cross talk with
*
* @return bool
*/
public function supportsCrossWith(ConnectionInterface $target)
{
$sourceConfig = $this->config();
$targetConfig = $target->config();

// No need to do report cross support in case the same connection is being used
if ($sourceConfig['name'] === $targetConfig['name']) {
return false;
}

$configToCheck = [
'driver',
'host',
'port'
];

foreach ($configToCheck as $config) {
if ((isset($sourceConfig[$config])) && ($sourceConfig[$config] !== $targetConfig[$config])) {
return false;
}
}

return true;
}

/**
* Returns a new statement object that will log the activity
* for the passed original statement instance.
Expand Down Expand Up @@ -737,4 +770,9 @@ public function __debugInfo()
'logger' => $this->_logger
];
}

private function isolationLevel($isolationLevel = null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Private method name "Connection::isolationLevel" in CakePHP core is discouraged
Missing function doc comment

{
return $this->_driver->transactionIsolationLevel($isolationLevel);
}
}
Loading