static function get_instance() { if (system_base_Wet_db_cache::$db === null) { system_base_Wet_db_cache::$db = system_base_Database::get_instance("mysql", null, null, null, null, null, null, null); } return system_base_Wet_db_cache::$db; }
static function main() { $user_method = null; $params = null; $route = null; $user_class = null; $base = system_base_Wet_base::get_instance(); $cache = system_base_Cache::get_instance(); $profiler = system_base_Profiler::get_instance(); $cl = null; try { if (system_base_Router::$instance === null) { system_base_Router::$instance = new system_base_Router(); } $route = system_base_Router::$instance; if (!$route->decode_route()) { if ($route->controller === "_load") { system_base_Cache::load_asset($route->method); } return; } if (Index_0($base, $cache, $cl, $params, $profiler, $route, $user_class, $user_method)) { return; } $cl = Type::resolveClass("system.application.controllers." . _hx_string_or_null($route->controller)); if ($cl === null) { throw new HException(new system_base_Http_exception(_hx_string_or_null($route->controller) . " " . "Not found", 404, _hx_anonymous(array("fileName" => "Index.hx", "lineNumber" => 81, "className" => "Index", "methodName" => "main")))); } else { $user_class = Type::createInstance($cl, new _hx_array(array())); $user_method = Reflect::field($user_class, $route->method); if ($user_method === null) { throw new HException(new system_base_Http_exception(_hx_string_or_null($route->method) . " " . "Not found", 404, _hx_anonymous(array("fileName" => "Index.hx", "lineNumber" => 89, "className" => "Index", "methodName" => "main")))); } else { $user_class->set_params($route->params); Reflect::callMethod($user_class, $user_method, new _hx_array(array())); Reflect::callMethod($user_class, Reflect::field($user_class, "flush"), new _hx_array(array())); } } } catch (Exception $__hx__e) { $_ex_ = $__hx__e instanceof HException ? $__hx__e->e : $__hx__e; if (($e = $_ex_) instanceof system_base_Error) { } else { throw $__hx__e; } } system_base_Database::close(); }
static function close() { if (system_base_Database::$cnx !== null) { system_base_Database::$cnx->close(); } system_base_Cache::disable_db_profiling(); system_base_Database::$cnx = null; system_base_Database::$instance = null; }
static function explain_all() { $profiler = system_base_Profiler::get_instance(); $db = system_base_Database::get_instance(null, null, null, null, null, null, null, null); if (strlen($profiler->get("SEL")->slow_sql) > 1) { system_base_Cache::$profile_buffer->append("<div class=\"__webrathea_debug__\">Webrathea Engine Slow Query Analysys</div>"); system_base_Cache::$profile_buffer->append($db->explain($profiler->get("SEL")->slow_sql, false)); } }