[Profiler] [Redis] Fix sort of profiler rows.

This commit is contained in:
Stéphane PY 2013-01-11 11:21:09 +01:00
parent 802426272f
commit 9257b0371c

View File

@ -60,7 +60,7 @@ class RedisProfilerStorage implements ProfilerStorageInterface
return array();
}
$profileList = explode("\n", $indexContent);
$profileList = array_reverse(explode("\n", $indexContent));
$result = array();
foreach ($profileList as $item) {
@ -78,7 +78,7 @@ class RedisProfilerStorage implements ProfilerStorageInterface
continue;
}
$result[$itemToken] = array(
$result[] = array(
'token' => $itemToken,
'ip' => $itemIp,
'method' => $itemMethod,
@ -89,14 +89,6 @@ class RedisProfilerStorage implements ProfilerStorageInterface
--$limit;
}
usort($result, function($a, $b) {
if ($a['time'] === $b['time']) {
return 0;
}
return $a['time'] > $b['time'] ? -1 : 1;
});
return $result;
}