Added getting site config from DB
This commit is contained in:
@@ -1,6 +1,27 @@
|
||||
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||
|
||||
class Config extends lnApp_Config {
|
||||
// Our setup object
|
||||
public $so;
|
||||
|
||||
/**
|
||||
* Load our site configuration from the DB
|
||||
*
|
||||
* We cant do this in __construct(), since Kohana hasn't been fully initialised yet.
|
||||
*/
|
||||
public function loadsite() {
|
||||
// Anti-loop, if we have loaded our record, just return;
|
||||
if ($this->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')));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a list of all database enabled modules
|
||||
*
|
||||
|
Reference in New Issue
Block a user