/** * @inheritdoc */ protected static function _getInstance() { if (!static::$instance) { static::configure(Config::get("cache")); } return static::$instance; }
protected static function init() { if (is_null(static::$routes)) { static::$routes = new Container(); if ($config = Config::get("routes")) { foreach ($config as $key => $route) { static::add($key, $route["path"], Filter::key("defaults", $route, array()), Filter::key("requisites", $route, array())); } } } }
public static function getInstance() { if (!static::$db) { static::$db = static::factory(Config::get("database")); static::$registerEvents = Config::get("database.registerEvents", true); if (static::$registerEvents) { static::$db->hook("pre_open", function ($h) { Event::fire("sugi.database.pre_open"); }); static::$db->hook("post_open", function ($h) { Event::fire("sugi.database.post_open"); }); static::$db->hook("pre_query", function ($h, $query) { Event::fire("sugi.database.pre_query", array("query" => $query)); }); static::$db->hook("post_query", function ($h, $query) { Event::fire("sugi.database.post_query", array("query" => $query)); }); } } return static::$db; }
public function testFileNotFound() { $this->assertNull(Config::get("test99")); }