reference/memcached/memcached/get.xml
1d8068ecb070fdc360d750e0c1f3f15796e61ec0
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<refentry xml:id="memcached.get" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
5
4
<refnamediv>
6
5
<refname>Memcached::get</refname>
...
...
@@ -9,19 +8,19 @@
9
8

10
9
<refsect1 role="description">
11
10
&reftitle.description;
12
-
<methodsynopsis>
11
+
<methodsynopsis role="Memcached">
13
12
<modifier>public</modifier> <type>mixed</type><methodname>Memcached::get</methodname>
14
13
<methodparam><type>string</type><parameter>key</parameter></methodparam>
15
-
<methodparam choice="opt"><type>callable</type><parameter>cache_cb</parameter></methodparam>
16
-
<methodparam choice="opt"><type>float</type><parameter role="reference">cas_token</parameter></methodparam>
14
+
<methodparam choice="opt"><type class="union"><type>callable</type><type>null</type></type><parameter>cache_cb</parameter><initializer>&null;</initializer></methodparam>
15
+
<methodparam choice="opt"><type>int</type><parameter>get_flags</parameter><initializer>0</initializer></methodparam>
17
16
</methodsynopsis>
18
17
<para>
19
18
<function>Memcached::get</function> returns the item that was previously
20
19
stored under the <parameter>key</parameter>. If the item is found and
21
-
<parameter>cas_token</parameter> variable is provided, it will contain the
22
-
CAS token value for the item. See
23
-
<methodname>Memcached::cas</methodname> for how to use CAS tokens. <link
24
-
linkend="memcached.callbacks">Read-through caching callback</link> may be
20
+
the <parameter>get_flags</parameter> is given <constant>Memcached::GET_EXTENDED</constant>,
21
+
it will also return the CAS token value for the item. See
22
+
<methodname>Memcached::cas</methodname> for how to use CAS tokens.
23
+
<link linkend="memcached.callbacks">Read-through caching callback</link> may be
25
24
specified via <parameter>cache_cb</parameter> parameter.
26
25
</para>
27
26
<para>
...
...
@@ -49,10 +48,11 @@
49
48
</listitem>
50
49
</varlistentry>
51
50
<varlistentry>
52
-
<term><parameter>cas_token</parameter></term>
51
+
<term><parameter>get_flags</parameter></term>
53
52
<listitem>
54
53
<para>
55
-
The variable to store the CAS token in.
54
+
Flags to control the returned result. When <constant>Memcached::GET_EXTENDED</constant>
55
+
is given, the function will also return the CAS token.
56
56
</para>
57
57
</listitem>
58
58
</varlistentry>
...
...
@@ -64,11 +64,36 @@
64
64
&reftitle.returnvalues;
65
65
<para>
66
66
Returns the value stored in the cache or &false; otherwise.
67
+
If the <parameter>get_flags</parameter> is set to <constant>Memcached::GET_EXTENDED</constant>,
68
+
an array containing the value and the CAS token is returned instead of only the value.
67
69
The <methodname>Memcached::getResultCode</methodname> will return
68
70
<constant>Memcached::RES_NOTFOUND</constant> if the key does not exist.
69
71
</para>
70
72
</refsect1>
71
73

74
+
<refsect1 role="changelog">
75
+
&reftitle.changelog;
76
+
<informaltable>
77
+
<tgroup cols="2">
78
+
<thead>
79
+
<row>
80
+
<entry>&Version;</entry>
81
+
<entry>&Description;</entry>
82
+
</row>
83
+
</thead>
84
+
<tbody>
85
+
<row>
86
+
<entry>PECL memcached 3.0.0</entry>
87
+
<entry>
88
+
The <parameter role="reference">cas_token</parameter> parameter was removed.
89
+
Instead <parameter>get_flags</parameter> was added and when it is given the value of <constant>Memcached::GET_EXTENDED</constant> it will ensure the CAS token to be fetched.
90
+
</entry>
91
+
</row>
92
+
</tbody>
93
+
</tgroup>
94
+
</informaltable>
95
+
</refsect1>
96
+

72
97
<refsect1 role="examples">
73
98
&reftitle.examples;
74
99
<para>
...
...
@@ -128,7 +153,6 @@ if (!($ip = $m->get('ip_block'))) {
128
153
</refsect1>
129
154

130
155
</refentry>
131
-

132
156
<!-- Keep this comment at the end of the file
133
157
Local variables:
134
158
mode: sgml
135
159