Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

FIX Clone Config_LRU incl. objects in array

Caused key confusions when using Config::nest()/unnest()
  • Loading branch information...
commit a415db91d44ccde50a5ed0b1c35ec4d450ae5b2d 1 parent 04c3b5e
@chillu chillu authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 core/Config.php
View
14 core/Config.php
@@ -623,6 +623,20 @@ public function __construct() {
$this->indexing = array();
}
+ public function __clone() {
+ if (version_compare(PHP_VERSION, '5.3.7', '<')) {
+ // SplFixedArray causes seg faults before PHP 5.3.7
+ $cloned = array();
+ }
+ else {
+ $cloned = new SplFixedArray(self::SIZE);
+ }
+ for ($i = 0; $i < self::SIZE; $i++) {
+ $cloned[$i] = clone $this->cache[$i];
+ }
+ $this->cache = $cloned;
+ }
+
public function set($key, $val, $tags = array()) {
// Find an index to set at
$replacing = null;
Please sign in to comment.
Something went wrong with that request. Please try again.