function get($name)
{
$name = trim($name);
// check for deprecated values.
// @todo might be a better spot to define this?
$new_name = false;
switch ($name) {
case 'pluginspath':
$new_name = 'plugins_path';
break;
case 'sitename':
$new_name = 'site_name';
break;
}
// @todo these haven't really been implemented in Elgg 1.8. Complete in 1.9.
// show dep message
if ($new_name) {
// $msg = "Config value $name has been renamed as $new_name";
$name = $new_name;
// elgg_deprecated_notice($msg, $dep_version);
}
// decide from where to return the value
if (isset($this->CONFIG->{$name})) {
return $this->CONFIG->{$name};
}
$sql = "\n\t\t\tSELECT value\n\t\t\tFROM {$this->CONFIG->dbprefix}config\n\t\t\tWHERE name = :name\n\t\t";
$params[':name'] = $name;
$result = $this->db->getDataRow($sql, null, $params);
if ($result) {
$result = unserialize($result->value);
$this->CONFIG->{$name} = $result;
return $result;
}
return null;
}