예제 #1
0
 /**
  * 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];
 }
예제 #2
0
<?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', '#.*#'))));