cvs: phpdoc-fr /reference/memcache/functions memcache-add.xml memcache-close.xml memcache-connect.xml memcache-decrement.xml memcache-delete.xml
memcache-flush.xml memcache-get.xml memcache-getStats.xml memcache-getVersion.xml memcache-increment.xml memcache-pconnect.xml memcache-replace.xml
memcache-set.xml
| From: | Damien Seguy | Date: | Thu, 30 Sep 2004 13:11:10 +0000 |
| Subject: | cvs: phpdoc-fr /reference/memcache/functions memcache-add.xml memcache-close.xml memcache-connect.xml memcache-decrement.xml memcache-delete.xml memcache-flush.xml memcache-get.xml memcache-getStats.xml memcache-getVersion.xml memcache-increment.xml memcache-pconnect.xml memcache-replace.xml memcache-set.xml |
||
| Groups: | php.doc.fr | ||
| Request: | Send a blank email to doc-fr+get-3508@lists.php.net to get a copy of this message | ||
dams Thu Sep 30 09:11:10 2004 EDT
Added files:
/phpdoc-fr/reference/memcache/functions memcache-add.xml
memcache-close.xml
memcache-connect.xml
memcache-decrement.xml
memcache-delete.xml
memcache-flush.xml
memcache-get.xml
memcache-getStats.xml
memcache-getVersion.xml
memcache-increment.xml
memcache-pconnect.xml
memcache-replace.xml
memcache-set.xml
Log:
switching names
http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-add.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-add.xml +++ phpdoc-fr/reference/memcache/functions/memcache-add.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-add"> <refnamediv> <refname>memcache::add</refname> <refpurpose>Ajout d'un élément au serveur</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::add</methodname> <methodparam><type>string</type><parameter>key</parameter></methodparam> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>flag</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>expire</parameter></methodparam> </methodsynopsis> <para> <function>memcache::add</function> stocke la variable <parameter>var</parameter> avec la clé <parameter>key</parameter> seulement si cette clé n'existe pas encore sur le serveur. <function>memcache::add</function> retourne &false; si cette clé existe déjà. Pour le reste, la fonction <function>memcache::add</function> se comporte de façon similaire à la fonction <function>memcache::set</function>. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_add</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::add</function></title> <programlisting role="php"> <![CDATA[ <?php $memcache_obj = memcache_connect("localhost", 11211); /* API procédurale */ memcache_add($memcache_obj, 'var_key', 'test variable', false, 30); /* API orientée objet */ $memcache_obj->add('var_key', 'test variable', false, 30); ?> ]]> </programlisting> </example> <para> <function>memcache::add</function> retourne &true; en cas de succès ou &false; en cas d'échec. </para> <para> Voir aussi <function>memcache::set</function> et <function>memcache::replace</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-close.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-close.xml +++ phpdoc-fr/reference/memcache/functions/memcache-close.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-close"> <refnamediv> <refname>memcache::close</refname> <refpurpose>Ferme la connexion avec le serveur <literal>Memcache</literal></refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::close</methodname> <void/> </methodsynopsis> <para> <function>memcache::close</function> ferme la connexion au serveur <literal>Memcache</literal>. Cette fonction ne ferme pas les connexions persistantes qui seront fermées uniquement lors du redémarrage du serveur web. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_close</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::close</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); /* faîtes quelque chose ici .. */ memcache_close($memcache_obj); /* API orientée objet */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); /* faîtes quelque chose ici .. */ $memcache_obj->close(); ?> ]]> </programlisting> </example> <para> <function>memcache::close</function> retourne &false; si une erreur survient. </para> <para> Voir aussi <function>memcache::connect</function> et <function>memcache::pconnect</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-connect.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-connect.xml +++ phpdoc-fr/reference/memcache/functions/memcache-connect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-connect"> <refnamediv> <refname>memcache::connect</refname> <refpurpose>Ouvre une connexion avec le serveur <literal>Memcache</literal></refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::connect</methodname> <methodparam><type>string</type><parameter>host</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>port</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>timeout</parameter></methodparam> </methodsynopsis> <para> <function>memcache::connect</function> établie une connexion avec le serveur de cache <literal>Memcache</literal>. Les paramètres <parameter>host</parameter> et <parameter>port</parameter> désignent respectivement l'hôte et le port où le serveur <literal>Memcache</literal> attend des connexions. Le paramètre <parameter>port</parameter> est optionnel, la valeur par défaut est 11211. Vous pouvez également définir un paramètre <parameter>timeout</parameter>, qui sera utiliser lors de la connexion avec les serveur. Faîtes attention si vous changez la valeur par défaut : vous pouvez perdre tous les avantages du système de cache si votre connexion est trop lente. </para> <para> La connexion, qui a été ouverte en utilisant la fonction <function>memcache::connect</function> sera automatiquement fermée à la fin de votre script. Vous pouvez néanmoins la clôre en utilisant la fonction <function>memcache::close</function>. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_connect</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::connect</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); /* API orientée objet */ $memcache = new Memcache; $memcache->connect('memcache_host', 11211); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> Voir aussi <function>memcache::pconnect</function> et <function>memcache::close</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-decrement.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-decrement.xml +++ phpdoc-fr/reference/memcache/functions/memcache-decrement.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-decrement"> <refnamediv> <refname>memcache::decrement</refname> <refpurpose>Décrémente la valeur d'un élément</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>int</type><methodname>memcache::decrement</methodname> <methodparam><type>string</type><parameter>key</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> <function>memcache::decrement</function> décrémente la valeur de l'élément par <parameter>value</parameter>. De la même façon que la fonction <function>memcache::increment</function>, la valeur courante de l'élément est tout d'abord convertie en numérique et seulement ensuite, on soustrait la valeur <parameter>value</parameter>. </para> <para> Le paramètre <parameter>value</parameter> est optionnel. Par défaut, il vaut 1. </para> <note> <para> La nouvelle valeur de l'élément ne peut être inférieure à zéro. </para> </note> <note> <para> N'utilisez pas la fonction <function>memcache::decrement</function> avec les éléments stockés compressés. Dans ce cas, l'appel à la fonction <function>memcache::get</function> échouera. </para> </note> <para> Vous pouvez également utiliser la fonction <function>memcache_decrement</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::decrement</function></title> <programlisting role="php"> <![CDATA[ <?php /* API proécédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); /* decrement item by 2 */ $new_value = memcache_decrement($memcache_obj, 'test_item', 2); /* API orientée objet */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); /* décrémentation de l'élément par 3 */ $new_value = $memcache_obj->decrement('test_item', 3); ?> ]]> </programlisting> </example> <para> <function>memcache::decrement</function> <emphasis>ne crée pas</emphasis> l'élément s'il n'existe pas. </para> <para> <function>memcache::decrement</function> retourne la nouvelle valeur de l'élément en cas de succès ou &false; en cas d'échec. </para> <para> Voir aussi <function>memcache::increment</function> et <function>memcache::replace</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-delete.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-delete.xml +++ phpdoc-fr/reference/memcache/functions/memcache-delete.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-delete"> <refnamediv> <refname>memcache::delete</refname> <refpurpose>Efface un élément du serveur de cache</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::delete</methodname> <methodparam><type>string</type><parameter>key</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>timeout</parameter></methodparam> </methodsynopsis> <para> <function>memcache::delete</function> efface l'élément identifié par la clé <parameter>key</parameter>. Si le paramètre <parameter>timeout</parameter> est spécifié, l'élément expirera après <parameter>timeout</parameter> secondes. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_delete</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::delete</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); /* après 10 secondes, l'élément sera effacé par la serveur de cache */ memcache_delete('key_to_delete', 10); /* API orientée objet */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); ?> ]]> </programlisting> </example> <para> &return.success; </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-flush.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-flush.xml +++ phpdoc-fr/reference/memcache/functions/memcache-flush.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-flush"> <refnamediv> <refname>memcache::flush</refname> <refpurpose>Efface tous les éléments existant sur le serveur de cache</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::flush</methodname> <void/> </methodsynopsis> <para> <function>memcache::flush</function> invalide immédiatement tous les éléments existant sur le serveur de cache. <function>memcache::flush</function> ne libère aucune ressource actuellement, il marque uniquement tous les éléments comme ayant expirés, donc la mémoire occupée sera réutilisée avec de nouveaux éléments. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_flush</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::flush</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); memcache_flush($memcache_obj); /* API orientée objet */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); $memcache_obj->flush(); ?> ]]> </programlisting> </example> <para> &return.success; </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-get.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-get.xml +++ phpdoc-fr/reference/memcache/functions/memcache-get.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-get"> <refnamediv> <refname>memcache::get</refname> <refpurpose>Récupère un élément du serveur de cache</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>mixed</type><methodname>memcache::get</methodname> <methodparam><type>string</type><parameter>key</parameter></methodparam> </methodsynopsis> <para> <function>memcache::get</function> retourne les données précedemment stockées dans l'élément identifié par la clé <parameter>key</parameter> s'il existe sur le serveur au moment de l'appel. </para> <example> <title>Exemple avec <function>memcache::get</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); $var = memcache_get($memcache_obj, 'some_key'); /* API orientée objet */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); $var = $memcache_obj->get('some_key'); ?> ]]> </programlisting> </example> <para> <function>memcache::get</function> retourne &false; en cas d'échec. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-getStats.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-getStats.xml +++ phpdoc-fr/reference/memcache/functions/memcache-getStats.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-getStats"> <refnamediv> <refname>memcache::getstats</refname> <refpurpose>Récupère les statistiques du serveur de cache</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>array</type><methodname>memcache::getstats</methodname> <void/> </methodsynopsis> <para> <function>memcache::getstats</function> retourne un tableau associatif contentant les statistiques du serveur de cache. Les clés du tableau correspondent aux paramètres des statistiques et les valeurs, les valeurs du paramètre. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_get_stats</function>. </para> <para> <function>memcache::getstats</function> retourne &false; en cas d'échec. </para> <para> Voir aussi <function>memcache::getversion</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-getVersion.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-getVersion.xml +++ phpdoc-fr/reference/memcache/functions/memcache-getVersion.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-getVersion"> <refnamediv> <refname>memcache::getversion</refname> <refpurpose>Retourne la version du serveur de cache</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>string</type><methodname>memcache::getversion</methodname> <void/> </methodsynopsis> <para> <function>memcache::getversion</function> retourne une chaîne de caractères représentant le numéro de version du serveur de cache. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_get_version</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::getversion</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); echo memcache_get_version($memcache_obj); /* API orientée objet */ $memcache_obj = new Memcache; echo $memcache_obj->getVersion(); ?> ]]> </programlisting> </example> <para> <function>memcache::getversion</function> retourne &false; si une erreur survient. </para> <para> Voir aussi <function>memcache::getstats</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-increment.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-increment.xml +++ phpdoc-fr/reference/memcache/functions/memcache-increment.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-increment"> <refnamediv> <refname>memcache::increment</refname> <refpurpose>Incrément la valeur d'un élément</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>int</type><methodname>memcache::increment</methodname> <methodparam><type>string</type><parameter>key</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> <function>memcache::increment</function> incrémente la valeur d'un élément identifié par la clé <parameter>key</parameter> par la valeur <parameter>value</parameter>. Si l'élément identifié par la clé <parameter>key</parameter> n'est pas de type numérique et ne peut être converti en nombre, la valeur de cette élément sera défini à <parameter>value</parameter>. </para> <para> Le paramètre <parameter>value</parameter> est optionnel. Par défaut, il vaut 1. </para> <note> <para> N'utilisez pas <function>memcache::increment</function> avec les éléments stockés compressés. Dans ce cas, l'appel à la fonction <function>memcache::get</function> échouera. </para> </note> <para> Vous pouvez également utiliser la fonction <function>memcache_increment</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::increment</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); /* incrémentation du compteur de 2 */ $current_value = memcache_increment($memcache_obj, 'counter', 2); /* API orientée objet */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); /* incrémentation du compteur de 3 */ $current_value = $memcache_obj->increment('counter', 3); ?> ]]> </programlisting> </example> <para> <function>memcache::increment</function> retourne la nouvelle valeur de l'élément en cas de succès ou &false; en cas d'échec. </para> <para> <function>memcache::increment</function> <emphasis>ne crée pas</emphasis> l'élément s'il n'existe pas. </para> <para> Voir aussi <function>memcache::decrement</function> et <function>memcache::replace</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-pconnect.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-pconnect.xml +++ phpdoc-fr/reference/memcache/functions/memcache-pconnect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-pconnect"> <refnamediv> <refname>memcache::pconnect</refname> <refpurpose>Ouvre un connexion persistante à un serveur de cache</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::pconnect</methodname> <methodparam><type>string</type><parameter>host</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>port</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>timeout</parameter></methodparam> </methodsynopsis> <para> <function>memcache::pconnect</function> est similaire à la fonction <function>memcache::connect</function> avec la différence que la connexion sera persistante. Ce type de connexion n'est pas fermé à la fin du script et par la fonction <function>memcache::close</function>. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_pconnect</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::pconnect</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_pconnect('memcache_host', 11211); /* API orientée objet */ $memcache_obj = new Memcache; $memcache_obj->pconnect('memcache_host', 11211); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> Voir aussi <function>memcache::connect</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-replace.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-replace.xml +++ phpdoc-fr/reference/memcache/functions/memcache-replace.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-replace"> <refnamediv> <refname>memcache::replace</refname> <refpurpose>Remplace une valeur d'un élément existant</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::replace</methodname> <methodparam><type>string</type><parameter>key</parameter></methodparam> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>flag</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>expire</parameter></methodparam> </methodsynopsis> <para> <function>memcache::replace</function> est utilisé pour remplacer la valeur d'un élément identifié par la clé <parameter>key</parameter>. Dans le cas où l'élément identifié par la clé <parameter>key</parameter> n'existe pas, la fonction <function>memcache::replace</function> retournera &false;. Pour le reste, la fonction <function>memcache::replace</function> fonctionne de la même façon que la fonction <function>memcache::set</function>. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_replace</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::replace</function></title> <programlisting role="php"> <![CDATA[ <?php $memcache_obj = memcache_connect('memcache_host', 11211); /* API procédurale */ memcache_replace($memcache_obj, "test_key", "some variable", false, 30); /* API orientée objet */ $memcache_obj->replace("test_key", "some variable", false, 30); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> Voir aussi <function>memcache::set</function> et <function>memcache::add</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-set.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-set.xml +++ phpdoc-fr/reference/memcache/functions/memcache-set.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-set"> <refnamediv> <refname>memcache::set</refname> <refpurpose>Stocke des données dans le serveur de cache</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::set</methodname> <methodparam><type>string</type><parameter>key</parameter></methodparam> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>flag</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>expire</parameter></methodparam> </methodsynopsis> <para> <function>memcache::set</function> stocke l'élément <parameter>var</parameter> avec la clé <parameter>key</parameter> sur le serveur de cache. Le paramètre <parameter>expire</parameter> représente le délai en secondes d'expiration de l'élément. S'il vaut 0, l'élément n'expirera jamais (mais le serveur de cache ne garantie pas que cet élément sera toujours stocké, il peut être effacé du cache pour faire de la place à d'autres éléments). </para> <para> Vous pouvez utiliser la constante <constant>MEMCACHE_COMPRESSED</constant> comme valeur du paramètre <parameter>flag</parameter> si vous voulez utiliser la compression à la volée (utilisation de la bibliothèque zlib). </para> <para> Vous pouvez également utiliser la fonction <function>memcache_set</function>. Regardez l'exemple ci-dessous. </para> <note> <para> Souvenez-vous que les ressources (i.e. identifiant de fichiers ou de connexion) ne peuvent pas être stockées dans le cache, car elles ne peuvent pas être représentées linéairement. </para> </note> <example> <title>Exemple avec <function>memcache::set</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ /* connexion au serveur de cache */ $memcache_obj = memcache_connect('memcache_host', 11211); /* définie la valeur de l'élément identifié par la clé 'var_key' ; utilisation de la valeur 0 pour le flag ; la compression n'est pas utilisée ; le délai d'expiration vaut 30 secondes */ memcache_set($memcache_obj, 'var_key', 'quelques variables', 0, 30); echo memcache_get($memcache_obj, 'var_key'); ?> ]]> </programlisting> </example> <example> <title>Exemple avec <function>memcache::set</function></title> <programlisting role="php"> <![CDATA[ <?php /* API orientée objet */ $memcache_obj = new Memcache; /* connexion au serveur de cache */ $memcache->connect('memcache_host', 11211); /* définie la valeur de l'élément identifié par la clé 'var_key' ; utilisation de la compression à la volée ; le délai d'expiration vaut 50 secondes */ $memcache_obj->set('var_key', 'quelques grosses variables', MEMCACHE_COMPRESSED, 50); echo $memcache_obj->get('var_key'); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> Voir aussi <function>memcache::add</function> et <function>memcache::replace</function>. </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:"../../../../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 -->
http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-add.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-add.xml +++ phpdoc-fr/reference/memcache/functions/memcache-add.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-add"> <refnamediv> <refname>memcache::add</refname> <refpurpose>Ajout d'un élément au serveur</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::add</methodname> <methodparam><type>string</type><parameter>key</parameter></methodparam> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>flag</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>expire</parameter></methodparam> </methodsynopsis> <para> <function>memcache::add</function> stocke la variable <parameter>var</parameter> avec la clé <parameter>key</parameter> seulement si cette clé n'existe pas encore sur le serveur. <function>memcache::add</function> retourne &false; si cette clé existe déjà. Pour le reste, la fonction <function>memcache::add</function> se comporte de façon similaire à la fonction <function>memcache::set</function>. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_add</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::add</function></title> <programlisting role="php"> <![CDATA[ <?php $memcache_obj = memcache_connect("localhost", 11211); /* API procédurale */ memcache_add($memcache_obj, 'var_key', 'test variable', false, 30); /* API orientée objet */ $memcache_obj->add('var_key', 'test variable', false, 30); ?> ]]> </programlisting> </example> <para> <function>memcache::add</function> retourne &true; en cas de succès ou &false; en cas d'échec. </para> <para> Voir aussi <function>memcache::set</function> et <function>memcache::replace</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-close.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-close.xml +++ phpdoc-fr/reference/memcache/functions/memcache-close.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-close"> <refnamediv> <refname>memcache::close</refname> <refpurpose>Ferme la connexion avec le serveur <literal>Memcache</literal></refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::close</methodname> <void/> </methodsynopsis> <para> <function>memcache::close</function> ferme la connexion au serveur <literal>Memcache</literal>. Cette fonction ne ferme pas les connexions persistantes qui seront fermées uniquement lors du redémarrage du serveur web. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_close</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::close</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); /* faîtes quelque chose ici .. */ memcache_close($memcache_obj); /* API orientée objet */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); /* faîtes quelque chose ici .. */ $memcache_obj->close(); ?> ]]> </programlisting> </example> <para> <function>memcache::close</function> retourne &false; si une erreur survient. </para> <para> Voir aussi <function>memcache::connect</function> et <function>memcache::pconnect</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-connect.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-connect.xml +++ phpdoc-fr/reference/memcache/functions/memcache-connect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-connect"> <refnamediv> <refname>memcache::connect</refname> <refpurpose>Ouvre une connexion avec le serveur <literal>Memcache</literal></refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::connect</methodname> <methodparam><type>string</type><parameter>host</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>port</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>timeout</parameter></methodparam> </methodsynopsis> <para> <function>memcache::connect</function> établie une connexion avec le serveur de cache <literal>Memcache</literal>. Les paramètres <parameter>host</parameter> et <parameter>port</parameter> désignent respectivement l'hôte et le port où le serveur <literal>Memcache</literal> attend des connexions. Le paramètre <parameter>port</parameter> est optionnel, la valeur par défaut est 11211. Vous pouvez également définir un paramètre <parameter>timeout</parameter>, qui sera utiliser lors de la connexion avec les serveur. Faîtes attention si vous changez la valeur par défaut : vous pouvez perdre tous les avantages du système de cache si votre connexion est trop lente. </para> <para> La connexion, qui a été ouverte en utilisant la fonction <function>memcache::connect</function> sera automatiquement fermée à la fin de votre script. Vous pouvez néanmoins la clôre en utilisant la fonction <function>memcache::close</function>. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_connect</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::connect</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); /* API orientée objet */ $memcache = new Memcache; $memcache->connect('memcache_host', 11211); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> Voir aussi <function>memcache::pconnect</function> et <function>memcache::close</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-decrement.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-decrement.xml +++ phpdoc-fr/reference/memcache/functions/memcache-decrement.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-decrement"> <refnamediv> <refname>memcache::decrement</refname> <refpurpose>Décrémente la valeur d'un élément</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>int</type><methodname>memcache::decrement</methodname> <methodparam><type>string</type><parameter>key</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> <function>memcache::decrement</function> décrémente la valeur de l'élément par <parameter>value</parameter>. De la même façon que la fonction <function>memcache::increment</function>, la valeur courante de l'élément est tout d'abord convertie en numérique et seulement ensuite, on soustrait la valeur <parameter>value</parameter>. </para> <para> Le paramètre <parameter>value</parameter> est optionnel. Par défaut, il vaut 1. </para> <note> <para> La nouvelle valeur de l'élément ne peut être inférieure à zéro. </para> </note> <note> <para> N'utilisez pas la fonction <function>memcache::decrement</function> avec les éléments stockés compressés. Dans ce cas, l'appel à la fonction <function>memcache::get</function> échouera. </para> </note> <para> Vous pouvez également utiliser la fonction <function>memcache_decrement</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::decrement</function></title> <programlisting role="php"> <![CDATA[ <?php /* API proécédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); /* decrement item by 2 */ $new_value = memcache_decrement($memcache_obj, 'test_item', 2); /* API orientée objet */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); /* décrémentation de l'élément par 3 */ $new_value = $memcache_obj->decrement('test_item', 3); ?> ]]> </programlisting> </example> <para> <function>memcache::decrement</function> <emphasis>ne crée pas</emphasis> l'élément s'il n'existe pas. </para> <para> <function>memcache::decrement</function> retourne la nouvelle valeur de l'élément en cas de succès ou &false; en cas d'échec. </para> <para> Voir aussi <function>memcache::increment</function> et <function>memcache::replace</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-delete.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-delete.xml +++ phpdoc-fr/reference/memcache/functions/memcache-delete.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-delete"> <refnamediv> <refname>memcache::delete</refname> <refpurpose>Efface un élément du serveur de cache</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::delete</methodname> <methodparam><type>string</type><parameter>key</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>timeout</parameter></methodparam> </methodsynopsis> <para> <function>memcache::delete</function> efface l'élément identifié par la clé <parameter>key</parameter>. Si le paramètre <parameter>timeout</parameter> est spécifié, l'élément expirera après <parameter>timeout</parameter> secondes. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_delete</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::delete</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); /* après 10 secondes, l'élément sera effacé par la serveur de cache */ memcache_delete('key_to_delete', 10); /* API orientée objet */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); ?> ]]> </programlisting> </example> <para> &return.success; </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-flush.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-flush.xml +++ phpdoc-fr/reference/memcache/functions/memcache-flush.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-flush"> <refnamediv> <refname>memcache::flush</refname> <refpurpose>Efface tous les éléments existant sur le serveur de cache</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::flush</methodname> <void/> </methodsynopsis> <para> <function>memcache::flush</function> invalide immédiatement tous les éléments existant sur le serveur de cache. <function>memcache::flush</function> ne libère aucune ressource actuellement, il marque uniquement tous les éléments comme ayant expirés, donc la mémoire occupée sera réutilisée avec de nouveaux éléments. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_flush</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::flush</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); memcache_flush($memcache_obj); /* API orientée objet */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); $memcache_obj->flush(); ?> ]]> </programlisting> </example> <para> &return.success; </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-get.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-get.xml +++ phpdoc-fr/reference/memcache/functions/memcache-get.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-get"> <refnamediv> <refname>memcache::get</refname> <refpurpose>Récupère un élément du serveur de cache</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>mixed</type><methodname>memcache::get</methodname> <methodparam><type>string</type><parameter>key</parameter></methodparam> </methodsynopsis> <para> <function>memcache::get</function> retourne les données précedemment stockées dans l'élément identifié par la clé <parameter>key</parameter> s'il existe sur le serveur au moment de l'appel. </para> <example> <title>Exemple avec <function>memcache::get</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); $var = memcache_get($memcache_obj, 'some_key'); /* API orientée objet */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); $var = $memcache_obj->get('some_key'); ?> ]]> </programlisting> </example> <para> <function>memcache::get</function> retourne &false; en cas d'échec. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-getStats.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-getStats.xml +++ phpdoc-fr/reference/memcache/functions/memcache-getStats.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-getStats"> <refnamediv> <refname>memcache::getstats</refname> <refpurpose>Récupère les statistiques du serveur de cache</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>array</type><methodname>memcache::getstats</methodname> <void/> </methodsynopsis> <para> <function>memcache::getstats</function> retourne un tableau associatif contentant les statistiques du serveur de cache. Les clés du tableau correspondent aux paramètres des statistiques et les valeurs, les valeurs du paramètre. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_get_stats</function>. </para> <para> <function>memcache::getstats</function> retourne &false; en cas d'échec. </para> <para> Voir aussi <function>memcache::getversion</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-getVersion.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-getVersion.xml +++ phpdoc-fr/reference/memcache/functions/memcache-getVersion.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-getVersion"> <refnamediv> <refname>memcache::getversion</refname> <refpurpose>Retourne la version du serveur de cache</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>string</type><methodname>memcache::getversion</methodname> <void/> </methodsynopsis> <para> <function>memcache::getversion</function> retourne une chaîne de caractères représentant le numéro de version du serveur de cache. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_get_version</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::getversion</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); echo memcache_get_version($memcache_obj); /* API orientée objet */ $memcache_obj = new Memcache; echo $memcache_obj->getVersion(); ?> ]]> </programlisting> </example> <para> <function>memcache::getversion</function> retourne &false; si une erreur survient. </para> <para> Voir aussi <function>memcache::getstats</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-increment.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-increment.xml +++ phpdoc-fr/reference/memcache/functions/memcache-increment.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-increment"> <refnamediv> <refname>memcache::increment</refname> <refpurpose>Incrément la valeur d'un élément</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>int</type><methodname>memcache::increment</methodname> <methodparam><type>string</type><parameter>key</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>value</parameter></methodparam> </methodsynopsis> <para> <function>memcache::increment</function> incrémente la valeur d'un élément identifié par la clé <parameter>key</parameter> par la valeur <parameter>value</parameter>. Si l'élément identifié par la clé <parameter>key</parameter> n'est pas de type numérique et ne peut être converti en nombre, la valeur de cette élément sera défini à <parameter>value</parameter>. </para> <para> Le paramètre <parameter>value</parameter> est optionnel. Par défaut, il vaut 1. </para> <note> <para> N'utilisez pas <function>memcache::increment</function> avec les éléments stockés compressés. Dans ce cas, l'appel à la fonction <function>memcache::get</function> échouera. </para> </note> <para> Vous pouvez également utiliser la fonction <function>memcache_increment</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::increment</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_connect('memcache_host', 11211); /* incrémentation du compteur de 2 */ $current_value = memcache_increment($memcache_obj, 'counter', 2); /* API orientée objet */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); /* incrémentation du compteur de 3 */ $current_value = $memcache_obj->increment('counter', 3); ?> ]]> </programlisting> </example> <para> <function>memcache::increment</function> retourne la nouvelle valeur de l'élément en cas de succès ou &false; en cas d'échec. </para> <para> <function>memcache::increment</function> <emphasis>ne crée pas</emphasis> l'élément s'il n'existe pas. </para> <para> Voir aussi <function>memcache::decrement</function> et <function>memcache::replace</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-pconnect.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-pconnect.xml +++ phpdoc-fr/reference/memcache/functions/memcache-pconnect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-pconnect"> <refnamediv> <refname>memcache::pconnect</refname> <refpurpose>Ouvre un connexion persistante à un serveur de cache</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::pconnect</methodname> <methodparam><type>string</type><parameter>host</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>port</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>timeout</parameter></methodparam> </methodsynopsis> <para> <function>memcache::pconnect</function> est similaire à la fonction <function>memcache::connect</function> avec la différence que la connexion sera persistante. Ce type de connexion n'est pas fermé à la fin du script et par la fonction <function>memcache::close</function>. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_pconnect</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::pconnect</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ $memcache_obj = memcache_pconnect('memcache_host', 11211); /* API orientée objet */ $memcache_obj = new Memcache; $memcache_obj->pconnect('memcache_host', 11211); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> Voir aussi <function>memcache::connect</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-replace.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-replace.xml +++ phpdoc-fr/reference/memcache/functions/memcache-replace.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-replace"> <refnamediv> <refname>memcache::replace</refname> <refpurpose>Remplace une valeur d'un élément existant</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::replace</methodname> <methodparam><type>string</type><parameter>key</parameter></methodparam> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>flag</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>expire</parameter></methodparam> </methodsynopsis> <para> <function>memcache::replace</function> est utilisé pour remplacer la valeur d'un élément identifié par la clé <parameter>key</parameter>. Dans le cas où l'élément identifié par la clé <parameter>key</parameter> n'existe pas, la fonction <function>memcache::replace</function> retournera &false;. Pour le reste, la fonction <function>memcache::replace</function> fonctionne de la même façon que la fonction <function>memcache::set</function>. </para> <para> Vous pouvez également utiliser la fonction <function>memcache_replace</function>. Regardez l'exemple ci-dessous. </para> <example> <title>Exemple avec <function>memcache::replace</function></title> <programlisting role="php"> <![CDATA[ <?php $memcache_obj = memcache_connect('memcache_host', 11211); /* API procédurale */ memcache_replace($memcache_obj, "test_key", "some variable", false, 30); /* API orientée objet */ $memcache_obj->replace("test_key", "some variable", false, 30); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> Voir aussi <function>memcache::set</function> et <function>memcache::add</function>. </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:"../../../../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 --> http://cvs.php.net/co.php/phpdoc-fr/reference/memcache/functions/memcache-set.xml?r=1.1&p=1 Index: phpdoc-fr/reference/memcache/functions/memcache-set.xml +++ phpdoc-fr/reference/memcache/functions/memcache-set.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: yannick Status: ready --> <refentry id="function.Memcache-set"> <refnamediv> <refname>memcache::set</refname> <refpurpose>Stocke des données dans le serveur de cache</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>memcache::set</methodname> <methodparam><type>string</type><parameter>key</parameter></methodparam> <methodparam><type>mixed</type><parameter>var</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>flag</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>expire</parameter></methodparam> </methodsynopsis> <para> <function>memcache::set</function> stocke l'élément <parameter>var</parameter> avec la clé <parameter>key</parameter> sur le serveur de cache. Le paramètre <parameter>expire</parameter> représente le délai en secondes d'expiration de l'élément. S'il vaut 0, l'élément n'expirera jamais (mais le serveur de cache ne garantie pas que cet élément sera toujours stocké, il peut être effacé du cache pour faire de la place à d'autres éléments). </para> <para> Vous pouvez utiliser la constante <constant>MEMCACHE_COMPRESSED</constant> comme valeur du paramètre <parameter>flag</parameter> si vous voulez utiliser la compression à la volée (utilisation de la bibliothèque zlib). </para> <para> Vous pouvez également utiliser la fonction <function>memcache_set</function>. Regardez l'exemple ci-dessous. </para> <note> <para> Souvenez-vous que les ressources (i.e. identifiant de fichiers ou de connexion) ne peuvent pas être stockées dans le cache, car elles ne peuvent pas être représentées linéairement. </para> </note> <example> <title>Exemple avec <function>memcache::set</function></title> <programlisting role="php"> <![CDATA[ <?php /* API procédurale */ /* connexion au serveur de cache */ $memcache_obj = memcache_connect('memcache_host', 11211); /* définie la valeur de l'élément identifié par la clé 'var_key' ; utilisation de la valeur 0 pour le flag ; la compression n'est pas utilisée ; le délai d'expiration vaut 30 secondes */ memcache_set($memcache_obj, 'var_key', 'quelques variables', 0, 30); echo memcache_get($memcache_obj, 'var_key'); ?> ]]> </programlisting> </example> <example> <title>Exemple avec <function>memcache::set</function></title> <programlisting role="php"> <![CDATA[ <?php /* API orientée objet */ $memcache_obj = new Memcache; /* connexion au serveur de cache */ $memcache->connect('memcache_host', 11211); /* définie la valeur de l'élément identifié par la clé 'var_key' ; utilisation de la compression à la volée ; le délai d'expiration vaut 50 secondes */ $memcache_obj->set('var_key', 'quelques grosses variables', MEMCACHE_COMPRESSED, 50); echo $memcache_obj->get('var_key'); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> Voir aussi <function>memcache::add</function> et <function>memcache::replace</function>. </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:"../../../../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 -->