Sha256: 31c4761d050a632881c426c240637df53641793fb8e299550f7f903cd21d0757

Contents?: true

Size: 975 Bytes

Versions: 7

Compression:

Stored size: 975 Bytes

Contents

<?php

namespace Predis\Commands;

class ServerInfoV24x extends ServerInfo {
    public function parseResponse($data) {
        $info      = array();
        $current   = null;
        $infoLines = explode("\r\n", $data, -1);
        foreach ($infoLines as $row) {
            if ($row === '') {
                continue;
            }
            if (preg_match('/^# (\w+)$/', $row, $matches)) {
                $info[$matches[1]] = array();
                $current = &$info[$matches[1]];
                continue;
            }
            list($k, $v) = explode(':', $row);
            if (!preg_match('/^db\d+$/', $k)) {
                if ($k === 'allocation_stats') {
                    $current[$k] = $this->parseAllocationStats($v);
                    continue;
                }
                $current[$k] = $v;
            }
            else {
                $current[$k] = $this->parseDatabaseStats($v);
            }
        }
        return $info;
    }
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
appstats-0.25.1 doc/benchmarks/Predis/Commands/ServerInfoV24x.php
appstats-0.25.0 doc/benchmarks/Predis/Commands/ServerInfoV24x.php
appstats-0.24.0 doc/benchmarks/Predis/Commands/ServerInfoV24x.php
appstats-0.23.5 doc/benchmarks/Predis/Commands/ServerInfoV24x.php
appstats-0.23.4 doc/benchmarks/Predis/Commands/ServerInfoV24x.php
appstats-0.23.3 doc/benchmarks/Predis/Commands/ServerInfoV24x.php
appstats-0.23.2 doc/benchmarks/Predis/Commands/ServerInfoV24x.php