php-zookeeper icon indicating copy to clipboard operation
php-zookeeper copied to clipboard

Can I get the node stat info?

Open pupilcp opened this issue 5 years ago • 2 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?

pupilcp avatar Aug 11 '19 11:08 pupilcp

<?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)
}

Timandes avatar Aug 13 '19 01:08 Timandes

<?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!

pupilcp avatar Aug 13 '19 01:08 pupilcp