Merge branch '2.7' into 2.8

This commit is contained in:
mark_story 2015-10-17 21:00:26 -04:00
commit 8c404ad6a7
4 changed files with 21 additions and 8 deletions

View file

@ -273,7 +273,8 @@ class MemcachedEngine extends CacheEngine {
*
* @param bool $check If true no deletes will occur and instead CakePHP will rely
* on key TTL values.
* @return bool True if the cache was successfully cleared, false otherwise
* @return bool True if the cache was successfully cleared, false otherwise. Will
* also return false if you are using a binary protocol.
*/
public function clear($check) {
if ($check) {
@ -281,6 +282,9 @@ class MemcachedEngine extends CacheEngine {
}
$keys = $this->_Memcached->getAllKeys();
if ($keys === false) {
return false;
}
foreach ($keys as $key) {
if (strpos($key, $this->settings['prefix']) === 0) {

View file

@ -76,13 +76,11 @@ class FlashComponent extends Component {
$message = $message->getMessage();
}
list($plugin, $element) = pluginSplit($options['element']);
if ($plugin) {
$options['element'] = $plugin . '.Flash/' . $element;
} else {
$options['element'] = 'Flash/' . $element;
list($plugin, $element) = pluginSplit($options['element'], true);
if (!empty($options['plugin'])) {
$plugin = $options['plugin'] . '.';
}
$options['element'] = $plugin . 'Flash/' . $element;
CakeSession::write('Message.' . $options['key'], array(
'message' => $message,

View file

@ -1562,6 +1562,7 @@ class DboSource extends DataSource {
}
} else {
if (is_array($merge[0][$association])) {
$mergeAssocTmp = array();
foreach ($dataAssociation as $k => $v) {
if (!is_array($v)) {
$dataAssocTmp[$k] = $v;

View file

@ -158,6 +158,16 @@ class FlashComponentTest extends CakeTestCase {
$result = CakeSession::read('Message.flash');
$this->assertEquals($expected, $result);
$this->Flash->alert('It worked', array('plugin' => 'MyPlugin'));
$expected = array(
'message' => 'It worked',
'key' => 'flash',
'element' => 'MyPlugin.Flash/alert',
'params' => array()
);
$result = CakeSession::read('Message.flash');
$this->assertEquals($expected, $result);
$this->Flash->error('It did not work', array('element' => 'error_thing'));
$expected = array(
'message' => 'It did not work',