Skip to content

Commit 8176e73

Browse files
author
timandes
committed
add new example to Zookeeper::get()
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@347843 c90b9560-bf6c-de11-be94-00142212c4b1
1 parent c58ba76 commit 8176e73

File tree

2 files changed

+47
-3
lines changed

2 files changed

+47
-3
lines changed

reference/zookeeper/functions/zookeeper_dispatch.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,7 @@ while(true) {
5858
]]>
5959
</programlisting>
6060
</example>
61-
</refsect1>
6261

63-
<refsect1 role="examples">
64-
&reftitle.examples;
6562
<example xml:id="function.zookeeper-dispatch.example.2">
6663
<title><methodname>zookeeper_dispatch</methodname> example #2</title>
6764
<para>

reference/zookeeper/zookeeper/get.xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,53 @@ else
103103
<screen>
104104
<![CDATA[
105105
nodevalue
106+
]]>
107+
</screen>
108+
</example>
109+
110+
<example xml:id="zookeeper.get.example.stat">
111+
<title><methodname>Zookeeper::get</methodname> stat example</title>
112+
<para>
113+
Get node stat info.
114+
</para>
115+
<programlisting role="php">
116+
<![CDATA[
117+
<?php
118+
$zookeeper = new Zookeeper('localhost:2181');
119+
$path = '/path/to/node';
120+
$stat = [];
121+
$zookeeper->get($path, null, $stat);
122+
var_dump($stat);
123+
?>
124+
]]>
125+
</programlisting>
126+
&example.outputs;
127+
<screen>
128+
<![CDATA[
129+
array(11) {
130+
["czxid"]=>
131+
float(0)
132+
["mzxid"]=>
133+
float(0)
134+
["ctime"]=>
135+
float(0)
136+
["mtime"]=>
137+
float(0)
138+
["version"]=>
139+
int(0)
140+
["cversion"]=>
141+
int(-2)
142+
["aversion"]=>
143+
int(0)
144+
["ephemeralOwner"]=>
145+
float(0)
146+
["dataLength"]=>
147+
int(0)
148+
["numChildren"]=>
149+
int(2)
150+
["pzxid"]=>
151+
float(0)
152+
}
106153
]]>
107154
</screen>
108155
</example>

0 commit comments

Comments
 (0)