iron-io/iron_cache_php — pull request #6 by Sam152 (2013-08-28 00:42:54+00:00)
Title: Updated class to use "protected" instead of "private" access modifier.

I ran into an issue when extending the IronCache class. Since everything was private, it made the following impossible since I needed access to the private variable "cache_name". In general I think protected is a far better way of shielding access while being flexible enough to allow extendability.

class FlexIronCache extends IronCache {
public function put($key, $item){
if (is_array($item) || is_object($item)) {
$item = serialize($item);
}
return $this->putItem($this->cache_name, $key, $item);
}
public function get($key){
$val = $this->getItem($this->cache_name, $key);
$unserialised = @unserialize($val);
return $unserialised !== FALSE ? $unserialised : $val;
}
}