id == Config::get('metadata.home_page'); } return false; } function is_postspage() { if($itm = IoC::resolve('page')) { return $itm->id == Config::get('metadata.posts_page'); } return false; } function is_debug() { return Config::get('debug', false); } // benchmarking function execution_time() { $miliseconds = microtime(true) - START; return round($miliseconds, 4); } // return in mb function memory_usage() { return memory_get_peak_usage(true) / 1024; } // database profile information function db_profile() { // total query time $total = 0; $html = ''; $html .= ''; $html .= ''; $html .= ''; foreach(Db::profile() as $row) { $html .= ''; $total += $row['time']; } $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= ''; $html .= '
SQLBindingsRowsTime
' . $row['sql'] . '' . implode(', ', $row['binds']) . '' . $row['rows'] . '' . $row['time'] . '
Query Time' . round($total, 4) . '
Execution Time' . execution_time() . '
Memory Usage' . memory_usage() . 'Kb
'; return $html; }