/** * Get a database reference. * @static * @param string $index (optional) The database name * @return DB The Referenced database object */ public static function get($index = 'root') { if (empty(self::$db[$index])) { self::$db[$index] = new DB(Config::get('connect_string')); } return self::$db[$index]; }
<?php namespace app; use microsite\core\Config; use microsite\core\RegexRoute; Config::load(array('routes' => array(new RegexRoute('app\\controllers\\Index', 'hello', '#^hello(?:/(?P<name>.+))?#'), new RegexRoute('app\\controllers\\Index', 'index', '#.*#'))));