4 include_once(
'./Modules/Cloud/exceptions/class.ilCloudPluginConfigException.php');
60 $index = substr($method,3);
61 if (substr($method, 0, 3) ==
'get')
63 if (!isset($this->cache[$index]))
65 $this->cache[$index] = $this->
getValue(self::_fromCamelCase(substr($method, 3)));
67 if ($this->cache[$index] == null)
69 $this->cache[$index] =
false;
72 return $this->cache[$index];
73 }
else if (substr($method, 0, 3) ==
'set')
75 $this->cache[$index] = $params[0];
76 $this->
setValue(self::_fromCamelCase(substr($method, 3)), $params[0]);
93 if(!$ilDB->tableExists($this->table_name))
98 if (!is_string($this->
getValue($key)))
100 $ilDB->insert($this->table_name, array(
"config_key" => array(
"text", $key),
"config_value" => array(
"text", $value)));
105 $ilDB->update($this->table_name, array(
"config_key" => array(
"text", $key),
"config_value" => array(
"text", $value)), array(
"config_key" => array(
"text", $key)));
123 $result = $ilDB->query(
"SELECT config_value FROM ". $this->table_name .
" WHERE config_key = " . $ilDB->quote($key,
"text"));
129 $record = $ilDB->fetchAssoc(
$result);
130 return (
string)$record[
'config_value'];
142 if (!$ilDB->tableExists($this->getTableName()))
145 'config_key' => array(
149 'config_value' => array(
151 'notnull' =>
false),);
153 $ilDB->addPrimaryKey($this->
getTableName(), array(
"config_key"));
171 $str[0] = strtolower($str[0]);
172 $func = create_function(
'$c',
'return "_" . strtolower($c[1]);');
173 return preg_replace_callback(
'/([A-Z])/', $func, $str);
181 public static function _toCamelCase($str, $capitalise_first_char =
false)
183 if ($capitalise_first_char)
185 $str[0] = strtoupper($str[0]);
187 $func = create_function(
'$c',
'return strtoupper($c[1]);');
188 return preg_replace_callback(
'/-([a-z])/', $func, $str);