{ global $DB; if (!isset($this->configs[$name])) { $config = new stdClass(); // load the defaults if (file_exists(elis::plugin_file($name, 'defaults.php'))) { $defaults = array(); include elis::plugin_file($name, 'defaults.php'); foreach ($defaults as $key => $value) { $config->{$key} = $value; } } $configrecs = $DB->get_recordset('config_plugins', array('plugin' => $name)); foreach ($configrecs as $rec) { $key = $rec->name; $config->{$key} = $rec->value; } unset($configrecs); $this->configs[$name] = $config; } return $this->configs[$name]; } } global $CFG; elis::$basedir = "{$CFG->dirroot}/local"; elis::$libdir = elis::file('eliscore/lib'); elis::$config = new elis_config(); $plugin = new stdClass(); require elis::file('eliscore/version.php'); elis::$version = $plugin->version; elis::$release = $plugin->release;