Merge branch 'master' into 2.4

Conflicts:
	lib/Cake/VERSION.txt
This commit is contained in:
ADmad 2013-04-25 03:06:04 +05:30
commit 19f8274a95
13 changed files with 49 additions and 22 deletions

View file

@ -206,7 +206,7 @@
/**
* Apply timestamps with the last modified time to static assets (js, css, images).
* Will append a querystring parameter containing the time the file was modified. This is
* Will append a query string parameter containing the time the file was modified. This is
* useful for invalidating browser caches.
*
* Set to `true` to apply timestamps when debug > 0. Set to 'force' to always enable
@ -232,7 +232,7 @@
//Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
/**
* The classname and database used in CakePHP's
* The class name and database used in CakePHP's
* access control lists.
*/
Configure::write('Acl.classname', 'DbAcl');
@ -312,7 +312,7 @@
* By default File is used, but for improved performance you should use APC.
*
* Note: 'default' and other application caches should be configured in app/Config/bootstrap.php.
* Please check the comments in boostrap.php for more info on the cache engines available
* Please check the comments in bootstrap.php for more info on the cache engines available
* and their settings.
*/
$engine = 'File';

View file

@ -197,7 +197,7 @@
/**
* Apply timestamps with the last modified time to static assets (js, css, images).
* Will append a querystring parameter containing the time the file was modified. This is
* Will append a query string parameter containing the time the file was modified. This is
* useful for invalidating browser caches.
*
* Set to `true` to apply timestamps when debug > 0. Set to 'force' to always enable
@ -223,7 +223,7 @@
//Configure::write('Asset.filter.js', 'custom_javascript_output_filter.php');
/**
* The classname and database used in CakePHP's
* The class name and database used in CakePHP's
* access control lists.
*/
Configure::write('Acl.classname', 'DbAcl');
@ -303,7 +303,7 @@
* By default File is used, but for improved performance you should use APC.
*
* Note: 'default' and other application caches should be configured in app/Config/bootstrap.php.
* Please check the comments in boostrap.php for more info on the cache engines available
* Please check the comments in bootstrap.php for more info on the cache engines available
* and their settings.
*/
$engine = 'File';

View file

@ -31,8 +31,14 @@ foreach ($paths as $path) {
}
if (!$found) {
$root = dirname(dirname(dirname(__FILE__)));
if (!include $root . $ds . $dispatcher) {
$rootInstall = dirname(dirname(dirname(__FILE__))) . $ds . $dispatcher;
$composerInstall = dirname(dirname(__FILE__)) . $ds. $dispatcher;
if (file_exists($composerInstall)) {
include $composerInstall;
} elseif (file_exists($rootInstall)) {
include $rootInstall;
} else {
trigger_error('Could not locate CakePHP core files.', E_USER_ERROR);
}
} else {

View file

@ -49,11 +49,11 @@ class FormAuthenticate extends BaseAuthenticate {
if (empty($request->data[$model])) {
return false;
}
if (
empty($request->data[$model][$fields['username']]) ||
empty($request->data[$model][$fields['password']])
) {
return false;
foreach (array($fields['username'], $fields['password']) as $field) {
$value = $request->data($model . '.' . $field);
if (empty($value) || !is_string($value)) {
return false;
}
}
return true;
}

View file

@ -539,7 +539,7 @@ class TranslateBehavior extends ModelBehavior {
$className = $Model->translateModel;
}
$this->runtime[$Model->alias]['model'] = ClassRegistry::init($className, 'Model');
$this->runtime[$Model->alias]['model'] = ClassRegistry::init($className);
}
if (!empty($Model->translateTable) && $Model->translateTable !== $this->runtime[$Model->alias]['model']->useTable) {
$this->runtime[$Model->alias]['model']->setSource($Model->translateTable);

View file

@ -86,8 +86,7 @@ class ConnectionManager {
}
if (!empty(self::$_dataSources[$name])) {
$return = self::$_dataSources[$name];
return $return;
return self::$_dataSources[$name];
}
if (empty(self::$_connectionsEnum[$name])) {

View file

@ -2588,7 +2588,7 @@ class DboSource extends DataSource {
}
if (!preg_match($operatorMatch, trim($operator))) {
$operator .= is_array($value) ? ' IN' : ' =';
$operator .= is_array($value) ? ' IN' : ' =';
}
$operator = trim($operator);

View file

@ -1694,6 +1694,8 @@ class Model extends Object implements CakeEventListener {
}
}
$db = $this->getDataSource();
if (empty($this->data[$this->alias][$this->primaryKey])) {
unset($this->data[$this->alias][$this->primaryKey]);
}

View file

@ -115,6 +115,28 @@ class FormAuthenticateTest extends CakeTestCase {
$this->assertFalse($this->auth->authenticate($request, $this->response));
}
/**
* test authenticate field is not string
*
* @return void
*/
public function testAuthenticateFieldsAreNotString() {
$request = new CakeRequest('posts/index', false);
$request->data = array(
'User' => array(
'user' => array('mariano', 'phpnut'),
'password' => 'my password'
));
$this->assertFalse($this->auth->authenticate($request, $this->response));
$request->data = array(
'User' => array(
'user' => 'mariano',
'password' => array('password1', 'password2')
));
$this->assertFalse($this->auth->authenticate($request, $this->response));
}
/**
* test the authenticate method
*

View file

@ -7765,7 +7765,7 @@ class ModelReadTest extends BaseModelTest {
$this->assertEquals(4, $result[0][0]['other_field']);
ClassRegistry::flush();
$Writing = ClassRegistry::init(array('class' => 'Post', 'alias' => 'Writing'), 'Model');
$Writing = ClassRegistry::init(array('class' => 'Post', 'alias' => 'Writing'));
$Writing->virtualFields = array('two' => "1 + 1");
$result = $Writing->find('first');
$this->assertEquals(2, $result['Writing']['two']);

View file

@ -2328,7 +2328,6 @@ class FormHelperTest extends CakeTestCase {
* @return void
*/
public function testInputTimeWithIntervalAnd12HourFormat() {
/*
$result = $this->Form->input('Model.start_time', array(
'type' => 'time',
'timeFormat' => 12,
@ -2348,7 +2347,6 @@ class FormHelperTest extends CakeTestCase {
$this->assertContains('<option value="04" selected="selected">4</option>', $result);
$this->assertContains('<option value="30" selected="selected">30</option>', $result);
$this->assertContains('<option value="pm" selected="selected">pm</option>', $result);
*/
$result = $this->Form->input('Model.start_time', array(
'type' => 'time',

View file

@ -73,7 +73,7 @@ class ClassRegistry {
* Examples
* Simple Use: Get a Post model instance ```ClassRegistry::init('Post');```
*
* Expanded: ```array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry', 'type' => 'Model');```
* Expanded: ```array('class' => 'ClassName', 'alias' => 'AliasNameStoredInTheRegistry');```
*
* Model Classes can accept optional ```array('id' => $id, 'table' => $table, 'ds' => $ds, 'alias' => $alias);```
*

View file

@ -421,7 +421,7 @@ class Debugger {
}
/**
* Wraps the highlight_string funciton in case the server API does not
* Wraps the highlight_string function in case the server API does not
* implement the function as it is the case of the HipHop interpreter
*
* @param string $str the string to convert