/** * This function instantiates all the other core objects required to make the forum run. * It also sets all options specified in config.php. * * @param Array $options (optional) * Array of options set in config.php. * @param String $siteFolder (optional) * Site folder relative to the URL root set in config.php. */ public function init($config) { define('SITE_FOLDER', $config['site_folder']); if (!defined('IS_ADMIN_PAGE')) { define('IS_ADMIN_PAGE', false); } $this->loadIncludes(SITE_FOLDER); ConfigManager::instance()->register_user_config($config); $this->add_module('paths', new OsimoPaths()); /* Initialize modules */ $this->add_module('debug', new OsimoDebug()); $this->add_module('cache', new OsimoCache()); OsimoDB::instance()->init(); $this->loadConfig(); UserManager::set_logged_in_user(); $this->add_module('theme', new OsimoTheme()); $this->add_module('data', new OsimoData()); $this->add_module('bbparser', new OsimoBBParser()); if (IS_ADMIN_PAGE == true) { $this->add_module('admin', new OsimoAdmin()); } }
function get($name) { if($name == 'debug') { return new DummyDebug(); } elseif($name == 'db') { return OsimoDB::instance(); } }