diff --git a/src/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php index e71f436ba1..e3454f60f9 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php @@ -64,7 +64,7 @@ abstract class BaseMemcacheProfilerStorage implements ProfilerStorageInterface list($itemToken, $itemIp, $itemMethod, $itemUrl, $itemTime, $itemParent) = explode("\t", $item, 6); - $itemTime = (int)$itemTime; + $itemTime = (int) $itemTime; if ($ip && false === strpos($itemIp, $ip) || $url && false === strpos($itemUrl, $url) || $method && false === strpos($itemMethod, $method)) { continue; diff --git a/src/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php index ebf3b5c2ac..91ce381374 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/MemcacheProfilerStorage.php @@ -20,7 +20,6 @@ use Memcache; */ class MemcacheProfilerStorage extends BaseMemcacheProfilerStorage { - /** * @var Memcache */ @@ -106,5 +105,4 @@ class MemcacheProfilerStorage extends BaseMemcacheProfilerStorage return $memcache->set($key, $content . $value, false, $expiration); } - } diff --git a/src/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php index 34ca1cbcad..554a0ac194 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/MemcachedProfilerStorage.php @@ -20,7 +20,6 @@ use Memcached; */ class MemcachedProfilerStorage extends BaseMemcacheProfilerStorage { - /** * @var Memcached */ @@ -101,5 +100,4 @@ class MemcachedProfilerStorage extends BaseMemcacheProfilerStorage return $result; } - } diff --git a/src/Symfony/Component/HttpKernel/Profiler/Profiler.php b/src/Symfony/Component/HttpKernel/Profiler/Profiler.php index f83358fbfe..ea93a24aea 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/Profiler.php +++ b/src/Symfony/Component/HttpKernel/Profiler/Profiler.php @@ -163,29 +163,27 @@ class Profiler * @param string $url The URL * @param string $limit The maximum number of tokens to return * @param string $method The request method - * @param int $start The start period to search from - * @param int $end The end period to search to + * @param string $start The start date to search from + * @param string $end The end date to search to * * @return array An array of tokens + * + * @see http://fr2.php.net/manual/en/datetime.formats.php for the supported date/time formats */ public function find($ip, $url, $limit, $method, $start, $end) { - if ($start != '' && null !== $start) { - if (is_integer($start)) { - $start = '@' . $start; - } - + if ('' != $start && null !== $start) { $start = new \DateTime($start); $start = $start->getTimestamp(); + } else { + $start = null; } - if ($end != '' && null !== $end) { - if (is_integer($end)) { - $end = '@' . $end; - } - + if ('' != $end && null !== $end) { $end = new \DateTime($end); $end = $end->getTimestamp(); + } else { + $end = null; } return $this->storage->find($ip, $url, $limit, $method, $start, $end); diff --git a/src/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php b/src/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php index 9352f9e1d2..3bb0d68ffd 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php +++ b/src/Symfony/Component/HttpKernel/Profiler/ProfilerStorageInterface.php @@ -21,12 +21,12 @@ interface ProfilerStorageInterface /** * Finds profiler tokens for the given criteria. * - * @param string $ip The IP - * @param string $url The URL - * @param string $limit The maximum number of tokens to return - * @param string $method The request method - * @param int $start The start period to search from - * @param int $end The end period to search to + * @param string $ip The IP + * @param string $url The URL + * @param string $limit The maximum number of tokens to return + * @param string $method The request method + * @param int|null $start The start date to search from + * @param int|null $end The end date to search to * * @return array An array of tokens */ diff --git a/src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php b/src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php index 66da718212..1d2df5ccd1 100644 --- a/src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php +++ b/src/Symfony/Component/HttpKernel/Profiler/RedisProfilerStorage.php @@ -74,7 +74,7 @@ class RedisProfilerStorage implements ProfilerStorageInterface list($itemToken, $itemIp, $itemMethod, $itemUrl, $itemTime, $itemParent) = explode("\t", $item, 6); - $itemTime = (int)$itemTime; + $itemTime = (int) $itemTime; if ($ip && false === strpos($itemIp, $ip) || $url && false === strpos($itemUrl, $url) || $method && false === strpos($itemMethod, $method)) { continue;