예제 #1
0
 public static function show()
 {
     if (!defined("ENVIRONMENT") || ENVIRONMENT == "dev") {
         $performance = self::$endTime - self::$startTime;
         echo self::styleTime();
         echo "<div class='profiler'>" . "Supernova Framework &copy; 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>";
     }
 }
예제 #2
0
파일: Sql.php 프로젝트: enspdf/SupernovaPHP
 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;
     }
 }
예제 #3
0
/**
 * Depurador : muestra depuración de variables en el navegador
 * @param  mixed $str Arreglo o string
 * @return null
 */
function debug($str)
{
    \Supernova\Debug::render($str);
}