irm/lib/Config.php
/** Set the value of the specified system config variable.
     */
Set the value of the specified system config variable.
Set the value of the specified system config variable .
static function Set($variable, $value)
    {
        global $DEFAULT_CONFIG;
        if (!array_intersect(array_keys($DEFAULT_CONFIG), array($variable)))
        {
            return NULL;
        }
        $DB = Config::Database();
        $qvar = $DB->getTextValue($variable);
        $qval = $DB->getTextValue($value);
        $DB->autoCommit(false);
        $DB->query("DELETE FROM config WHERE variable=$qvar");
        $DB->query("INSERT INTO config (variable, value) VALUES ($qvar, $qval)");
        $DB->commit();
        $DB->autoCommit(true);
    }
static function Set ( $ variable , $ value ) { global $ DEFAULT_CONFIG ; if ( ! array_intersect ( array_keys ( $ DEFAULT_CONFIG ) , array ( $ variable ) ) ) { return NULL ; } $ DB = Config :: Database ( ) ; $ qvar = $ DB -> getTextValue ( $ variable ) ; $ qval = $ DB -> getTextValue ( $ value ) ; $ DB -> autoCommit ( false ) ; $ DB -> query ( " DELETE FROM config WHERE variable= $ qvar " ) ; $ DB -> query ( " INSERT INTO config (variable, value) VALUES ( $ qvar ,  $ qval ) " ) ; $ DB -> commit ( ) ; $ DB -> autoCommit ( true ) ; }
Set the value of the specified system config variable.
Set the value of the specified system config variable .
// Why all this stuff, you ask?  Because we can't rely on // MySQL's REPLACE statement (damned database independence) // and we can't use UPDATE because it's not guaranteed that // the relevant config variable exists in the database.