-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathapciterator.construct.html
More file actions
161 lines (119 loc) · 7.17 KB
/
Copy pathapciterator.construct.html
File metadata and controls
161 lines (119 loc) · 7.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Constructs an APCIterator iterator object</title>
<link media="all" rel="stylesheet" type="text/css" href="../../styles/theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="../../styles/theme-medium.css" />
</head>
<body class="docs"><div class="navbar navbar-fixed-top">
<div class="navbar-inner clearfix">
<ul class="nav" style="width: 100%">
<li style="float: left;"><a href="class.apciterator.html">« APCIterator</a></li>
<li style="float: right;"><a href="apciterator.current.html">APCIterator::current »</a></li>
</ul>
</div>
</div>
<div id="breadcrumbs" class="clearfix">
<ul class="breadcrumbs-container">
<li><a href="index.html">PHP Manual</a></li>
<li><a href="class.apciterator.html">APCIterator</a></li>
<li>Constructs an APCIterator iterator object</li>
</ul>
</div>
<div id="layout">
<div id="layout-content"><div id="apciterator.construct" class="refentry">
<div class="refnamediv">
<h1 class="refname">APCIterator::__construct</h1>
<p class="verinfo">(PECL apc >= 3.1.1)</p><p class="refpurpose"><span class="refname">APCIterator::__construct</span> — <span class="dc-title">Constructs an APCIterator iterator object</span></p>
</div>
<div class="refsect1 description" id="refsect1-apciterator.construct-description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="modifier">public</span> <span class="methodname"><strong>APCIterator::__construct</strong></span>
( <span class="methodparam"><span class="type">string</span> <code class="parameter">$cache</code></span>
[, <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$search</code><span class="initializer"> = <strong><code>NULL</code></strong></span></span>
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$format</code><span class="initializer"> = APC_ITER_ALL</span></span>
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$chunk_size</code><span class="initializer"> = 100</span></span>
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$list</code><span class="initializer"> = APC_LIST_ACTIVE</span></span>
]]]] )</div>
<p class="para rdfs-comment">
Constructs an <a href="class.apciterator.html" class="classname">APCIterator</a> <span class="type"><a href="language.types.object.html" class="type object">object</a></span>.
</p>
</div>
<div class="refsect1 parameters" id="refsect1-apciterator.construct-parameters">
<h3 class="title">Parameters</h3>
<dl>
<dt>
<code class="parameter">cache</code></dt>
<dd>
<p class="para">
The cache type, which will be <code class="literal">user</code> or
<code class="literal">file</code>.
</p>
</dd>
<dt>
<code class="parameter">search</code></dt>
<dd>
<p class="para">
A <a href="book.pcre.html" class="link">PCRE</a> regular expression that
matches against APC key names, either as a <span class="type"><a href="language.types.string.html" class="type string">string</a></span> for
a single regular expression, or as an <span class="type"><a href="language.types.array.html" class="type array">array</a></span> of regular
expressions. Or, optionally pass in <strong><code>NULL</code></strong> to skip the search.
</p>
</dd>
<dt>
<code class="parameter">format</code></dt>
<dd>
<p class="para">
The desired format, as configured with one or more of the
<a href="apc.constants.html" class="link">APC_ITER_*</a> constants.
</p>
</dd>
<dt>
<code class="parameter">chunk_size</code></dt>
<dd>
<p class="para">
The chunk size. Must be a value greater than 0. The default
value is 100.
</p>
</dd>
<dt>
<code class="parameter">list</code></dt>
<dd>
<p class="para">
The type to list. Either pass in <strong><code>APC_LIST_ACTIVE</code></strong>
or <strong><code>APC_LIST_DELETED</code></strong>.
</p>
</dd>
</dl>
</div>
<div class="refsect1 returnvalues" id="refsect1-apciterator.construct-returnvalues">
<h3 class="title">Return Values</h3>
<p class="para">
An <a href="class.apciterator.html" class="classname">APCIterator</a> <span class="type"><a href="language.types.object.html" class="type object">object</a></span> on success,
or <strong><code>NULL</code></strong> on failure.
</p>
</div>
<div class="refsect1 examples" id="refsect1-apciterator.construct-examples">
<h3 class="title">Examples</h3>
<p class="para">
<div class="example" id="example-457">
<p><strong>Example #1 A <span class="function"><strong>APCIterator::__construct()</strong></span> example</strong></p>
<div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB"><?php<br /></span><span style="color: #007700">foreach (new </span><span style="color: #0000BB">APCIterator</span><span style="color: #007700">(</span><span style="color: #DD0000">'user'</span><span style="color: #007700">, </span><span style="color: #DD0000">'/^counter\./'</span><span style="color: #007700">) as </span><span style="color: #0000BB">$counter</span><span style="color: #007700">) {<br /> echo </span><span style="color: #DD0000">"</span><span style="color: #0000BB">$counter</span><span style="color: #007700">[</span><span style="color: #0000BB">key</span><span style="color: #007700">]</span><span style="color: #DD0000">: </span><span style="color: #0000BB">$counter</span><span style="color: #007700">[</span><span style="color: #0000BB">value</span><span style="color: #007700">]</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br /> </span><span style="color: #0000BB">apc_dec</span><span style="color: #007700">(</span><span style="color: #0000BB">$counter</span><span style="color: #007700">[</span><span style="color: #DD0000">'key'</span><span style="color: #007700">], </span><span style="color: #0000BB">$counter</span><span style="color: #007700">[</span><span style="color: #DD0000">'value'</span><span style="color: #007700">]);<br />}<br /></span><span style="color: #0000BB">?></span>
</span>
</code></div>
</div>
</div>
</p>
</div>
<div class="refsect1 seealso" id="refsect1-apciterator.construct-seealso">
<h3 class="title">See Also</h3>
<ul class="simplelist">
<li class="member"><span class="function"><a href="function.apc-exists.html" class="function" rel="rdfs-seeAlso">apc_exists()</a> - Checks if APC key exists</span></li>
<li class="member"><span class="function"><a href="function.apc-cache-info.html" class="function" rel="rdfs-seeAlso">apc_cache_info()</a> - Retrieves cached information from APC's data store</span></li>
</ul>
</div>
</div></div></div></body></html>