andreiz / php-zookeeper

A PHP extension for interfacing with Apache ZooKeeper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can I get the node stat info?

pupilcp opened this issue · comments

version: 0.6.4
method: public Zookeeper::get ( string $path [, callable $watcher_cb = NULL [, array &$stat = NULL [, int $max_size = 0 ]]] ) : string

Hello, I want to ask how the third param $stat is? Can show me an example?

<?php

$zookeeper = new Zookeeper('localhost:2181');

$stat = [];
$zookeeper->get('/zookeeper', null, $stat);
var_dump($stat);
array(11) {
  ["czxid"]=>
  float(0)
  ["mzxid"]=>
  float(0)
  ["ctime"]=>
  float(0)
  ["mtime"]=>
  float(0)
  ["version"]=>
  int(0)
  ["cversion"]=>
  int(-2)
  ["aversion"]=>
  int(0)
  ["ephemeralOwner"]=>
  float(0)
  ["dataLength"]=>
  int(0)
  ["numChildren"]=>
  int(2)
  ["pzxid"]=>
  float(0)
}
<?php

$zookeeper = new Zookeeper('localhost:2181');

$stat = [];
$zookeeper->get('/zookeeper', null, $stat);
var_dump($stat);
array(11) {
  ["czxid"]=>
  float(0)
  ["mzxid"]=>
  float(0)
  ["ctime"]=>
  float(0)
  ["mtime"]=>
  float(0)
  ["version"]=>
  int(0)
  ["cversion"]=>
  int(-2)
  ["aversion"]=>
  int(0)
  ["ephemeralOwner"]=>
  float(0)
  ["dataLength"]=>
  int(0)
  ["numChildren"]=>
  int(2)
  ["pzxid"]=>
  float(0)
}

Thank you so much!