private $runtime, $locals, $settings;
+ private $cache = array();
+
public function __construct() {
$this->map = self::getPropertyMap();
}
if (!isset($this->map[$k])) {
throw new \CRM_Core_Exception("Cannot read unrecognized property CRM_Core_Config::\${$k}.");
}
+ if (isset($this->cache[$k])) {
+ return $this->cache[$k];
+ }
$type = $this->map[$k][0];
$name = isset($this->map[$k][1]) ? $this->map[$k][1] : $k;
CRM_Utils_File::restrictAccess($value);
}
}
+ $this->cache[$k] = $value;
return $value;
case 'setting-url-abs':
if (empty($value) && isset($this->map[$k][2])) {
$value = $this->map[$k][2];
}
- return Civi::paths()->getUrl($value, 'absolute');
+ $this->cache[$k] = Civi::paths()->getUrl($value, 'absolute');
+ return $this->cache[$k];
case 'setting-url-rel':
// Array(0 => $type, 1 => $setting, 2 => $default).
if (empty($value) && isset($this->map[$k][2])) {
$value = $this->map[$k][2];
}
- return Civi::paths()->getUrl($value, 'relative');
+ $this->cache[$k] = Civi::paths()->getUrl($value, 'relative');
+ return $this->cache[$k];
case 'runtime':
return $this->getRuntime()->{$name};
if (!isset($this->map[$k])) {
throw new \CRM_Core_Exception("Cannot set unrecognized property CRM_Core_Config::\${$k}");
}
+ unset($this->cache[$k]);
list ($type, $name) = $this->map[$k];
switch ($type) {
if (!isset($this->map[$k])) {
throw new \CRM_Core_Exception("Cannot unset unrecognized property CRM_Core_Config::\${$k}");
}
+ unset($this->cache[$k]);
list ($type, $name) = $this->map[$k];
switch ($type) {