Merge branch 'master' into 2.4

This commit is contained in:
mark_story 2013-06-29 23:26:26 -04:00
commit f09693f6e8
22 changed files with 147 additions and 30 deletions

View file

@ -68,6 +68,6 @@ for the sniff and phpcs.
* [CakePHP coding standards](http://book.cakephp.org/2.0/en/contributing/cakephp-coding-conventions.html)
* [Bug tracker](https://cakephp.lighthouseapp.com/projects/42648-cakephp)
* [General GitHub documentation](http://help.github.com/)
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
* [General GitHub documentation](https://help.github.com/)
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
* #cakephp IRC channel on freenode.org

View file

@ -26,13 +26,13 @@ Some Handy Links
Get Support!
------------
[Our Google Group](http://groups.google.com/group/cake-php) - community mailing list and forum
[Our Google Group](https://groups.google.com/group/cake-php) - community mailing list and forum
[#cakephp](http://webchat.freenode.net/?channels=#cakephp) on irc.freenode.net - Come chat with us, we have cake.
[Q & A](http://ask.cakephp.org/) - Ask questions here, all questions welcome
[Lighthouse](http://cakephp.lighthouseapp.com/) - Got issues? Please tell us!
[Lighthouse](https://cakephp.lighthouseapp.com/) - Got issues? Please tell us!
[![Bake Status](https://secure.travis-ci.org/cakephp/cakephp.png?branch=2.4)](http://travis-ci.org/cakephp/cakephp)

View file

@ -216,12 +216,12 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
<ul><li><?php echo __d('cake_dev', 'Everything CakePHP'); ?></li></ul></li>
<li><a href="http://plugins.cakephp.org"><?php echo __d('cake_dev', 'CakePHP plugins repo'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'A comprehensive list of all CakePHP plugins created by the community'); ?></li></ul></li>
<li><a href="http://groups.google.com/group/cake-php"><?php echo __d('cake_dev', 'CakePHP Google Group'); ?> </a>
<li><a href="https://groups.google.com/group/cake-php"><?php echo __d('cake_dev', 'CakePHP Google Group'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'Community mailing list'); ?></li></ul></li>
<li><a href="irc://irc.freenode.net/cakephp">irc.freenode.net #cakephp</a>
<ul><li><?php echo __d('cake_dev', 'Live chat about CakePHP'); ?></li></ul></li>
<li><a href="http://github.com/cakephp/"><?php echo __d('cake_dev', 'CakePHP Code'); ?> </a>
<li><a href="https://github.com/cakephp/"><?php echo __d('cake_dev', 'CakePHP Code'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'For the Development of CakePHP Git repository, Downloads'); ?></li></ul></li>
<li><a href="http://cakephp.lighthouseapp.com/"><?php echo __d('cake_dev', 'CakePHP Lighthouse'); ?> </a>
<li><a href="https://cakephp.lighthouseapp.com/"><?php echo __d('cake_dev', 'CakePHP Lighthouse'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'CakePHP Tickets, Wiki pages, Roadmap'); ?></li></ul></li>
</ul>

View file

@ -133,7 +133,7 @@
<license>MIT License</license>
<version release="${pear.version}" api="${pear.version}" />
<stability release="${pear.stability}" api="${pear.stability}" />
<notes>http://github.com/cakephp/cakephp/blob/master/README</notes>
<notes>https://github.com/cakephp/cakephp/blob/master/README</notes>
<dependencies>
<php minimum_version="5.2.8" />
<pear minimum_version="1.9.0" recommended_version="1.9.4" />
@ -164,6 +164,17 @@
<move file="${build.dir}/${pear.package}/${pear.package}.tgz" todir="${dist.dir}" />
</target>
<!--
Updates the local copy to the latest head.
-->
<target name="update-branch">
<echo msg="Updating to latest master." />
<exec executable="git pull">
<arg value="${git.remote}" />
<arg value="master" />
</exec>
</target>
<!--
Bump the version number and commit that.
-->
@ -182,7 +193,7 @@
<!--
Create the release commit that updates the version number and pushes the commits.
-->
<target name="release-commit" depends="next-version,prepare">
<target name="release-commit" depends="update-branch,next-version,prepare">
<echo msg="Creating new release commit" />
<exec command="git add ./lib/Cake/VERSION.txt" logoutput="true" checkreturn="true" />
<exec command="git commit -m 'Update version number to ${release_version}'" logoutput="true" checkreturn="true" />

View file

@ -208,12 +208,12 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
<ul><li><?php echo __d('cake_dev', 'Everything CakePHP'); ?></li></ul></li>
<li><a href="http://plugins.cakephp.org"><?php echo __d('cake_dev', 'CakePHP plugins repo'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'A comprehensive list of all CakePHP plugins created by the community'); ?></li></ul></li>
<li><a href="http://groups.google.com/group/cake-php"><?php echo __d('cake_dev', 'CakePHP Google Group'); ?> </a>
<li><a href="https://groups.google.com/group/cake-php"><?php echo __d('cake_dev', 'CakePHP Google Group'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'Community mailing list'); ?></li></ul></li>
<li><a href="irc://irc.freenode.net/cakephp">irc.freenode.net #cakephp</a>
<ul><li><?php echo __d('cake_dev', 'Live chat about CakePHP'); ?></li></ul></li>
<li><a href="http://github.com/cakephp/"><?php echo __d('cake_dev', 'CakePHP Code'); ?> </a>
<li><a href="https://github.com/cakephp/"><?php echo __d('cake_dev', 'CakePHP Code'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'For the Development of CakePHP Git repository, Downloads'); ?></li></ul></li>
<li><a href="http://cakephp.lighthouseapp.com/"><?php echo __d('cake_dev', 'CakePHP Lighthouse'); ?> </a>
<li><a href="https://cakephp.lighthouseapp.com/"><?php echo __d('cake_dev', 'CakePHP Lighthouse'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'CakePHP Tickets, Wiki pages, Roadmap'); ?></li></ul></li>
</ul>

View file

@ -707,8 +707,8 @@ class AuthComponent extends Component {
* If no parameter is passed, gets the authentication redirect URL. The URL
* returned is as per following rules:
*
* - Returns the session Auth.redirect value if it is present and for the same
* domain the current app is running on.
* - Returns the normalized URL from session Auth.redirect value if it is
* present and for the same domain the current app is running on.
* - If there is no session value and there is a $loginRedirect, the $loginRedirect
* value is returned.
* - If there is no session and no $loginRedirect, / is returned.
@ -722,6 +722,7 @@ class AuthComponent extends Component {
$this->Session->write('Auth.redirect', $redir);
} elseif ($this->Session->check('Auth.redirect')) {
$redir = $this->Session->read('Auth.redirect');
$redir = is_string($redir) ? ltrim($redir, '/') : $redir;
$this->Session->delete('Auth.redirect');
if (Router::normalize($redir) == Router::normalize($this->loginAction)) {

View file

@ -21,6 +21,9 @@
/**
* DataSource base class
*
* DataSources are the link between models and the source of data that models represent.
*
* @link http://book.cakephp.org/2.0/en/models/datasources.html#basic-api-for-datasources
* @package Cake.Model.Datasource
*/
class DataSource extends Object {

View file

@ -280,7 +280,7 @@ class DboSource extends DataSource {
/**
* Disconnects from database.
*
* @return boolean True if the database could be disconnected, else false
* @return boolean Always true
*/
public function disconnect() {
if ($this->_result instanceof PDOStatement) {

View file

@ -1288,6 +1288,23 @@ class AuthComponentTest extends CakeTestCase {
$this->assertFalse($this->Auth->Session->check('Auth.redirect'));
}
/**
* test redirectUrl with duplicate base.
*
* @return void
*/
public function testRedirectSessionReadDuplicateBase() {
$this->Auth->request->webroot = '/waves/';
$this->Auth->request->base = '/waves';
Router::setRequestInfo($this->Auth->request);
$this->Auth->Session->write('Auth.redirect', '/waves/add');
$result = $this->Auth->redirectUrl();
$this->assertEquals('/waves/add', $result);
}
/**
* test that redirect does not return loginAction if that is what's stored in Auth.redirect.
* instead loginRedirect should be used.

View file

@ -822,7 +822,7 @@ class RequestHandlerComponentTest extends CakeTestCase {
* array URLs into their correct string ones, and adds base => false so
* the correct URLs are generated.
*
* @link http://cakephp.lighthouseapp.com/projects/42648-cakephp-1x/tickets/276
* @link https://cakephp.lighthouseapp.com/projects/42648-cakephp-1x/tickets/276
* @return void
*/
public function testBeforeRedirectCallbackWithArrayUrl() {

View file

@ -1092,7 +1092,7 @@ class SecurityComponentTest extends CakeTestCase {
* the params.
*
* @return void
* @see http://cakephp.lighthouseapp.com/projects/42648/tickets/68
* @see https://cakephp.lighthouseapp.com/projects/42648/tickets/68
*/
public function testSettingTokenForRequestAction() {
$this->Controller->Security->startup($this->Controller);
@ -1109,7 +1109,7 @@ class SecurityComponentTest extends CakeTestCase {
* test that blackhole doesn't delete the _Token session key so repeat data submissions
* stay blackholed.
*
* @link http://cakephp.lighthouseapp.com/projects/42648/tickets/214
* @link https://cakephp.lighthouseapp.com/projects/42648/tickets/214
* @return void
*/
public function testBlackHoleNotDeletingSessionInformation() {

View file

@ -597,7 +597,7 @@ class AppTest extends CakeTestCase {
* test that building helper paths actually works.
*
* @return void
* @link http://cakephp.lighthouseapp.com/projects/42648/tickets/410
* @link https://cakephp.lighthouseapp.com/projects/42648/tickets/410
*/
public function testImportingHelpersFromAlternatePaths() {
$this->assertFalse(class_exists('BananaHelper', false), 'BananaHelper exists, cannot test importing it.');

View file

@ -569,7 +569,7 @@ class DboSourceTest extends CakeTestCase {
}
/**
* testReconnect method
* Tests if the connection can be re-established and that the new (optional) config is set.
*
* @return void
*/

View file

@ -4824,7 +4824,7 @@ class ModelWriteTest extends BaseModelTest {
/**
* test that saveAll behaves like plain save() when supplied empty data
*
* @link http://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data
* @link https://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data
* @return void
*/
public function testSaveAllEmptyData() {
@ -6212,7 +6212,7 @@ class ModelWriteTest extends BaseModelTest {
/**
* test that saveMany behaves like plain save() when suplied empty data
*
* @link http://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data
* @link https://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data
* @return void
*/
public function testSaveManyEmptyData() {
@ -6231,7 +6231,7 @@ class ModelWriteTest extends BaseModelTest {
/**
* test that saveAssociated behaves like plain save() when supplied empty data
*
* @link http://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data
* @link https://cakephp.lighthouseapp.com/projects/42648/tickets/277-test-saveall-with-validation-returns-incorrect-boolean-when-saving-empty-data
* @return void
*/
public function testSaveAssociatedEmptyData() {

View file

@ -700,6 +700,25 @@ class CakeRequestTest extends CakeTestCase {
$this->assertSame($result, 'cakephp.org');
}
/**
* Test referer() with a base path that duplicates the
* first segment.
*
* @return void
*/
public function testRefererBasePath() {
$request = new CakeRequest('some/path');
$request->url = 'users/login';
$request->webroot = '/waves/';
$request->base = '/waves';
$request->here = '/waves/users/login';
$_SERVER['HTTP_REFERER'] = FULL_BASE_URL . '/waves/waves/add';
$result = $request->referer(true);
$this->assertSame($result, '/waves/add');
}
/**
* test the simple uses of is()
*

View file

@ -536,7 +536,7 @@ class ControllerTestCaseTest extends CakeTestCase {
* will always have a fresh reference to those object available
*
* @return void
* @see http://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/2705-requesthandler-weird-behavior
* @see https://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/2705-requesthandler-weird-behavior
*/
public function testComponentsSameRequestAndResponse() {
$this->Case->generate('TestsApps');

View file

@ -6674,6 +6674,70 @@ class FormHelperTest extends CakeTestCase {
$this->assertEquals($result, $expected);
}
/**
* testInputDate method
*
* Test various inputs with type date and different dateFormat values.
* Failing to provide a dateFormat key should not error.
* It should simply not pre-select any value then.
*
* @return void
*/
public function testInputDate() {
$this->Form->request->data = array(
'User' => array(
'month_year' => array('month' => date('m')),
'just_year' => array('month' => date('m')),
'just_month' => array('year' => date('Y')),
'just_day' => array('month' => date('m')),
)
);
$this->Form->create('User');
$result = $this->Form->input('month_year',
array(
'label' => false,
'div' => false,
'type' => 'date',
'dateFormat' => 'MY',
'minYear' => 2006,
'maxYear' => 2008
)
);
$this->assertContains('value="' . date('m') . '" selected="selected"', $result);
$this->assertNotContains('value="2008" selected="selected"', $result);
$result = $this->Form->input('just_year',
array(
'type' => 'date',
'label' => false,
'dateFormat' => 'Y',
'minYear' => date('Y'),
'maxYear' => date('Y', strtotime('+20 years'))
)
);
$this->assertNotContains('value="' . date('Y') . '" selected="selected"', $result);
$result = $this->Form->input('just_month',
array(
'type' => 'date',
'label' => false,
'dateFormat' => 'M',
'empty' => false,
)
);
$this->assertNotContains('value="' . date('m') . '" selected="selected"', $result);
$result = $this->Form->input('just_day',
array(
'type' => 'date',
'label' => false,
'dateFormat' => 'D',
'empty' => false,
)
);
$this->assertNotContains('value="' . date('d') . '" selected="selected"', $result);
}
/**
* testInputDateMaxYear method
*

View file

@ -134,9 +134,9 @@ You can also add some CSS styles for your pages at: APP/webroot/css.');
<ul><li><?php echo __d('cake_dev', 'Community mailing list'); ?></li></ul></li>
<li><a href="irc://irc.freenode.net/cakephp">irc.freenode.net #cakephp</a>
<ul><li><?php echo __d('cake_dev', 'Live chat about CakePHP'); ?></li></ul></li>
<li><a href="http://github.com/cakephp/"><?php echo __d('cake_dev', 'CakePHP Code'); ?> </a>
<li><a href="https://github.com/cakephp/"><?php echo __d('cake_dev', 'CakePHP Code'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'For the Development of CakePHP Git repository, Downloads'); ?></li></ul></li>
<li><a href="http://cakephp.lighthouseapp.com/"><?php echo __d('cake_dev', 'CakePHP Lighthouse'); ?> </a>
<li><a href="https://cakephp.lighthouseapp.com/"><?php echo __d('cake_dev', 'CakePHP Lighthouse'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'CakePHP Tickets, Wiki pages, Roadmap'); ?></li></ul></li>
<li><a href="http://www.cakeforge.org"><?php echo __d('cake_dev', 'CakeForge'); ?> </a>
<ul><li><?php echo __d('cake_dev', 'Open Development for CakePHP'); ?></li></ul></li>

View file

@ -31,7 +31,7 @@
</ul>
<p>Once PHPUnit is installed make sure its located on PHP's <code>include_path</code> by checking your php.ini</p>
<p>For full instructions on how to <a href="http://www.phpunit.de/manual/current/en/installation.html" target="_blank">install PHPUnit, see the PHPUnit installation guide</a>.</p>
<p><a href="http://github.com/sebastianbergmann/phpunit" target="_blank">Download PHPUnit</a></p>
<p><a href="https://github.com/sebastianbergmann/phpunit" target="_blank">Download PHPUnit</a></p>
</div>
<?php
include dirname(__FILE__) . DS . 'footer.php';

View file

@ -2122,6 +2122,7 @@ class FormHelper extends AppHelper {
$attributes += array('empty' => true, 'value' => null);
if ((empty($attributes['value']) || $attributes['value'] === true) && $value = $this->value($fieldName)) {
if (is_array($value)) {
$year = null;
extract($value);
$attributes['value'] = $year;
} else {
@ -2313,6 +2314,7 @@ class FormHelper extends AppHelper {
$attributes += array('empty' => true, 'value' => null);
if ((empty($attributes['value']) || $attributes['value'] === true) && $value = $this->value($fieldName)) {
if (is_array($value)) {
$meridian = null;
extract($value);
$attributes['value'] = $meridian;
} else {

View file

@ -20,14 +20,14 @@
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
App::uses('ThemeView', 'View');
App::uses('View', 'View');
/**
* ScaffoldView provides specific view file loading features for scaffolded views.
*
* @package Cake.View
*/
class ScaffoldView extends ThemeView {
class ScaffoldView extends View {
/**
* Override _getViewFileName Appends special scaffolding views in.

View file

@ -56,7 +56,7 @@ foreach ($scaffoldFields as $_field) {
echo " </li>\n";
echo "\t\t<li>";
echo $this->Form->postLink(__d('cake', 'Delete %s', $singularHumanName), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __d('cake', 'Are you sure you want to delete').' #' . ${$singularVar}[$modelClass][$primaryKey] . '?');
echo $this->Form->postLink(__d('cake', 'Delete %s', $singularHumanName), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __d('cake', 'Are you sure you want to delete # %s?', ${$singularVar}[$modelClass][$primaryKey]));
echo " </li>\n";
echo "\t\t<li>";