1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-23 23:32:18 +01:00

apcu: fix XML by converting para to simpara tags via script (#5154)

This commit is contained in:
Gina Peter Banyard
2026-01-18 23:13:19 +00:00
committed by GitHub
parent 876a6a3931
commit 804d8a0545
27 changed files with 245 additions and 279 deletions

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<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">
<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">
<title>The APCUIterator class</title>
<titleabbrev>APCUIterator</titleabbrev>
@@ -11,14 +10,14 @@
<!-- {{{ APCUIterator intro -->
<section xml:id="apcuiterator.intro">
&reftitle.intro;
<para>
<simpara>
The <classname>APCUIterator</classname> class makes it easier to iterate
over large APCu caches. This is helpful as it allows iterating over large
caches in steps, while grabbing a defined number of entries per lock instance,
so it frees the cache locks for other activities rather than hold up the
entire cache to grab 100 (the default) entries. Also, using regular expression
matching is more efficient as it's been moved to the C level.
</para>
</simpara>
</section>
<!-- }}} -->
@@ -34,14 +33,14 @@
<ooclass>
<classname>APCUIterator</classname>
</ooclass>
<oointerface>
<interfacename>Iterator</interfacename>
</oointerface>
</classsynopsisinfo>
<!-- }}} -->
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.apcuiterator')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[not(@role='procedural')])">
<xi:fallback/>
@@ -60,7 +59,6 @@
&reference.apcu.entities.apcuiterator;
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -15,9 +15,9 @@
<methodparam choice="opt"><type>int</type><parameter>chunk_size</parameter><initializer>100</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>list</parameter><initializer>APC_LIST_ACTIVE</initializer></methodparam>
</constructorsynopsis>
<para>
<simpara>
Constructs an <classname>APCUIterator</classname> <type>object</type>.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -26,39 +26,39 @@
<varlistentry>
<term><parameter>search</parameter></term>
<listitem>
<para>
<simpara>
Either a <link linkend="book.pcre">PCRE</link> regular expression that
matches against APCu key names, given as a &string;.
Or an &array; of &string;s with APCu key names.
Or, optionally &null; to skip the search.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>format</parameter></term>
<listitem>
<para>
<simpara>
The desired format, as configured with one or more of the
<link linkend="apcu.constants">APC_ITER_*</link> constants.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>chunk_size</parameter></term>
<listitem>
<para>
<simpara>
The chunk size. Must be a value greater than 0. The default
value is 100.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>list</parameter></term>
<listitem>
<para>
<simpara>
The type to list. Either pass in <constant>APC_LIST_ACTIVE</constant>
or <constant>APC_LIST_DELETED</constant>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="apcuiterator.current" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="apcuiterator.current">
<refnamediv>
<refname>APCUIterator::current</refname>
<refpurpose>Get current item</refpurpose>
@@ -11,11 +10,11 @@
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>mixed</type><methodname>APCUIterator::current</methodname>
<void />
<void/>
</methodsynopsis>
<para>
<simpara>
Gets the current item from the <classname>APCUIterator</classname> stack.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -25,10 +24,10 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns the current item on success, or &false; if no
more items or exist, or on failure.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
@@ -40,7 +39,6 @@
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="apcuiterator.gettotalcount" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="apcuiterator.gettotalcount">
<refnamediv>
<refname>APCUIterator::getTotalCount</refname>
<refpurpose>Get total count</refpurpose>
@@ -11,11 +10,11 @@
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>int</type><methodname>APCUIterator::getTotalCount</methodname>
<void />
<void/>
</methodsynopsis>
<para>
<simpara>
Get the total count.
</para>
</simpara>
&warn.undocumented.func;
@@ -28,9 +27,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
The total count.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
@@ -43,7 +42,6 @@
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="apcuiterator.gettotalhits" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="apcuiterator.gettotalhits">
<refnamediv>
<refname>APCUIterator::getTotalHits</refname>
<refpurpose>Get total cache hits</refpurpose>
@@ -11,11 +10,11 @@
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>int</type><methodname>APCUIterator::getTotalHits</methodname>
<void />
<void/>
</methodsynopsis>
<para>
<simpara>
Gets the total number of cache hits.
</para>
</simpara>
&warn.undocumented.func;
@@ -28,9 +27,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
The number of hits on success, or &false; on failure.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
@@ -43,7 +42,6 @@
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="apcuiterator.gettotalsize" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="apcuiterator.gettotalsize">
<refnamediv>
<refname>APCUIterator::getTotalSize</refname>
<refpurpose>Get total cache size</refpurpose>
@@ -11,11 +10,11 @@
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>int</type><methodname>APCUIterator::getTotalSize</methodname>
<void />
<void/>
</methodsynopsis>
<para>
<simpara>
Gets the total cache size.
</para>
</simpara>
&warn.undocumented.func;
@@ -28,9 +27,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
The total cache size.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
@@ -43,7 +42,6 @@
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="apcuiterator.key" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="apcuiterator.key">
<refnamediv>
<refname>APCUIterator::key</refname>
<refpurpose>Get iterator key</refpurpose>
@@ -11,11 +10,11 @@
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>string</type><methodname>APCUIterator::key</methodname>
<void />
<void/>
</methodsynopsis>
<para>
<simpara>
Gets the current iterator key.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -25,9 +24,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns the key on success, or &false; upon failure.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
@@ -39,7 +38,6 @@
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="apcuiterator.next" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="apcuiterator.next">
<refnamediv>
<refname>APCUIterator::next</refname>
<refpurpose>Move pointer to next item</refpurpose>
@@ -11,11 +10,11 @@
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>bool</type><methodname>APCUIterator::next</methodname>
<void />
<void/>
</methodsynopsis>
<para>
<simpara>
Moves the iterator pointer to the next element.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -25,9 +24,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.success;
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
@@ -40,7 +39,6 @@
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="apcuiterator.rewind" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="apcuiterator.rewind">
<refnamediv>
<refname>APCUIterator::rewind</refname>
<refpurpose>Rewinds iterator</refpurpose>
@@ -11,11 +10,11 @@
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>void</type><methodname>APCUIterator::rewind</methodname>
<void />
<void/>
</methodsynopsis>
<para>
<simpara>
Rewinds back the iterator to the first element.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -25,9 +24,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.void;
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
@@ -39,7 +38,6 @@
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="apcuiterator.valid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="apcuiterator.valid">
<refnamediv>
<refname>APCUIterator::valid</refname>
<refpurpose>Checks if current position is valid</refpurpose>
@@ -11,11 +10,11 @@
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>bool</type><methodname>APCUIterator::valid</methodname>
<void />
<void/>
</methodsynopsis>
<para>
<simpara>
Checks if the current iterator position is valid.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -25,9 +24,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns &true; if the current iterator position is valid, otherwise &false;.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
@@ -39,7 +38,6 @@
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -1,29 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<book xml:id="book.apcu" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="book.apcu">
<?phpdoc extension-membership="pecl" ?>
<title>APC User Cache</title>
<titleabbrev>APCu</titleabbrev>
<preface xml:id="intro.apcu">
&reftitle.intro;
<para>
<simpara>
APCu is an in-memory key-value store for PHP.
Keys are of type &string; and values can be any PHP variables.
APCu only supports userland caching of variables.
</para>
<para>
</simpara>
<simpara>
The APCu cache is per-process on Windows, so when using a process-based
(rather than thread-based) SAPI, it will not be shared between different processes.
</para>
<para>
</simpara>
<simpara>
APCu is APC stripped of opcode caching.
</para>
<para>
</simpara>
<simpara>
The first APCu codebase was versioned 4.0.0, it was forked from the head of the APC master branch at the time.
PHP 7 support is available as of APCu 5.0.0. PHP 8 support is available as of APCu 5.1.19.
</para>
</simpara>
</preface>
&reference.apcu.setup;
@@ -32,7 +31,6 @@
&reference.apcu.apcuiterator;
</book>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
@@ -53,4 +51,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View File

@@ -21,9 +21,9 @@
<methodparam choice="opt"><type>mixed</type><parameter>unused</parameter><initializer>NULL</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>ttl</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
<simpara>
Caches a variable in the data store, only if it's not already stored.
</para>
</simpara>
<note>
<simpara>
Unlike many other mechanisms in PHP, variables stored using
@@ -38,28 +38,28 @@
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
<simpara>
Store the variable using this name. <parameter>key</parameter>s are
cache-unique, so attempting to use <function>apcu_add</function> to
store data with a key that already exists will not overwrite the
existing data, and will instead return &false;. (This is the only
difference between <function>apcu_add</function> and
<function>apcu_store</function>.)
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>var</parameter></term>
<listitem>
<para>
<simpara>
The variable to store
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ttl</parameter></term>
<listitem>
<para>
<simpara>
Time To Live; store <parameter>var</parameter> in the cache for
<parameter>ttl</parameter> seconds. After the
<parameter>ttl</parameter> has passed, the stored variable will be
@@ -68,25 +68,25 @@
<literal>0</literal>), the value will persist until it is removed from
the cache manually, or otherwise fails to exist in the cache (clear,
restart, etc.).
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>values</parameter></term>
<listitem>
<para>
<simpara>
Names in key, variables in value.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns TRUE if something has effectively been added into the cache, FALSE otherwise.
Second syntax returns array with error keys.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">

View File

@@ -13,9 +13,9 @@
<type class="union"><type>array</type><type>false</type></type><methodname>apcu_cache_info</methodname>
<methodparam choice="opt"><type>bool</type><parameter>limited</parameter><initializer>&false;</initializer></methodparam>
</methodsynopsis>
<para>
<simpara>
Retrieves cached information and meta-data from APC's data store.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -24,11 +24,11 @@
<varlistentry>
<term><parameter>limited</parameter></term>
<listitem>
<para>
<simpara>
If <parameter>limited</parameter> is &true;, the
return value will exclude the individual list of cache entries. This
is useful when trying to optimize calls for statistics gathering.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -36,9 +36,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Array of cached data (and meta-data)&return.falseforfailure;
</para>
</simpara>
<note>
<simpara>
<function>apcu_cache_info</function> will raise a warning if it is unable to

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.apcu-cas" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="function.apcu-cas">
<refnamediv>
<refname>apcu_cas</refname>
<refpurpose>Updates an old value with a new value</refpurpose>
@@ -15,11 +14,11 @@
<methodparam><type>int</type><parameter>old</parameter></methodparam>
<methodparam><type>int</type><parameter>new</parameter></methodparam>
</methodsynopsis>
<para>
<function>apcu_cas</function> updates an already existing integer value if the
<parameter>old</parameter> parameter matches the currently stored value
<simpara>
<function>apcu_cas</function> updates an already existing integer value if the
<parameter>old</parameter> parameter matches the currently stored value
with the value of the <parameter>new</parameter> parameter.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -28,25 +27,25 @@
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
<simpara>
The key of the value being updated.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>old</parameter></term>
<listitem>
<para>
<simpara>
The old value (the value currently stored).
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>new</parameter></term>
<listitem>
<para>
<simpara>
The new value to update to.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -55,9 +54,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.success;
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
@@ -107,7 +106,6 @@ $foobar = 1
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -13,9 +13,9 @@
<type>bool</type><methodname>apcu_clear_cache</methodname>
<void/>
</methodsynopsis>
<para>
<simpara>
Clears the cache.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -25,9 +25,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns &true; always
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.apcu-dec" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="function.apcu-dec">
<refnamediv>
<refname>apcu_dec</refname>
<refpurpose>Decrease a stored number</refpurpose>
@@ -16,9 +15,9 @@
<methodparam choice="opt"><type>bool</type><parameter role="reference">success</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>ttl</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
<simpara>
Decreases a stored integer value.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -27,34 +26,34 @@
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
<simpara>
The key of the value being decreased.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>step</parameter></term>
<listitem>
<para>
<simpara>
The step, or value to decrease.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>success</parameter></term>
<listitem>
<para>
<simpara>
Optionally pass the success or fail boolean value to
this referenced variable.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ttl</parameter></term>
<listitem>
<para>
<simpara>
TTL to use if the operation inserts a new value (rather than decrementing an existing one).
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -62,10 +61,10 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns the current value of <parameter>key</parameter>'s value on success,
&return.falseforfailure;
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
@@ -125,7 +124,6 @@ bool(false)
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -13,9 +13,9 @@
<type>mixed</type><methodname>apcu_delete</methodname>
<methodparam><type>mixed</type><parameter>key</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Removes a stored variable from the cache.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -23,22 +23,22 @@
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
<simpara>
A <parameter>key</parameter> used to store the value as a
<type>string</type> for a single key,
or as an <type>array</type> of strings for several keys,
or as an <classname>APCUIterator</classname> <type>object</type>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
If <parameter>key</parameter> is an &array;, an indexed &array; of the keys is returned.
Otherwise &true; is returned on success, or &false; on failure.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.apcu-enabled" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="function.apcu-enabled">
<refnamediv>
<refname>apcu_enabled</refname>
<refpurpose>Whether APCu is usable in the current environment</refpurpose>
@@ -11,11 +10,11 @@
&reftitle.description;
<methodsynopsis role="procedural">
<type>bool</type><methodname>apcu_enabled</methodname>
<void />
<void/>
</methodsynopsis>
<para>
<simpara>
Returns whether APCu is usable in the current environment.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -25,13 +24,12 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns &true; when APCu is usable in the current environment, &false; otherwise.
</para>
</simpara>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -15,11 +15,11 @@
<methodparam><type>callable</type><parameter>callback</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>ttl</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
<simpara>
Atomically attempts to find <parameter>key</parameter> in the cache, if it cannot be found <parameter>callback</parameter>
is called, passing <parameter>key</parameter> as the only argument. The return value of the call is then cached with the optionally specified
<parameter>ttl</parameter>, and returned.
</para>
</simpara>
<note>
<simpara>
When control enters <function>apcu_entry</function> the lock for the cache is acquired exclusively, it is released when control leaves <function>apcu_entry</function>:
@@ -39,23 +39,23 @@
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
<simpara>
Identity of cache entry
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>callback</parameter></term>
<listitem>
<para>
<simpara>
A callable that accepts <parameter>key</parameter> as the only argument and returns the value to cache.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ttl</parameter></term>
<listitem>
<para>
<simpara>
Time To Live; store the <parameter>callback</parameter>'s return value in the cache for
<parameter>ttl</parameter> seconds. After the
<parameter>ttl</parameter> has passed, the stored entry will be
@@ -64,16 +64,16 @@
<literal>0</literal>), the value will persist until it is removed from
the cache manually, or otherwise fails to exist in the cache (clear,
restart, etc.).
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns the cached value
</para>
</simpara>
</refsect1>
<refsect1 role="examples">

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.apcu-exists" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="function.apcu-exists">
<refnamediv>
<refname>apcu_exists</refname>
<refpurpose>Checks if entry exists</refpurpose>
@@ -13,9 +12,9 @@
<type class="union"><type>bool</type><type>array</type></type><methodname>apcu_exists</methodname>
<methodparam><type class="union"><type>string</type><type>array</type></type><parameter>keys</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Checks if one or more APCu entries exist.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -24,10 +23,10 @@
<varlistentry>
<term><parameter>keys</parameter></term>
<listitem>
<para>
<simpara>
A <type>string</type>, or an <type>array</type> of strings, that
contain keys.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -35,12 +34,12 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns &true; if the key exists, otherwise &false; Or if an
<type>array</type> was passed to <parameter>keys</parameter>, then
an array is returned that contains all existing keys, or an empty
array if none exist.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
@@ -102,7 +101,6 @@ array(2) {
</simplelist>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -14,9 +14,9 @@
<methodparam><type>mixed</type><parameter>key</parameter></methodparam>
<methodparam choice="opt"><type>bool</type><parameter role="reference">success</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Fetches an entry from the cache.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -24,28 +24,28 @@
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
<simpara>
The <parameter>key</parameter> used to store the value (with
<function>apcu_store</function>). If an array is passed then each
element is fetched and returned.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>success</parameter></term>
<listitem>
<para>
<simpara>
Set to &true; in success and &false; in failure.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
The stored variable or array of variables on success; &false; on failure
</para>
</simpara>
</refsect1>
<refsect1 role="changelog">

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.apcu-inc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="function.apcu-inc">
<refnamediv>
<refname>apcu_inc</refname>
<refpurpose>Increase a stored number</refpurpose>
@@ -16,9 +15,9 @@
<methodparam choice="opt"><type>bool</type><parameter role="reference">success</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>ttl</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
<simpara>
Increases a stored number.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -27,34 +26,34 @@
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
<simpara>
The key of the value being increased.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>step</parameter></term>
<listitem>
<para>
<simpara>
The step, or value to increase.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>success</parameter></term>
<listitem>
<para>
<simpara>
Optionally pass the success or fail boolean value to
this referenced variable.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ttl</parameter></term>
<listitem>
<para>
<simpara>
TTL to use if the operation inserts a new value (rather than incrementing an existing one).
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -62,10 +61,10 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns the current value of <parameter>key</parameter>'s value on success,
&return.falseforfailure;
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
@@ -124,7 +123,6 @@ bool(false)
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -14,9 +14,9 @@
<type class="union"><type>array</type><type>null</type></type><methodname>apcu_key_info</methodname>
<methodparam><type>string</type><parameter>key</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Get detailed information about the cache key
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -25,9 +25,9 @@
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
<simpara>
Get detailed information about the cache key
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -35,9 +35,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
An array containing the detailed information about the cache key, or &null; if the key does not exist.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">

View File

@@ -13,9 +13,9 @@
<type class="union"><type>array</type><type>false</type></type><methodname>apcu_sma_info</methodname>
<methodparam choice="opt"><type>bool</type><parameter>limited</parameter><initializer>&false;</initializer></methodparam>
</methodsynopsis>
<para>
<simpara>
Retrieves APCu Shared Memory Allocation information.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
@@ -24,10 +24,10 @@
<varlistentry>
<term><parameter>limited</parameter></term>
<listitem>
<para>
<simpara>
When set to &false; (default) <function>apcu_sma_info</function> will
return a detailed information about each segment.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
@@ -35,9 +35,9 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Array of Shared Memory Allocation data; &false; on failure.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">

View File

@@ -21,9 +21,9 @@
<methodparam choice="opt"><type>mixed</type><parameter>unused</parameter><initializer>NULL</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>ttl</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
<simpara>
Cache a variable in the data store.
</para>
</simpara>
<note>
<simpara>
Unlike many other mechanisms in PHP, variables stored using
@@ -38,25 +38,25 @@
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
<simpara>
Store the variable using this name. <parameter>key</parameter>s are
cache-unique, so storing a second value with the same
<parameter>key</parameter> will overwrite the original value.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>var</parameter></term>
<listitem>
<para>
<simpara>
The variable to store
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ttl</parameter></term>
<listitem>
<para>
<simpara>
Time To Live; store <parameter>var</parameter> in the cache for
<parameter>ttl</parameter> seconds. After the
<parameter>ttl</parameter> has passed, the stored variable will be
@@ -65,25 +65,25 @@
<literal>0</literal>), the value will persist until it is removed from
the cache manually, or otherwise fails to exist in the cache (clear,
restart, etc.).
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>values</parameter></term>
<listitem>
<para>
<simpara>
Names in key, variables in value.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.success;
Second syntax returns array with error keys.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">

View File

@@ -3,23 +3,23 @@
<section xmlns="http://docbook.org/ns/docbook" xml:id="apcu.configuration">
&reftitle.runtime;
&extension.runtime;
<para>
<simpara>
Although the default APCu settings are fine for many installations, serious
users should consider tuning the following parameters.
</para>
<para>
</simpara>
<simpara>
There is one decision to be made configuring APCu.
How much memory is going to be allocated to APCu.
The ini directive that controls this is <literal>apc.shm_size</literal>
Read the sections on this carefully below.
</para>
<para>
</simpara>
<simpara>
Once the server is running, the <literal>apc.php</literal> script that
is bundled with the extension should be copied somewhere into the docroot and
viewed with a browser as it provides a detailed analysis of the internal
workings of APCu. If GD is enabled in PHP, it will even display some
interesting graphs.</para>
<para>
interesting graphs.</simpara>
<simpara>
If APCu is working, the <literal>Cache full count
</literal> number (on the left) will display the number of times the cache
has reached maximum capacity and has had to evict entries to free up memory.
@@ -29,21 +29,21 @@
<literal>apc.ttl</literal> seconds. If <literal>apc.ttl</literal> was not set,
or removing expired entries did not free up enough space, APCu will clear the
entire cache.
</para>
<para>
</simpara>
<simpara>
The number of evictions should be minimal in a well-configured cache. If the
cache is constantly being filled, and thusly forcefully freed, the resulting
churning will have disparaging effects on script performance. The easiest way
to minimize this number is to allocate more memory for APCu.
</para>
<para>
</simpara>
<simpara>
When APCu is compiled with mmap support (Memory Mapping), it will use only one
memory segment, unlike when APCu is built with SHM (SysV Shared Memory) support
that uses multiple memory segments. MMAP does not have a maximum limit like SHM
does in <literal>/proc/sys/kernel/shmmax</literal>. In general MMAP support is
recommended because it will reclaim the memory faster when the webserver is
restarted and all in all reduces memory allocation impact at startup.
</para>
</simpara>
<para>
<table>
<title>APCu configuration options</title>
@@ -150,13 +150,13 @@
<type>bool</type>
</term>
<listitem>
<para>
<simpara>
<literal>apc.enabled</literal> can be set to 0 to disable APC. This is
primarily useful when APC is statically compiled
into PHP, since there is no other way to disable
it (when compiled as a DSO, the <literal>extension</literal>
line in <literal>php.ini</literal> can just be commented-out).
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.apcu.shm-segments">
@@ -165,13 +165,13 @@
<type>int</type>
</term>
<listitem>
<para>
<simpara>
The number of shared memory segments to allocate
for the compiler cache. If APC is running out of
shared memory but <literal>apc.shm_size</literal>
is set as high as the system allows, raising
this value might prevent APC from exhausting its memory.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.apcu.shm-size">
@@ -180,13 +180,13 @@
<type>string</type>
</term>
<listitem>
<para>
<simpara>
The size of each shared memory segment given by a shorthand notation as
described in <link linkend="faq.using.shorthandbytes">this FAQ</link>.
By default, some systems (including most BSD
variants) have very low limits on the size of a
shared memory segment.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.apcu.entries-hint">
@@ -195,10 +195,10 @@
<type>int</type>
</term>
<listitem>
<para>
<simpara>
A "hint" about the number of distinct variables that might be stored.
Set to zero or omit if not sure.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.apcu.ttl">
@@ -207,7 +207,7 @@
<type>int</type>
</term>
<listitem>
<para>
<simpara>
Consider cache entries without an explicit TTL to be
expired if they have not been accessed in this many
seconds. Effectively, this allows such entries to be
@@ -217,7 +217,7 @@
they are older than <literal>apc.ttl</literal> seconds.
This setting has no effect on cache entries that have
an explicit TTL specified.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.apcu.gc-ttl">
@@ -226,14 +226,14 @@
<type>int</type>
</term>
<listitem>
<para>
<simpara>
The number of seconds that a cache entry may
remain on the garbage-collection list after being removed or invalidated.
Entries are eligible for removal if their reference count is zero,
or they exceed this time limit.
If set to <literal>0</literal>, time-based cleanup is disabled,
and entries are only removed when their reference count drops to zero.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.apcu.mmap-file-mask">
@@ -242,7 +242,7 @@
<type>string</type>
</term>
<listitem>
<para>
<simpara>
If compiled with MMAP support by using <literal>--enable-mmap</literal>
this is the mktemp-style file_mask to pass to the
mmap module for determining whether your mmap'ed memory
@@ -255,7 +255,7 @@
You can also set it to <literal>/dev/zero</literal> to use your
kernel's <literal>/dev/zero</literal> interface to anonymous mmap'ed
memory. Leaving it undefined will force an anonymous mmap.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.apcu.slam-defense">
@@ -264,7 +264,7 @@
<type>bool</type>
</term>
<listitem>
<para>
<simpara>
On very busy servers whenever you start the server or
modify files you can create a race of many processes
all trying to cache the same file at the same time.
@@ -275,7 +275,7 @@
within a short period by different processes, it skips
the caching for the current process to mitigate potential
cache slams.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.apcu.enable-cli">
@@ -284,13 +284,13 @@
<type>int</type>
</term>
<listitem>
<para>
<simpara>
Mostly for testing and debugging. Setting this enables APC
for the CLI version of PHP. Under normal circumstances, it is
not ideal to create, populate and destroy the APC cache on every
CLI request, but for various test scenarios it is useful to be
able to enable APC for the CLI version of PHP easily.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.apcu.serializer">
@@ -299,9 +299,9 @@
<type>string</type>
</term>
<listitem>
<para>
<simpara>
Used to configure APC to use a third party serializer.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="ini.apcu.coredump-unmap">
@@ -310,28 +310,28 @@
<type>bool</type>
</term>
<listitem>
<para>
<simpara>
Enables APC handling of signals, such as SIGSEGV, that write
core files when signaled. When these signals are received,
APC will attempt to unmap the shared memory segment in order
to exclude it from the core file. This setting may improve
system stability when fatal signals are received and a large
APC shared memory segment is configured.
</para>
</simpara>
<warning>
<para>
<simpara>
This feature is potentially dangerous. Unmapping the shared
memory segment in a fatal signal handler may cause undefined
behaviour if a fatal error occurs.
</para>
</simpara>
</warning>
<note>
<para>
<simpara>
Although some kernels may provide a facility to ignore various
types of shared memory when generating a core dump file, these
implementations may also ignore important shared memory segments
such as the Apache scoreboard.
</para>
</simpara>
</note>
</listitem>
</varlistentry>
@@ -341,10 +341,10 @@
<type>string</type>
</term>
<listitem>
<para>
<simpara>
Optionally, set a path to the directory that APC will load
cache data at startup.
</para>
</simpara>
</listitem>
</varlistentry>
@@ -354,10 +354,10 @@
<type>bool</type>
</term>
<listitem>
<para>
<simpara>
Use the <acronym>SAPI</acronym> request start time for
<acronym>TTL</acronym>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>

View File

@@ -1,28 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<chapter xml:id="apcu.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="apcu.setup">
&reftitle.setup;
<section xml:id="apcu.installation">
&reftitle.install;
<para>
<simpara>
&pecl.info;
<link xlink:href="&url.pecl.package;apcu">&url.pecl.package;apcu</link>.
</para>
</simpara>
<tip>
<simpara>
PHP 7 has a separate module (<link xlink:href="&url.apc.bc;">apcu-bc</link>) for backwards compatibility with APC.
</simpara>
<para>
<simpara>
In backward compatibility mode, APCu registers the applicable APC functions
with backward compatible prototypes.
</para>
<para>
</simpara>
<simpara>
Where an APC function accepted <parameter>cache_type</parameter>, it is simply
ignored by the backward compatible version, and omitted from the prototype for
the APCu version.
</para>
</simpara>
</tip>
<warning>
<simpara>
@@ -46,15 +45,14 @@
</link>.
</simpara>
</note>
<para>
<simpara>
APCu sources can be found <link xlink:href="&url.git.hub;krakjoe/apcu">here</link>.
</para>
</simpara>
</section>
&reference.apcu.ini;
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
@@ -75,4 +73,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->