mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge branch '2.7' into 2.8
This commit is contained in:
commit
8c404ad6a7
4 changed files with 21 additions and 8 deletions
|
@ -273,7 +273,8 @@ class MemcachedEngine extends CacheEngine {
|
||||||
*
|
*
|
||||||
* @param bool $check If true no deletes will occur and instead CakePHP will rely
|
* @param bool $check If true no deletes will occur and instead CakePHP will rely
|
||||||
* on key TTL values.
|
* 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) {
|
public function clear($check) {
|
||||||
if ($check) {
|
if ($check) {
|
||||||
|
@ -281,6 +282,9 @@ class MemcachedEngine extends CacheEngine {
|
||||||
}
|
}
|
||||||
|
|
||||||
$keys = $this->_Memcached->getAllKeys();
|
$keys = $this->_Memcached->getAllKeys();
|
||||||
|
if ($keys === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($keys as $key) {
|
foreach ($keys as $key) {
|
||||||
if (strpos($key, $this->settings['prefix']) === 0) {
|
if (strpos($key, $this->settings['prefix']) === 0) {
|
||||||
|
|
|
@ -76,13 +76,11 @@ class FlashComponent extends Component {
|
||||||
$message = $message->getMessage();
|
$message = $message->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
list($plugin, $element) = pluginSplit($options['element']);
|
list($plugin, $element) = pluginSplit($options['element'], true);
|
||||||
|
if (!empty($options['plugin'])) {
|
||||||
if ($plugin) {
|
$plugin = $options['plugin'] . '.';
|
||||||
$options['element'] = $plugin . '.Flash/' . $element;
|
|
||||||
} else {
|
|
||||||
$options['element'] = 'Flash/' . $element;
|
|
||||||
}
|
}
|
||||||
|
$options['element'] = $plugin . 'Flash/' . $element;
|
||||||
|
|
||||||
CakeSession::write('Message.' . $options['key'], array(
|
CakeSession::write('Message.' . $options['key'], array(
|
||||||
'message' => $message,
|
'message' => $message,
|
||||||
|
|
|
@ -1562,6 +1562,7 @@ class DboSource extends DataSource {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (is_array($merge[0][$association])) {
|
if (is_array($merge[0][$association])) {
|
||||||
|
$mergeAssocTmp = array();
|
||||||
foreach ($dataAssociation as $k => $v) {
|
foreach ($dataAssociation as $k => $v) {
|
||||||
if (!is_array($v)) {
|
if (!is_array($v)) {
|
||||||
$dataAssocTmp[$k] = $v;
|
$dataAssocTmp[$k] = $v;
|
||||||
|
@ -3586,4 +3587,4 @@ class DboSource extends DataSource {
|
||||||
parent::__destruct();
|
parent::__destruct();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,6 +158,16 @@ class FlashComponentTest extends CakeTestCase {
|
||||||
$result = CakeSession::read('Message.flash');
|
$result = CakeSession::read('Message.flash');
|
||||||
$this->assertEquals($expected, $result);
|
$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'));
|
$this->Flash->error('It did not work', array('element' => 'error_thing'));
|
||||||
$expected = array(
|
$expected = array(
|
||||||
'message' => 'It did not work',
|
'message' => 'It did not work',
|
||||||
|
|
Loading…
Reference in a new issue