]> git.andy128k.dev Git - ipf-template.git/commitdiff
simplify SqlProfiler
authorAndrey Kutejko <andy128k@gmail.com>
Sat, 8 Jun 2013 16:35:08 +0000 (19:35 +0300)
committerAndrey Kutejko <andy128k@gmail.com>
Sat, 8 Jun 2013 16:35:08 +0000 (19:35 +0300)
ipf/template/tag/sql.php

index 9251fcea065680c0cf486f2b744bcf44227bee24..403958177948e038a6ee2138b3eb8da509fcc62f 100644 (file)
@@ -5,10 +5,10 @@ class IPF_Template_Tag_Sql extends IPF_Template_Tag
     function start()
     {
         $profiler = IPF_Project::getInstance()->sqlProfiler;
-        if ($profiler!==null){
+        if ($profiler !== null) {
             echo '<div style="padding:10px; margin:10px; background:#eee; border:1px dashed #888;"><h3>Sql Debug</h3><div style="color:#888">set <i>debug</i> to false in settings project for disable sql profiler</div>';
             $time = 0;
-            foreach ($profiler as $event) {
+            foreach ($profiler->events as $event) {
                 $time += $event->getElapsedSecs();
                 $name = $event->getName();
                 if ($name=='fetch' || $name=='prepare' || $name=='connect')