Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #4 from mariano/i3

Fixing issue where Data::append is not really appending. Fixes #3
  • Loading branch information...
commit 8d23a27c9c8c14e45d47bac841125a107b42058d 2 parents a306cbe + cafcf42
@tmaiaroto authored
Showing with 9 additions and 7 deletions.
  1. +6 −6 extensions/util/Data.php
  2. +3 −1 views/elements/queries.html.php
View
12 extensions/util/Data.php
@@ -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,18 +24,18 @@ 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.
*/
@@ -43,4 +43,4 @@ static public function get($key=null) {
return (isset(static::$data[$key])) ? static::$data[$key]:false;
}
}
-?>
+?>
View
4 views/elements/queries.html.php
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.