mirror of
https://github.com/php/doc-es.git
synced 2026-04-29 18:13:18 +02:00
6b0a3f4600
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@331399 c90b9560-bf6c-de11-be94-00142212c4b1
150 lines
4.3 KiB
XML
150 lines
4.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: dc270d6f1898be79414d950bcc5bf64922b721f5 Maintainer: seros Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<refentry xml:id="function.apc-store" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>apc_store</refname>
|
|
<refpurpose>
|
|
Guardar una variable en caché en el almacén de datos
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>apc_store</methodname>
|
|
<methodparam><type>string</type><parameter>key</parameter></methodparam>
|
|
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>ttl</parameter><initializer>0</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>apc_store</methodname>
|
|
<methodparam><type>array</type><parameter>values</parameter></methodparam>
|
|
<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>
|
|
Guarda una variable en caché en el almacén de datos.
|
|
</para>
|
|
<note>
|
|
<simpara>
|
|
A diferencia de otros mecanismos de PHP, las variables almacenadas al usar
|
|
<function>apc_store</function> persistirán entre peticiones (hasta que el
|
|
valor sea eliminado de la caché).
|
|
</simpara>
|
|
</note>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>key</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Almacena la variable usando este nombre. Las claves (<parameter>key</parameter>s) son
|
|
únicas en la caché, por lo que almacenar un segundo valor con la misma clave dada por
|
|
<parameter>key</parameter> sobrescribirá el valor original.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>var</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La variable a almacenar
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>ttl</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Time To Live (Tiempo de Vida); almacena <parameter>var</parameter> en la caché durante
|
|
<parameter>ttl</parameter> segundos. Después de que pase
|
|
<parameter>ttl</parameter>, la variable almacenada será
|
|
expurgada de la caché (en la siguiente solicitud). Si no se proporciona
|
|
<parameter>ttl</parameter> (o si <parameter>ttl</parameter> es
|
|
<literal>0</literal>), el valor persistirá hasta que sea eliminado de la
|
|
caché manualmente, o si no dejará de existir (al limpiar,
|
|
reiniciar, etc.).
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>values</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Nombres en clave, variables en valor.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
La segunda sintaxis devuelve un array con claves de errores.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Un ejemplo de <function>apc_store</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$bar = 'BAR';
|
|
apc_store('foo', $bar);
|
|
var_dump(apc_fetch('foo'));
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
string(3) "BAR"
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>apc_add</function></member>
|
|
<member><function>apc_fetch</function></member>
|
|
<member><function>apc_delete</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|