Skip to content

Commit 9614ac3

Browse files
committed
Update CakePHP to Version 2.10.9
1 parent a94d0e4 commit 9614ac3

File tree

712 files changed

+13465
-6935
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

712 files changed

+13465
-6935
lines changed

cakephp/app/Config/bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
CakePlugin::load('BoostCake');
109109

110110
//Define versions
111-
define('STATUSENIGNE_VERSION', '2.1.3');
111+
define('STATUSENIGNE_VERSION', '2.1.4');
112112
define('PERFDATA_VERSION', '1.2.0');
113113

114114

cakephp/lib/Cake/Cache/Cache.php

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?php
22
/**
3-
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
4-
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
3+
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
4+
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
55
*
66
* Licensed under The MIT License
77
* For full copyright and license information, please see the LICENSE.txt
88
* Redistributions of files must retain the above copyright notice.
99
*
10-
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
11-
* @link http://cakephp.org CakePHP(tm) Project
10+
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
11+
* @link https://cakephp.org CakePHP(tm) Project
1212
* @package Cake.Cache
1313
* @since CakePHP(tm) v 1.2.0.4933
14-
* @license http://www.opensource.org/licenses/mit-license.php MIT License
14+
* @license https://opensource.org/licenses/mit-license.php MIT License
1515
*/
1616

1717
App::uses('Inflector', 'Utility');
@@ -616,4 +616,18 @@ public static function add($key, $value, $config = 'default') {
616616
self::set(null, $config);
617617
return $success;
618618
}
619+
620+
/**
621+
* Fetch the engine attached to a specific configuration name.
622+
*
623+
* @param string $config Optional string configuration name to get an engine for. Defaults to 'default'.
624+
* @return null|CacheEngine Null if the engine has not been initialized or the engine.
625+
*/
626+
public static function engine($config = 'default') {
627+
if (self::isInitialized($config)) {
628+
return self::$_engines[$config];
629+
}
630+
631+
return null;
632+
}
619633
}

cakephp/lib/Cake/Cache/CacheEngine.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?php
22
/**
3-
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
4-
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
3+
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
4+
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
55
*
66
* Licensed under The MIT License
77
* For full copyright and license information, please see the LICENSE.txt
88
* Redistributions of files must retain the above copyright notice.
99
*
10-
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
11-
* @link http://cakephp.org CakePHP(tm) Project
10+
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
11+
* @link https://cakephp.org CakePHP(tm) Project
1212
* @package Cake.Cache
1313
* @since CakePHP(tm) v 1.2.0.4933
14-
* @license http://www.opensource.org/licenses/mit-license.php MIT License
14+
* @license https://opensource.org/licenses/mit-license.php MIT License
1515
*/
1616

1717
/**
@@ -181,7 +181,7 @@ public function key($key) {
181181

182182
$prefix = '';
183183
if (!empty($this->_groupPrefix)) {
184-
$prefix = vsprintf($this->_groupPrefix, $this->groups());
184+
$prefix = md5(implode('_', $this->groups()));
185185
}
186186

187187
$key = preg_replace('/[\s]+/', '_', strtolower(trim(str_replace(array(DS, '/', '.'), '_', strval($key)))));

cakephp/lib/Cake/Cache/Engine/ApcEngine.php

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
/**
33
* APC storage engine for cache.
44
*
5-
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
6-
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
5+
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
6+
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
77
*
88
* Licensed under The MIT License
99
* For full copyright and license information, please see the LICENSE.txt
1010
* Redistributions of files must retain the above copyright notice.
1111
*
12-
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
13-
* @link http://cakephp.org CakePHP(tm) Project
12+
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
13+
* @link https://cakephp.org CakePHP(tm) Project
1414
* @package Cake.Cache.Engine
1515
* @since CakePHP(tm) v 1.2.0.4933
16-
* @license http://www.opensource.org/licenses/mit-license.php MIT License
16+
* @license https://opensource.org/licenses/mit-license.php MIT License
1717
*/
1818

1919
/**
@@ -31,6 +31,13 @@ class ApcEngine extends CacheEngine {
3131
*/
3232
protected $_compiledGroupNames = array();
3333

34+
/**
35+
* APC or APCu extension
36+
*
37+
* @var string
38+
*/
39+
protected $_apcExtension = 'apc';
40+
3441
/**
3542
* Initialize the Cache Engine
3643
*
@@ -47,6 +54,10 @@ public function init($settings = array()) {
4754
}
4855
$settings += array('engine' => 'Apc');
4956
parent::init($settings);
57+
if (function_exists('apcu_dec')) {
58+
$this->_apcExtension = 'apcu';
59+
return true;
60+
}
5061
return function_exists('apc_dec');
5162
}
5263

@@ -63,8 +74,9 @@ public function write($key, $value, $duration) {
6374
if ($duration) {
6475
$expires = time() + $duration;
6576
}
66-
apc_store($key . '_expires', $expires, $duration);
67-
return apc_store($key, $value, $duration);
77+
$func = $this->_apcExtension . '_store';
78+
$func($key . '_expires', $expires, $duration);
79+
return $func($key, $value, $duration);
6880
}
6981

7082
/**
@@ -75,11 +87,12 @@ public function write($key, $value, $duration) {
7587
*/
7688
public function read($key) {
7789
$time = time();
78-
$cachetime = (int)apc_fetch($key . '_expires');
90+
$func = $this->_apcExtension . '_fetch';
91+
$cachetime = (int)$func($key . '_expires');
7992
if ($cachetime !== 0 && ($cachetime < $time || ($time + $this->settings['duration']) < $cachetime)) {
8093
return false;
8194
}
82-
return apc_fetch($key);
95+
return $func($key);
8396
}
8497

8598
/**
@@ -90,7 +103,8 @@ public function read($key) {
90103
* @return New incremented value, false otherwise
91104
*/
92105
public function increment($key, $offset = 1) {
93-
return apc_inc($key, $offset);
106+
$func = $this->_apcExtension . '_inc';
107+
return $func($key, $offset);
94108
}
95109

96110
/**
@@ -101,7 +115,8 @@ public function increment($key, $offset = 1) {
101115
* @return New decremented value, false otherwise
102116
*/
103117
public function decrement($key, $offset = 1) {
104-
return apc_dec($key, $offset);
118+
$func = $this->_apcExtension . '_dec';
119+
return $func($key, $offset);
105120
}
106121

107122
/**
@@ -111,7 +126,8 @@ public function decrement($key, $offset = 1) {
111126
* @return bool True if the value was successfully deleted, false if it didn't exist or couldn't be removed
112127
*/
113128
public function delete($key) {
114-
return apc_delete($key);
129+
$func = $this->_apcExtension . '_delete';
130+
return $func($key);
115131
}
116132

117133
/**
@@ -125,19 +141,20 @@ public function clear($check) {
125141
if ($check) {
126142
return true;
127143
}
144+
$func = $this->_apcExtension . '_delete';
128145
if (class_exists('APCIterator', false)) {
129146
$iterator = new APCIterator(
130147
'user',
131148
'/^' . preg_quote($this->settings['prefix'], '/') . '/',
132149
APC_ITER_NONE
133150
);
134-
apc_delete($iterator);
151+
$func($iterator);
135152
return true;
136153
}
137-
$cache = apc_cache_info('user');
154+
$cache = $this->_apcExtension === 'apc' ? apc_cache_info('user') : apcu_cache_info();
138155
foreach ($cache['cache_list'] as $key) {
139156
if (strpos($key['info'], $this->settings['prefix']) === 0) {
140-
apc_delete($key['info']);
157+
$func($key['info']);
141158
}
142159
}
143160
return true;
@@ -157,11 +174,13 @@ public function groups() {
157174
}
158175
}
159176

160-
$groups = apc_fetch($this->_compiledGroupNames);
177+
$fetchFunc = $this->_apcExtension . '_fetch';
178+
$storeFunc = $this->_apcExtension . '_store';
179+
$groups = $fetchFunc($this->_compiledGroupNames);
161180
if (count($groups) !== count($this->settings['groups'])) {
162181
foreach ($this->_compiledGroupNames as $group) {
163182
if (!isset($groups[$group])) {
164-
apc_store($group, 1);
183+
$storeFunc($group, 1);
165184
$groups[$group] = 1;
166185
}
167186
}
@@ -184,7 +203,8 @@ public function groups() {
184203
* @return bool success
185204
*/
186205
public function clearGroup($group) {
187-
apc_inc($this->settings['prefix'] . $group, 1, $success);
206+
$func = $this->_apcExtension . '_inc';
207+
$func($this->settings['prefix'] . $group, 1, $success);
188208
return $success;
189209
}
190210

@@ -203,7 +223,8 @@ public function add($key, $value, $duration) {
203223
if ($duration) {
204224
$expires = time() + $duration;
205225
}
206-
apc_add($key . '_expires', $expires, $duration);
207-
return apc_add($key, $value, $duration);
226+
$func = $this->_apcExtension . '_add';
227+
$func($key . '_expires', $expires, $duration);
228+
return $func($key, $value, $duration);
208229
}
209230
}

cakephp/lib/Cake/Cache/Engine/FileEngine.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
*
77
* You can configure a FileEngine cache, using Cache::config()
88
*
9-
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
10-
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
9+
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
10+
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
1111
*
1212
* Licensed under The MIT License
1313
* For full copyright and license information, please see the LICENSE.txt
1414
* Redistributions of files must retain the above copyright notice.
1515
*
16-
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
17-
* @link http://cakephp.org CakePHP(tm) Project
16+
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
17+
* @link https://cakephp.org CakePHP(tm) Project
1818
* @since CakePHP(tm) v 1.2.0.4933
19-
* @license http://www.opensource.org/licenses/mit-license.php MIT License
19+
* @license https://opensource.org/licenses/mit-license.php MIT License
2020
*/
2121

2222
/**
@@ -132,7 +132,7 @@ public function write($key, $data, $duration) {
132132
}
133133

134134
$expires = time() + $duration;
135-
$contents = $expires . $lineBreak . $data . $lineBreak;
135+
$contents = implode(array($expires, $lineBreak, $data, $lineBreak));
136136

137137
if ($this->settings['lock']) {
138138
$this->_File->flock(LOCK_EX);
@@ -267,6 +267,10 @@ protected function _clearDirectory($path, $now, $threshold) {
267267
}
268268

269269
$dir = dir($path);
270+
if ($dir === false) {
271+
return;
272+
}
273+
270274
while (($entry = $dir->read()) !== false) {
271275
if (substr($entry, 0, $prefixLength) !== $this->settings['prefix']) {
272276
continue;

cakephp/lib/Cake/Cache/Engine/MemcacheEngine.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
/**
33
* Memcache storage engine for cache
44
*
5-
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
6-
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
5+
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
6+
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
77
*
88
* Licensed under The MIT License
99
* For full copyright and license information, please see the LICENSE.txt
1010
* Redistributions of files must retain the above copyright notice.
1111
*
12-
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
13-
* @link http://cakephp.org CakePHP(tm) Project
12+
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
13+
* @link https://cakephp.org CakePHP(tm) Project
1414
* @package Cake.Cache.Engine
1515
* @since CakePHP(tm) v 1.2.0.4933
16-
* @license http://www.opensource.org/licenses/mit-license.php MIT License
16+
* @license https://opensource.org/licenses/mit-license.php MIT License
1717
*/
1818

1919
/**

cakephp/lib/Cake/Cache/Engine/MemcachedEngine.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
<?php
22
/**
3-
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
4-
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
3+
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
4+
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
55
*
66
* Licensed under The MIT License
77
* For full copyright and license information, please see the LICENSE.txt
88
* Redistributions of files must retain the above copyright notice.
99
*
10-
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
11-
* @link http://cakephp.org CakePHP(tm) Project
10+
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
11+
* @link https://cakephp.org CakePHP(tm) Project
1212
* @since CakePHP(tm) v 2.5.0
13-
* @license http://www.opensource.org/licenses/mit-license.php MIT License
13+
* @license https://opensource.org/licenses/mit-license.php MIT License
1414
*/
1515

1616
/**
@@ -23,6 +23,8 @@
2323
* (if memcached extension compiled with --enable-igbinary)
2424
* Compressed keys can also be incremented/decremented
2525
*
26+
* This cache engine requires at least ext/memcached version 2.0
27+
*
2628
* @package Cake.Cache.Engine
2729
*/
2830
class MemcachedEngine extends CacheEngine {

cakephp/lib/Cake/Cache/Engine/RedisEngine.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
/**
33
* Redis storage engine for cache
44
*
5-
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
6-
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
5+
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
6+
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
77
*
88
* Licensed under The MIT License
99
* For full copyright and license information, please see the LICENSE.txt
1010
* Redistributions of files must retain the above copyright notice.
1111
*
12-
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
13-
* @link http://cakephp.org CakePHP(tm) Project
12+
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
13+
* @link https://cakephp.org CakePHP(tm) Project
1414
* @package Cake.Cache.Engine
1515
* @since CakePHP(tm) v 2.2
16-
* @license http://www.opensource.org/licenses/mit-license.php MIT License
16+
* @license https://opensource.org/licenses/mit-license.php MIT License
1717
*/
1818

1919
/**

cakephp/lib/Cake/Cache/Engine/WincacheEngine.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
*
55
* Supports wincache 1.1.0 and higher.
66
*
7-
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
8-
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
7+
* CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
8+
* Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
99
*
1010
* Licensed under The MIT License
1111
* For full copyright and license information, please see the LICENSE.txt
1212
* Redistributions of files must retain the above copyright notice.
1313
*
14-
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
15-
* @link http://cakephp.org CakePHP(tm) Project
14+
* @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
15+
* @link https://cakephp.org CakePHP(tm) Project
1616
* @package Cake.Cache.Engine
1717
* @since CakePHP(tm) v 1.2.0.4933
18-
* @license http://www.opensource.org/licenses/mit-license.php MIT License
18+
* @license https://opensource.org/licenses/mit-license.php MIT License
1919
*/
2020

2121
/**

0 commit comments

Comments
 (0)