File tree Expand file tree Collapse file tree 5 files changed +47
-51
lines changed
Expand file tree Collapse file tree 5 files changed +47
-51
lines changed Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
2- <!-- EN-Revision: b1ef3427055358ff6d092ddb0a8b5e748a7bbbb2 Maintainer: haytoo Status: ready -->
2+ <!-- EN-Revision: 804d8a05451c13328eb1192553dcb2374706cabb Maintainer: haytoo Status: ready -->
33<!-- CREDITS: Luffy -->
4- <reference xml : id = " class.apcuiterator " role = " class " xmlns =" http://docbook.org/ns/docbook" xmlns : xlink =" http://www.w3.org/1999/xlink" xmlns : xi =" http://www.w3.org/2001/XInclude" >
4+ <reference xmlns =" http://docbook.org/ns/docbook" xmlns : xlink =" http://www.w3.org/1999/xlink" xmlns : xi =" http://www.w3.org/2001/XInclude" xml : id = " class.apcuiterator " role = " class " >
55
66 <title >APCUIterator 类</title >
77 <titleabbrev >APCUIterator</titleabbrev >
1111<!-- {{{ APCUIterator intro -->
1212 <section xml : id =" apcuiterator.intro" >
1313 &reftitle.intro;
14- <para >
14+ <simpara >
1515 <classname >APCUIterator</classname > 类可以更轻松的迭代大型 APCu 缓存。
1616 它所支持的逐步迭代功能对于遍历大型缓存非常有用,每次加锁后只会获取指定数量(默认 100 条)的缓存条目就会释放锁而非一直锁住整个缓存,以便其他活动对缓存进行操作。
1717 此外,使用正则表达式匹配是更高效的,因为它已经被移到了 C 语言层级(C level)。
18- </para >
18+ </simpara >
1919 </section >
2020<!-- }}} -->
2121
5757 &reference.apcu.entities.apcuiterator;
5858
5959</reference >
60-
6160<!-- Keep this comment at the end of the file
6261Local variables:
6362mode: sgml
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<!-- $Revision$ -->
3- <!-- EN-Revision: cf3cad79fecf14a50718f490574ada9d3725a4f2 Maintainer: avenger Status: ready -->
3+ <!-- EN-Revision: 804d8a05451c13328eb1192553dcb2374706cabb Maintainer: avenger Status: ready -->
44<!-- CREDITS: Luffy, mowangjuanzi -->
5-
6- <book xml : id =" book.apcu" xmlns =" http://docbook.org/ns/docbook" xmlns : xlink =" http://www.w3.org/1999/xlink" >
5+ <book xmlns =" http://docbook.org/ns/docbook" xmlns : xlink =" http://www.w3.org/1999/xlink" xml : id =" book.apcu" >
76 <?phpdoc extension-membership =" pecl" ?>
87 <title >APC 用户缓存</title >
98 <titleabbrev >APCu</titleabbrev >
109
1110 <preface xml : id =" intro.apcu" >
1211 &reftitle.intro;
13- <para >
12+ <simpara >
1413 APCu 是 PHP 版的内存键值存储。
1514 键是 &string; 类型且值可以为 PHP 任何变量。
1615 APCu 仅支持用户空间(userland)级别的变量缓存。
17- </para >
18- <para >
16+ </simpara >
17+ <simpara >
1918 APCu 缓存在 Windows 上是按进程的,所以当使用基于进程(而不是基于线程)的
2019 SAPI 时,它不会在不同的进程之间共享。
21- </para >
22- <para >
20+ </simpara >
21+ <simpara >
2322 APCu 是去除了操作码缓存的 APC。
24- </para >
25- <para >
23+ </simpara >
24+ <simpara >
2625 第一个 APCu 代码库版本是 v4.0.0,是在那时从 APC master 分支中 fork 出来的。
2726 APCu v5.0.0 起提供 PHP 7 支持。自 APCu v5.1.19 起提供 PHP 8 支持。
28- </para >
27+ </simpara >
2928 </preface >
3029
3130 &reference.apcu.setup;
3433 &reference.apcu.apcuiterator;
3534
3635</book >
37-
3836<!-- Keep this comment at the end of the file
3937Local variables:
4038mode: sgml
@@ -55,4 +53,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
5553vim: et tw=78 syn=sgml
5654vi: ts=1 sw=1
5755-->
58-
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
2- <!-- EN-Revision: a706a43f3fa7120bf5bfbe838ed1efe3da127b60 Maintainer: haytoo Status: ready -->
2+ <!-- EN-Revision: 804d8a05451c13328eb1192553dcb2374706cabb Maintainer: haytoo Status: ready -->
33<refentry xmlns =" http://docbook.org/ns/docbook" xml : id =" function.apcu-add" >
44 <refnamediv >
55 <refname >apcu_add</refname >
2121 <methodparam choice =" opt" ><type >mixed</type ><parameter >unused</parameter ><initializer >NULL</initializer ></methodparam >
2222 <methodparam choice =" opt" ><type >int</type ><parameter >ttl</parameter ><initializer >0</initializer ></methodparam >
2323 </methodsynopsis >
24- <para >
24+ <simpara >
2525 将一个从未被缓存过的变量添加到到存储中。
26- </para >
26+ </simpara >
2727 <note >
2828 <simpara >
2929 与 PHP 中常见的变量生命周期不同的是,通过 <function >apcu_add</function > 存储的变量可以在多个 request 之间共享(直到该变量从 cache 中被删除)。
3636 <varlistentry >
3737 <term ><parameter >key</parameter ></term >
3838 <listitem >
39- <para >
39+ <simpara >
4040 使用此名称存储变量。<parameter >key</parameter > 必须是唯一的,因此如果用 <function >apcu_add</function > 存储变量时指定的 key 已经存在, 就会直接返回 &false; ,不会覆写已有的数据。(这也是 <function >apcu_add</function > 和 <function >apcu_store</function > 之间唯一的区别。)
41- </para >
41+ </simpara >
4242 </listitem >
4343 </varlistentry >
4444 <varlistentry >
4545 <term ><parameter >var</parameter ></term >
4646 <listitem >
47- <para >
47+ <simpara >
4848 被存储的变量
49- </para >
49+ </simpara >
5050 </listitem >
5151 </varlistentry >
5252 <varlistentry >
5353 <term ><parameter >ttl</parameter ></term >
5454 <listitem >
55- <para >
55+ <simpara >
5656 变量生存时间(Time To Live);被存储的 <parameter >var</parameter > 经过 <parameter >ttl</parameter > 秒后,会从存储中被删除(下一次请求时)。如果没提供 <parameter >ttl</parameter > (或 <parameter >ttl</parameter > 为 <literal >0</literal > ),该变量会一直存在直到手动删除它,或者其他原因导致该变量从缓存中消失(清除,重启等等。)。
57- </para >
57+ </simpara >
5858 </listitem >
5959 </varlistentry >
6060 <varlistentry >
6161 <term ><parameter >values</parameter ></term >
6262 <listitem >
63- <para >
63+ <simpara >
6464 数组索引作为 key,数组值作为被存储的 var。
65- </para >
65+ </simpara >
6666 </listitem >
6767 </varlistentry >
6868 </variablelist >
6969 </refsect1 >
7070 <refsect1 role =" returnvalues" >
7171 &reftitle.returnvalues;
72- <para >
72+ <simpara >
7373 变量被成功添加时返回 TRUE,否则返回 FALSE。第二种语法返回包含添加失败的 key 的数组。
74- </para >
74+ </simpara >
7575 </refsect1 >
7676
7777 <refsect1 role =" examples" >
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
2- <!-- EN-Revision: a706a43f3fa7120bf5bfbe838ed1efe3da127b60 Maintainer: haytoo Status: ready -->
2+ <!-- EN-Revision: 804d8a05451c13328eb1192553dcb2374706cabb Maintainer: haytoo Status: ready -->
33<refentry xmlns =" http://docbook.org/ns/docbook" xml : id =" function.apcu-cache-info" >
44 <refnamediv >
55 <refname >apcu_cache_info</refname >
1313 <type class =" union" ><type >array</type ><type >false</type ></type ><methodname >apcu_cache_info</methodname >
1414 <methodparam choice =" opt" ><type >bool</type ><parameter >limited</parameter ><initializer >&false; </initializer ></methodparam >
1515 </methodsynopsis >
16- <para >
16+ <simpara >
1717 从 APCu 存储中获取缓存信息和元数据(meta-data)。
18- </para >
18+ </simpara >
1919 </refsect1 >
2020
2121 <refsect1 role =" parameters" >
2424 <varlistentry >
2525 <term ><parameter >limited</parameter ></term >
2626 <listitem >
27- <para >
27+ <simpara >
2828 如果 <parameter >limited</parameter > 为 &true; ,则不会返回具体被缓存的数据的列表,这在尝试根据统计数据进行调用优化时是很有用的。
29- </para >
29+ </simpara >
3030 </listitem >
3131 </varlistentry >
3232 </variablelist >
3333 </refsect1 >
3434
3535 <refsect1 role =" returnvalues" >
3636 &reftitle.returnvalues;
37- <para >
37+ <simpara >
3838 成功时返回包含缓存数据(和元数据)的数组&return.falseforfailure;
39- </para >
39+ </simpara >
4040 <note >
4141 <simpara >
4242 当 <function >apcu_cache_info</function > 无法获取到缓存信息时会触发警告(warning),这种情况通常是因为没有开启 APC 功能。
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
2- <!-- EN-Revision: a706a43f3fa7120bf5bfbe838ed1efe3da127b60 Maintainer: haytoo Status: ready -->
2+ <!-- EN-Revision: 804d8a05451c13328eb1192553dcb2374706cabb Maintainer: haytoo Status: ready -->
33<refentry xmlns =" http://docbook.org/ns/docbook" xml : id =" function.apcu-store" >
44 <refnamediv >
55 <refname >apcu_store</refname >
2121 <methodparam choice =" opt" ><type >mixed</type ><parameter >unused</parameter ><initializer >NULL</initializer ></methodparam >
2222 <methodparam choice =" opt" ><type >int</type ><parameter >ttl</parameter ><initializer >0</initializer ></methodparam >
2323 </methodsynopsis >
24- <para >
24+ <simpara >
2525 缓存一个变量到存储中。
26- </para >
26+ </simpara >
2727 <note >
2828 <simpara >
2929 与 PHP 中常见的变量生命周期不同的是,通过 <function >apcu_store</function > 存储的变量可以在多个 request 之间共享(直到该变量从 cache 中被删除)。
3636 <varlistentry >
3737 <term ><parameter >key</parameter ></term >
3838 <listitem >
39- <para >
39+ <simpara >
4040 使用此名称存储变量。<parameter >key</parameter > 是唯一的,因此当多次使用同样的 <parameter >key</parameter > 存储变量时,后一次会覆盖前一次的值。
41- </para >
41+ </simpara >
4242 </listitem >
4343 </varlistentry >
4444 <varlistentry >
4545 <term ><parameter >var</parameter ></term >
4646 <listitem >
47- <para >
47+ <simpara >
4848 被存储的变量
49- </para >
49+ </simpara >
5050 </listitem >
5151 </varlistentry >
5252 <varlistentry >
5353 <term ><parameter >ttl</parameter ></term >
5454 <listitem >
55- <para >
55+ <simpara >
5656 变量生存时间(Time To Live);被存储的 <parameter >var</parameter > 经过 <parameter >ttl</parameter > 秒后,会从存储中被删除(下一次请求时)。如果没提供 <parameter >ttl</parameter > (或 <parameter >ttl</parameter > 为 <literal >0</literal > ),该变量会一直存在直到手动删除它,或者其他原因导致该变量从缓存中消失(清除,重启等等。)。
57- </para >
57+ </simpara >
5858 </listitem >
5959 </varlistentry >
6060 <varlistentry >
6161 <term ><parameter >values</parameter ></term >
6262 <listitem >
63- <para >
63+ <simpara >
6464 数组索引作为 key,数组值作为被存储的 var。
65- </para >
65+ </simpara >
6666 </listitem >
6767 </varlistentry >
6868 </variablelist >
6969 </refsect1 >
7070 <refsect1 role =" returnvalues" >
7171 &reftitle.returnvalues;
72- <para >
72+ <simpara >
7373 &return.success;
7474 第二种语法返回包含存储失败的 key 的数组。
75- </para >
75+ </simpara >
7676 </refsect1 >
7777
7878 <refsect1 role =" examples" >
You can’t perform that action at this time.
0 commit comments