[Piwik-svn] r477 - in trunk/modules: . DataTable

svnmaster at piwik.org svnmaster at piwik.org
Sun May 11 21:16:32 CEST 2008


Author: matt
Date: 2008-05-11 21:16:31 +0200 (Sun, 11 May 2008)
New Revision: 477

Modified:
   trunk/modules/DataTable/Row.php
   trunk/modules/Piwik.php
Log:
- fixing bug in sql profiling

Modified: trunk/modules/DataTable/Row.php
===================================================================
--- trunk/modules/DataTable/Row.php	2008-05-11 18:35:43 UTC (rev 476)
+++ trunk/modules/DataTable/Row.php	2008-05-11 19:16:31 UTC (rev 477)
@@ -88,8 +88,8 @@
 	 */
 	public function __destruct()
 	{
-		$idSubtable = $this->getIdSubDataTable();
-		if(!is_null($idSubtable))
+		$idSubtable = $this->c[self::DATATABLE_ASSOCIATED];
+		if($idSubtable !== null)
 		{
 			unset($idSubtable);
 		}

Modified: trunk/modules/Piwik.php
===================================================================
--- trunk/modules/Piwik.php	2008-05-11 18:35:43 UTC (rev 476)
+++ trunk/modules/Piwik.php	2008-05-11 19:16:31 UTC (rev 477)
@@ -270,7 +270,7 @@
 		{
 			if(isset($infoIndexedByQuery[$query->getQuery()]))
 			{
-				$existing =  $indexByQuery[$query->getQuery()];
+				$existing =  $infoIndexedByQuery[$query->getQuery()];
 			}
 			else
 			{
@@ -320,7 +320,9 @@
 				$avgTimeMs = $timeMs / $count;
 				$avgTimeString = " (average = <b>". round($avgTimeMs,1) . "ms</b>)"; 
 			}
-			$query = str_replace(array("\t","\n"), "", $query);
+			$query = str_replace(array("\t","\n","\r\n","\r"), "_toberemoved_", $query);
+			$query = str_replace('_toberemoved__toberemoved_','',$query);
+			$query = str_replace('_toberemoved_', ' ',$query);
 			$output .= "Executed <b>$count</b> time". ($count==1?'':'s') ." in <b>".$timeMs."ms</b> $avgTimeString <pre>\t$query</pre>";
 		}
 		Piwik::log($output);



More information about the Piwik-svn mailing list