60    public function __construct($a_module = 
"common", $a_disabled_cache = 
false)
 
   64        $this->db = 
$DIC->database();
 
   67        $this->cache_disabled = $a_disabled_cache;
 
   68        $this->module = $a_module;
 
   70        if (!is_object(
$ilDB)) {
 
   71            die(
"Fatal Error: ilSettings object instantiated without DB initialisation.");
 
   95        if (!$this->cache_disabled) {
 
   96            if (isset(self::$settings_cache[$this->module])) {
 
  100                $this->setting = array();
 
  105        $query = 
"SELECT * FROM settings WHERE module=" . 
$ilDB->quote($this->module, 
"text");
 
  109            $this->setting[
$row[
"keyword"]] = 
$row[
"value"];
 
  123    public function get($a_keyword, $a_default_value = 
false)
 
  125        if ($a_keyword == 
"ilias_version") {
 
  129        if (isset($this->setting[$a_keyword])) {
 
  130            return $this->setting[$a_keyword];
 
  132            return $a_default_value;
 
  146        $query = 
"DELETE FROM settings WHERE module = " . 
$ilDB->quote($this->module, 
"text");
 
  149        $this->setting = array();
 
  164        $query = 
"SELECT keyword FROM settings" .
 
  165            " WHERE module = " . 
$ilDB->quote($this->module, 
"text") .
 
  166            " AND " . 
$ilDB->like(
"keyword", 
"text", $a_like);
 
  169            $this->
delete(
$row[
"keyword"]);
 
  181    public function delete($a_keyword)
 
  185        $st = 
$ilDB->manipulate(
"DELETE FROM settings WHERE keyword = " .
 
  186            $ilDB->quote($a_keyword, 
"text") . 
" AND module = " .
 
  187            $ilDB->quote($this->module, 
"text"));
 
  189        unset($this->setting[$a_keyword]);
 
  213    public function set($a_key, $a_val)
 
  220        $this->
delete($a_key);
 
  222        if (!isset(self::$value_type)) {
 
  226        if (self::$value_type == 
'text' and strlen($a_val) >= 4000) {
 
  228            $a_val = substr($a_val, 0, 4000);
 
  231        $ilDB->insert(
"settings", array(
 
  232            "module" => array(
"text", $this->module),
 
  233            "keyword" => array(
"text", $a_key),
 
  234            "value" => array(self::$value_type, $a_val)));
 
  236        $this->setting[$a_key] = $a_val;
 
  245            $ilDB->query(
"UPDATE sahs_lm SET debug = 'n'");
 
  257        $query = 
"SELECT value FROM settings WHERE module = %s AND keyword = %s";
 
  258        $res = 
$ilDB->queryF(
$query, array(
'text', 
'text'), array($a_module, $a_keyword));
 
  260        return $data[
'value'];
 
  271        include_once(
'./Services/Database/classes/class.ilDBAnalyzer.php');
 
  273        $info = $analyzer->getFieldInformation(
'settings');
 
  275        if (
$info[
'value'][
'type'] == 
'clob') {
 
  297        if ($a_new_type == $old_type) {
 
  299        } elseif ($a_new_type == 
'clob') {
 
  300            $ilDB->addTableColumn(
 
  303                array(  
"type" => 
"clob",
 
  308            $ilDB->query(
"UPDATE settings SET value2 = value");
 
  309            $ilDB->dropTableColumn(
'settings', 
'value');
 
  310            $ilDB->renameTableColumn(
'settings', 
'value2', 
'value');
 
  313        } elseif ($a_new_type == 
'text') {
 
  314            $ilDB->addTableColumn(
 
  317                array(  
"type" => 
"text",
 
  323            $ilDB->query(
"UPDATE settings SET value2 = value");
 
  324            $ilDB->dropTableColumn(
'settings', 
'value');
 
  325            $ilDB->renameTableColumn(
'settings', 
'value2', 
'value');
 
  348        $query = 
"SELECT * FROM settings WHERE LENGTH(value) > " 
  349            . 
$ilDB->quote($a_limit, 
'integer');
 
An exception for terminatinating execution or to throw for unit testing.
This class gives all kind of DB information using the MDB2 manager and reverse module.
static _getLongerSettings($a_limit='4000')
get a list of setting records with values loger than a limit
static $value_type
the type of settings value field in database This is determined in the set method to get a correct DB...
static _getValueType()
Get the type of the value column in the database.
deleteLike($a_like)
Delete all settings corresponding to a like string.
setScormDebug($a_key, $a_val)
__construct($a_module="common", $a_disabled_cache=false)
Initialize settings.
set($a_key, $a_val)
write one value to db-table settings @access public
static _lookupValue($a_module, $a_keyword)
read()
Read settings data.
getAll()
read all values from settingstable @access public
static _changeValueType($a_new_type='text')
change the type of the value column in the database
getModule()
Get currernt module.
deleteAll()
Delete all settings of a current module.
static $settings_cache
cache for the read settings ilSetting is instantiated more than once per request for some modules The...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
foreach($_POST as $key=> $value) $res