Document getServer* stuff.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@275232 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Andrei Zmievski 2009-02-05 19:48:23 +00:00
parent 9935eb259a
commit 22b4492ba0
2 changed files with 78 additions and 34 deletions

View file

@ -1,20 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="memcached.getserverbykey" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Memcached::getServerByKey</refname>
<refpurpose>The getServerByKey purpose</refpurpose>
<refpurpose>Map a key to a server</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>Memcached::getServerByKey</methodname>
<modifier>public</modifier> <type>array</type><methodname>Memcached::getServerByKey</methodname>
<methodparam><type>string</type><parameter>server_key</parameter></methodparam>
</methodsynopsis>
<para>
The method description goes here.
<function>Memcached::getServerByKey</function> returns the server that
would be selected by a particular <parameter>server_key</parameter> in all
the <function>Memcached::*ByKey</function> operations.
</para>
</refsect1>
@ -26,7 +28,7 @@
<term><parameter>server_key</parameter></term>
<listitem>
<para>
Description...
The key identifying the server.
</para>
</listitem>
</varlistentry>
@ -37,7 +39,8 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Description...
&return.success;
Use <methodname>Memcached::getResultCode</methodname> if necessary.
</para>
</refsect1>
@ -49,29 +52,54 @@
<programlisting role="php">
<![CDATA[
<?php
/* ... */
$m = new Memcached();
$m->addServers(array(
array('mem1.domain.com', 11211, 40),
array('mem2.domain.com', 11211, 40),
array('mem3.domain.com', 11211, 20),
));
$m->setOption(Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
var_dump($m->getServerByKey('user'));
var_dump($m->getServerByKey('log'));
var_dump($m->getServerByKey('ip'));
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
...
array(3) {
["host"]=>
string(15) "mem3.domain.com"
["port"]=>
int(11211)
["weight"]=>
int(20)
}
array(3) {
["host"]=>
string(15) "mem2.domain.com"
["port"]=>
int(11211)
["weight"]=>
int(40)
}
array(3) {
["host"]=>
string(15) "mem2.domain.com"
["port"]=>
int(11211)
["weight"]=>
int(40)
}
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>Classname::Method</methodname></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,20 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.1 $ -->
<!-- $Revision: 1.2 $ -->
<refentry xml:id="memcached.getserverlist" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Memcached::getServerList</refname>
<refpurpose>The getServerList purpose</refpurpose>
<refpurpose>Get the list of the servers in the pool</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>Memcached::getServerList</methodname>
<modifier>public</modifier> <type>array</type><methodname>Memcached::getServerList</methodname>
<void />
</methodsynopsis>
<para>
The method description goes here.
<function>Memcached::getServerList</function> returns the list of all
servers that are in its server pool.
</para>
</refsect1>
@ -26,7 +27,7 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Description...
The list of all servers in the server pool.
</para>
</refsect1>
@ -38,29 +39,44 @@
<programlisting role="php">
<![CDATA[
<?php
/* ... */
$m = new Memcached();
$m->addServers(array(
array('mem1.domain.com', 11211, 20),
array('mem2.domain.com', 11311, 80),
));
var_dump($m->getServerList());
?>
]]>
</programlisting>
&example.outputs.similar;
&example.outputs;
<screen>
<![CDATA[
...
array(2) {
[0]=>
array(3) {
["host"]=>
string(15) "mem1.domain.com"
["port"]=>
int(11211)
["weight"]=>
int(20)
}
[1]=>
array(3) {
["host"]=>
string(15) "mem2.domain.com"
["port"]=>
int(11311)
["weight"]=>
int(80)
}
}
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>Classname::Method</methodname></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file