Permalink
Browse files

Merge pull request #4 from mariano/i3

Fixing issue where Data::append is not really appending. Fixes #3
  • Loading branch information...
2 parents a306cbe + cafcf42 commit 8d23a27c9c8c14e45d47bac841125a107b42058d @tmaiaroto committed Jan 10, 2012
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 8d23a27

Please sign in to comment.