Snc\RedisBundle\Profiler\Storage\RedisProfilerStorage::find PHP Method

find() public method

public find ( $ip, $url, $limit, $method, $start = null, $end = null )
    public function find($ip, $url, $limit, $method, $start = null, $end = null)
    {
        $indexName = $this->getIndexName();
        if (!($indexContent = $this->getValue($indexName, self::REDIS_SERIALIZER_NONE))) {
            return array();
        }
        $profileList = array_reverse(explode("\n", $indexContent));
        $result = array();
        foreach ($profileList as $item) {
            if ($limit === 0) {
                break;
            }
            if ($item == '') {
                continue;
            }
            $values = explode("\t", $item, 7);
            list($itemToken, $itemIp, $itemMethod, $itemUrl, $itemTime, $itemParent) = $values;
            $statusCode = isset($values[6]) ? $values[6] : null;
            $itemTime = (int) $itemTime;
            if ($ip && false === strpos($itemIp, $ip) || $url && false === strpos($itemUrl, $url) || $method && false === strpos($itemMethod, $method)) {
                continue;
            }
            if (!empty($start) && $itemTime < $start) {
                continue;
            }
            if (!empty($end) && $itemTime > $end) {
                continue;
            }
            $result[] = array('token' => $itemToken, 'ip' => $itemIp, 'method' => $itemMethod, 'url' => $itemUrl, 'time' => $itemTime, 'parent' => $itemParent, 'status_code' => $statusCode);
            --$limit;
        }
        return $result;
    }