public static function show() { if (!defined("ENVIRONMENT") || ENVIRONMENT == "dev") { $performance = self::$endTime - self::$startTime; echo self::styleTime(); echo "<div class='profiler'>" . "Supernova Framework © 2014 :: " . __("Profiler") . " :: " . __("Performance") . ": " . number_format($performance, 4) . " " . __("seconds") . " :: " . __("Memory allocated") . ": " . round(memory_get_usage() / 1024) . "Kb :: " . __("Memory peak") . ": " . round(memory_get_peak_usage() / 1024) . "Kb" . "<br/>" . \Supernova\Debug::showQuery() . "</div>"; } }
private static function getQuery($query, $model) { \Supernova\Debug::logQuery($query); try { if (self::connect()) { $namespace = "\\App\\Model\\" . $model; $result = self::$connection->query($query); $result->setFetchMode(\PDO::FETCH_CLASS, $namespace); $results = array(); while ($row = $result->fetch()) { $results[] = $row; } return $results; } } catch (\PDOException $e) { self::PDOErrors($e); return false; } }
/** * Depurador : muestra depuración de variables en el navegador * @param mixed $str Arreglo o string * @return null */ function debug($str) { \Supernova\Debug::render($str); }