Permalink
Browse files

Fixing issue where Data::append is not really appending. Fixes #3

  • Loading branch information...
mariano committed Jan 10, 2012
1 parent a306cbe commit cafcf42296ea2e092d0c55caeccee9a9c5a9b5fd
Showing with 9 additions and 7 deletions.
  1. +6 −6 extensions/util/Data.php
  2. +3 −1 views/elements/queries.html.php
View
@@ -7,13 +7,13 @@
namespace li3_perf\extensions\util;
class Data extends \lithium\core\StaticObject {
-
+
static $data = array(
'view_vars' => array(),
'queries' => array(),
'timers' => array()
);
-
+
/**
* Sets data.
*/
@@ -24,23 +24,23 @@ static public function set($key=null, $value=null) {
}
return false;
}
-
+
/**
* Appends data.
*/
static public function append($key=null, $value=null) {
if(!empty($key)) {
- static::$data[$key] += $value;
+ static::$data[$key] = array_merge(static::$data[$key], $value);
return true;
}
return false;
}
-
+
/**
* Gets data.
*/
static public function get($key=null) {
return (isset(static::$data[$key])) ? static::$data[$key]:false;
}
}
-?>
+?>
@@ -2,7 +2,9 @@
$total_queries = count($queries);
$total_query_time = 0;
foreach($queries as $query) {
- $total_query_time += $query['explain']['millis'];
+ $total_query_time += !empty($query['explain']['millis']) ?
+ $query['explain']['millis'] :
+ 0;
}
?>
<h2>Queries</h2>

0 comments on commit cafcf42

Please sign in to comment.