so AND $this->so->loaded()) return $this; $this->so = ORM::factory('setup',array('nonssl_url'=>URL::base('http'))); if (! $this->so->loaded()) throw new Kohana_Exception(_('Site [:site] not defined in DB?'),array(':site'=>URL::base('http'))); Kohana::$environment = (int)static::sitemode(); return $this; } /** * Find a list of all database enabled modules * * Our available modules are defined in the DB (along with method * security). */ public static function modules() { static $return = array(); if (! count($return)) foreach (ORM::factory('module')->list_active() as $mo) $return[$mo->name] = MODPATH.$mo->name; return $return; } public static function moduleexist($module) { return array_key_exists($module,static::modules()) ? TRUE : FALSE; } public static function sitename() { return Company::name(); } public static function siteid($format=FALSE) { return $format ? sprintf('%02s',Config::instance()->loadsite()->so->id) : Config::instance()->loadsite()->so->id; } public static function sitemode() { return Config::instance()->loadsite()->so->status; } public static function copywrite() { return '(c) Open Source Billing Development Team'; } } ?>