30 $this->CONFIG = $CONFIG;
41 function remove(
$name, $site_guid = 0) {
46 $site_guid = (int) $site_guid;
47 if ($site_guid == 0) {
48 $site_guid = (int) $this->CONFIG->site_guid;
51 if ($site_guid == $this->CONFIG->site_guid && isset($this->CONFIG->$name)) {
52 unset($this->CONFIG->$name);
56 $query =
"DELETE FROM {$this->CONFIG->dbprefix}config WHERE name = '$escaped_name' AND site_guid = $site_guid";
89 _elgg_services()->logger->error(
"The name length for configuration variables cannot be greater than 255");
93 $site_guid = (int) $site_guid;
94 if ($site_guid == 0) {
95 $site_guid = (int) $this->CONFIG->site_guid;
98 if ($site_guid == $this->CONFIG->site_guid) {
99 $this->CONFIG->$name =
$value;
105 SET name = '$escaped_name', value = '$escaped_value', site_guid = $site_guid 106 ON DUPLICATE KEY UPDATE value = '$escaped_value'");
124 function get(
$name, $site_guid = 0) {
129 $site_guid = (int) $site_guid;
136 $new_name =
'view_path';
140 $new_name =
'plugins_path';
144 $new_name =
'site_name';
156 if ($site_guid == 0) {
157 $site_guid = (int) $this->CONFIG->site_guid;
161 if ($site_guid == $this->CONFIG->site_guid && isset($this->CONFIG->$name)) {
162 return $this->CONFIG->$name;
167 WHERE name = '$escaped_name' AND site_guid = $site_guid");
172 if ($site_guid == $this->CONFIG->site_guid) {
173 $this->CONFIG->$name =
$result;
192 $site_guid = (int) $site_guid;
194 if ($site_guid == 0) {
195 $site_guid = (int) $this->CONFIG->site_guid;
198 if (
$result =
_elgg_services()->db->getData(
"SELECT * FROM {$this->CONFIG->dbprefix}config WHERE site_guid = $site_guid")) {
202 $this->CONFIG->$name = unserialize($value);
if($guid==elgg_get_logged_in_user_guid()) $name
__construct()
Constructor.
sanitize_string($string)
Sanitize a string for database use.
elgg_strlen()
Wrapper function for mb_strlen().
elgg global
Pointer to the global context.
loadAll($site_guid=0)
Loads all configuration values from the dbprefix_config table into $CONFIG.