irm/lib/Config.php
/** Retrieve the complete set of config values.
     * Get all of the current config values from the database and
     * return them to the calling function as an associative array.
     */
Retrieve the complete set of config values.
Get all of the current config values from the database and
return them to the calling function as an associative array.
Retrieve the complete set of config values . Get all of the current config values from the database and return them to the calling function as an associative array .
static function All()
    {
        $DB = Config::Database();
        $cfg = $DB->getAll("SELECT variable,value FROM config");
        global $DEFAULT_CONFIG;
        $valid = array_keys($DEFAULT_CONFIG);
        $all = $DEFAULT_CONFIG;
        foreach ($cfg as $c)
        {
            if (array_intersect($valid, array($c['variable'])))
            {
                $var = $c['variable'];
                $value = $c['value'];
                if (is_bool($DEFAULT_CONFIG[$var]))
                {
                    if ($value == 0)
                    {
                        $value = false;
                    }
                    else
                    {
                        $value = true;
                    }
                }
                $all[$var] = $value;
            }
        }
        return $all;
    }
static function All ( ) { $ DB = Config :: Database ( ) ; $ cfg = $ DB -> getAll ( " SELECT variable,value FROM config " ) ; global $ DEFAULT_CONFIG ; $ valid = array_keys ( $ DEFAULT_CONFIG ) ; $ all = $ DEFAULT_CONFIG ; foreach ( $ cfg as $ c ) { if ( array_intersect ( $ valid , array ( $ c [ 'variable' ] ) ) ) { $ var = $ c [ 'variable' ] ; $ value = $ c [ 'value' ] ; if ( is_bool ( $ DEFAULT_CONFIG [ $ var ] ) ) { if ( $ value == 0 ) { $ value = false ; } else { $ value = true ; } } $ all [ $ var ] = $ value ; } } return $ all ; }
Retrieve the complete set of config values.
Retrieve the complete set of config values .
// Quick boolean conversion