cvs: phpdoc /en/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 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: | Antony Dovgal | Date: | Tue, 28 Sep 2004 12:23:52 +0000 |
| Subject: | cvs: phpdoc /en/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 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 | ||
| Request: | Send a blank email to phpdoc+get-969364316@lists.php.net to get a copy of this message | ||
tony2001 Tue Sep 28 08:23:52 2004 EDT
Added files:
/phpdoc/en/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
Removed files:
/phpdoc/en/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:
convert all filenames to lowercase
http://cvs.php.net/co.php/phpdoc/en/reference/memcache/functions/memcache-add.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-add.xml +++ phpdoc/en/reference/memcache/functions/memcache-add.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-add"> <refnamediv> <refname>Memcache::add</refname> <refpurpose>Add an item to the server</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> stores variable <parameter>var</parameter> with <parameter>key</parameter> only if such key doesn't exist at the server yet. <function>Memcache::add</function> returns &false; if such key already exist. For the rest <function>Memcache::add</function> behaves similarly to <function>Memcache::set</function>. </para> <para> Also you can use <function>memcache_add</function> function. See example below. </para> <example> <title><function>Memcache::add</function> example</title> <programlisting role="php"> <![CDATA[ <?php $memcache_obj = memcache_connect("localhost", 11211); /* procedural API */ memcache_add($memcache_obj, 'var_key', 'test variable', false, 30); /* OO API */ $memcache_obj->add('var_key', 'test variable', false, 30); ?> ]]> </programlisting> </example> <para> <function>Memcache::add</function> returns &true; on success or &false; on failure. </para> <para> See also <function>Memcache::set</function>, <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/en/reference/memcache/functions/memcache-close.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-close.xml +++ phpdoc/en/reference/memcache/functions/memcache-close.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-close"> <refnamediv> <refname>Memcache::close</refname> <refpurpose>Close memcached server connection</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>Memcache::close</methodname> <void/> </methodsynopsis> <para> <function>Memcache::close</function> closes connection to memcached server. This function doesn't close persistent connections, which are closed only during web-server shutdown/restart. </para> <para> Also you can use <function>memcache_close</function> function. See example below. </para> <example> <title><function>Memcache::close</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); /* do something here .. */ memcache_close($memcache_obj); /* OO API */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); /* do something here .. */ $memcache_obj->close(); ?> ]]> </programlisting> </example> <para> <function>Memcache::close</function> returns &false; if an error occured. </para> <para> See also <function>Memcache::connect</function>, <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/en/reference/memcache/functions/memcache-connect.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-connect.xml +++ phpdoc/en/reference/memcache/functions/memcache-connect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-connect"> <refnamediv> <refname>Memcache::connect</refname> <refpurpose>Open memcached server connection</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> establishes a connection to the memcached server. Parameters <parameter>host</parameter> and <parameter>port</parameter> point to the host and port, where memcached is listening for connections. Parameter <parameter>port</parameter> is optional, it's default value is 11211. Also you can define a <parameter>timeout</parameter>, which will be used when connecting to the daemon. Think twice before changing the default value - you can loose all the advantages of caching if your connection is too slow. </para> <para> The connection, which was opened using <function>Memcache::connect</function> will be automatically closed at the end of script execution. Also you can close it with <function>Memcache::close</function>. </para> <para> Also you can use <function>memcache_connect</function> function. See example below. </para> <example> <title><function>Memcache::connect</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); /* OO API */ $memcache = new Memcache; $memcache->connect('memcache_host', 11211); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> See also <function>Memcache::pconnect</function> and <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/en/reference/memcache/functions/memcache-decrement.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-decrement.xml +++ phpdoc/en/reference/memcache/functions/memcache-decrement.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-decrement"> <refnamediv> <refname>Memcache::decrement</refname> <refpurpose>Decrement item's value</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> decrements value of the item by <parameter>value</parameter>. Similarly to <function>Memcache::increment</function>, current value of the item is being converted to numerical and after that <parameter>value</parameter> is substracted. </para> <para> Parameter <parameter>value</parameter> is optional. It's default is 1. </para> <note> <para> New item's value will not be less than zero. </para> </note> <note> <para> Do not use <function>Memcache::decrement</function> with item, which was stored compressed, because consequent call to <function>Memcache::get</function> will fail. </para> </note> <para> Also you can use <function>memcache_decrement</function> function. See example below. </para> <example> <title><function>Memcache::decrement</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); /* decrement item by 2 */ $new_value = memcache_decrement($memcache_obj, 'test_item', 2); /* OO API */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); /* decrement item by 3 */ $new_value = $memcache_obj->decrement('test_item', 3); ?> ]]> </programlisting> </example> <para> <function>Memcache::decrement</function> <emphasis>does not</emphasis> create an item if it didn't exist. </para> <para> <function>Memcache::decrement</function> returns item's new value on success or &false; on failure. </para> <para> See also <function>Memcache::increment</function>, <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/en/reference/memcache/functions/memcache-delete.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-delete.xml +++ phpdoc/en/reference/memcache/functions/memcache-delete.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-delete"> <refnamediv> <refname>Memcache::delete</refname> <refpurpose>Delete item from the server</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> deletes item with the <parameter>key</parameter>. If parameter <parameter>timeout</parameter> is specified, the item will expire after <parameter>timeout</parameter> seconds. </para> <para> Also you can use <function>memcache_delete</function> function. See example below. </para> <example> <title><function>Memcache::delete</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); /* after 10 seconds item will be deleted by the server */ memcache_delete('key_to_delete', 10); /* OO API */ $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/en/reference/memcache/functions/memcache-flush.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-flush.xml +++ phpdoc/en/reference/memcache/functions/memcache-flush.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-flush"> <refnamediv> <refname>Memcache::flush</refname> <refpurpose>Flush all existing items at the server</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>Memcache::flush</methodname> <void/> </methodsynopsis> <para> <function>Memcache::flush</function> immediately invalidates all existing items. <function>Memcache::flush</function> doesn't actually free any resources, it only marks all the items as expired, so occupied memory will be overwritten by new items. </para> <para> Also you can use <function>memcache_flush</function> function. See example below. </para> <example> <title><function>Memcache::flush</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); memcache_flush($memcache_obj); /* OO API */ $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/en/reference/memcache/functions/memcache-get.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-get.xml +++ phpdoc/en/reference/memcache/functions/memcache-get.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-get"> <refnamediv> <refname>Memcache::get</refname> <refpurpose>Retrieve item from the server</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> returns previously stored data if an item with such <parameter>key</parameter> exists on the server at this moment. </para> <example> <title><function>Memcache::get</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); $var = memcache_get($memcache_obj, 'some_key'); /* OO API */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); $var = $memcache_obj->get('some_key'); ?> ]]> </programlisting> </example> <para> <function>Memcache::get</function> returns &false; on failure. </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/en/reference/memcache/functions/memcache-getstats.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-getstats.xml +++ phpdoc/en/reference/memcache/functions/memcache-getstats.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-getStats"> <refnamediv> <refname>Memcache::getStats</refname> <refpurpose>Get statistics of the server</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>array</type><methodname>Memcache::getStats</methodname> <void/> </methodsynopsis> <para> <function>Memcache::getStats</function> returns an associative array with server's statistics. Array keys correspond to stats parameters and values to parameter's values. </para> <para> Also you can use <function>memcache_get_stats</function> function. </para> <para> <function>Memcache::getStats</function> returns &false; in case of an error. </para> <para> See also <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/en/reference/memcache/functions/memcache-getversion.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-getversion.xml +++ phpdoc/en/reference/memcache/functions/memcache-getversion.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-getVersion"> <refnamediv> <refname>Memcache::getVersion</refname> <refpurpose>Return version of the server</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>string</type><methodname>Memcache::getVersion</methodname> <void/> </methodsynopsis> <para> <function>Memcache::getVersion</function> returns a string with server's version number. </para> <para> Also you can use <function>memcache_get_version</function> function. See example below. </para> <example> <title><function>Memcache::getVersion</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); echo memcache_get_version($memcache_obj); /* OO API */ $memcache_obj = new Memcache; echo $memcache_obj->getVersion(); ?> ]]> </programlisting> </example> <para> <function>Memcache::getVersion</function> returns &false; if an error occured. </para> <para> See also <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/en/reference/memcache/functions/memcache-increment.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-increment.xml +++ phpdoc/en/reference/memcache/functions/memcache-increment.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-increment"> <refnamediv> <refname>Memcache::increment</refname> <refpurpose>Increment item's value</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> increments value of the item on the specified <parameter>value</parameter>. If item with key <parameter>key</parameter> was not numeric and cannot be converted to number, it will change it's value to <parameter>value</parameter>. </para> <para> Parameter <parameter>value</parameter> is optional. It's default value is 1. </para> <note> <para> Do not use <function>Memcache::increment</function> with item, which was stored compressed, because consequent call to <function>Memcache::get</function> will fail. </para> </note> <para> Also you can use <function>memcache_increment</function> function. See example below. </para> <example> <title><function>Memcache::increment</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); /* increment counter by 2 */ $current_value = memcache_increment($memcache_obj, 'counter', 2); /* OO API */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); /* increment counter by 3 */ $current_value = $memcache_obj->increment('counter', 3); ?> ]]> </programlisting> </example> <para> <function>Memcache::increment</function> returns new item's value on success or &false; on failure. </para> <para> <function>Memcache::increment</function> <emphasis>does not</emphasis> create an item if it didn't exist. </para> <para> See also <function>Memcache::decrement</function>, <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/en/reference/memcache/functions/memcache-pconnect.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-pconnect.xml +++ phpdoc/en/reference/memcache/functions/memcache-pconnect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-pconnect"> <refnamediv> <refname>Memcache::pconnect</refname> <refpurpose>Open memcached server persistent connection</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> is similar to <function>Memcache::connect</function> with the difference, that the connection it establishes is persistent. This connection is not closed after the end of script execution and by <function>Memcache::close</function> function. </para> <para> Also you can use <function>memcache_pconnect</function> function. See example below. </para> <example> <title><function>Memcache::pconnect</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_pconnect('memcache_host', 11211); /* OO API */ $memcache_obj = new Memcache; $memcache_obj->pconnect('memcache_host', 11211); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> See also <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/en/reference/memcache/functions/memcache-replace.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-replace.xml +++ phpdoc/en/reference/memcache/functions/memcache-replace.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-replace"> <refnamediv> <refname>Memcache::replace</refname> <refpurpose>Replace value of the existing item</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> should be used to replace value of existing item with <parameter>key</parameter>. In case if item with such key doesn't exists, <function>Memcache::replace</function> returns &false;. For the rest <function>Memcache::replace</function> behaves similarly to <function>Memcache::set</function>. </para> <para> Also you can use <function>memcache_replace</function> function. See example below. </para> <example> <title><function>Memcache::replace</function> example</title> <programlisting role="php"> <![CDATA[ <?php $memcache_obj = memcache_connect('memcache_host', 11211); /* procedural API */ memcache_replace($memcache_obj, "test_key", "some variable", false, 30); /* OO API */ $memcache_obj->replace("test_key", "some variable", false, 30); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> See also <function>Memcache::set</function>, <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/en/reference/memcache/functions/memcache-set.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-set.xml +++ phpdoc/en/reference/memcache/functions/memcache-set.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-set"> <refnamediv> <refname>Memcache::set</refname> <refpurpose>Store data at the server</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> stores an item <parameter>var</parameter> with <parameter>key</parameter> on the memcached server. Parameter <parameter>expire</parameter> is expiration time in seconds. If it's 0, the item never expires (but memcached server doesn't guarantee this item to be stored all the time, it could be deleted from the cache to make place for other items). </para> <para> You can use <constant>MEMCACHE_COMPRESSED</constant> constant as <parameter>flag</parameter> value if you want to use on-the-fly compression (uses zlib). </para> <para> Also you can use <function>memcache_set</function> function. See example below. </para> <note> <para> Remember that resource variables (i.e. file and connection descriptors) cannot be stored in the cache, because they cannot be adequately represented in serialized state. </para> </note> <example> <title><function>Memcache::set</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ /* connect to memcached server */ $memcache_obj = memcache_connect('memcache_host', 11211); /* set value of item with key 'var_key' using 0 as flag value, compression is not used expire time is 30 seconds */ memcache_set($memcache_obj, 'var_key', 'some variable', 0, 30); echo memcache_get($memcache_obj, 'var_key'); ?> ]]> </programlisting> </example> <example> <title><function>Memcache::set</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* OO API */ $memcache_obj = new Memcache; /* connect to memcached server */ $memcache->connect('memcache_host', 11211); /* set value of item with key 'var_key', using on-the-fly compression expire time is 50 seconds */ $memcache_obj->set('var_key', 'some really big variable', MEMCACHE_COMPRESSED, 50); echo $memcache_obj->get('var_key'); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> See also <function>Memcache::add</function>, <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/en/reference/memcache/functions/memcache-add.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-add.xml +++ phpdoc/en/reference/memcache/functions/memcache-add.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-add"> <refnamediv> <refname>Memcache::add</refname> <refpurpose>Add an item to the server</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> stores variable <parameter>var</parameter> with <parameter>key</parameter> only if such key doesn't exist at the server yet. <function>Memcache::add</function> returns &false; if such key already exist. For the rest <function>Memcache::add</function> behaves similarly to <function>Memcache::set</function>. </para> <para> Also you can use <function>memcache_add</function> function. See example below. </para> <example> <title><function>Memcache::add</function> example</title> <programlisting role="php"> <![CDATA[ <?php $memcache_obj = memcache_connect("localhost", 11211); /* procedural API */ memcache_add($memcache_obj, 'var_key', 'test variable', false, 30); /* OO API */ $memcache_obj->add('var_key', 'test variable', false, 30); ?> ]]> </programlisting> </example> <para> <function>Memcache::add</function> returns &true; on success or &false; on failure. </para> <para> See also <function>Memcache::set</function>, <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/en/reference/memcache/functions/memcache-close.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-close.xml +++ phpdoc/en/reference/memcache/functions/memcache-close.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-close"> <refnamediv> <refname>Memcache::close</refname> <refpurpose>Close memcached server connection</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>Memcache::close</methodname> <void/> </methodsynopsis> <para> <function>Memcache::close</function> closes connection to memcached server. This function doesn't close persistent connections, which are closed only during web-server shutdown/restart. </para> <para> Also you can use <function>memcache_close</function> function. See example below. </para> <example> <title><function>Memcache::close</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); /* do something here .. */ memcache_close($memcache_obj); /* OO API */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); /* do something here .. */ $memcache_obj->close(); ?> ]]> </programlisting> </example> <para> <function>Memcache::close</function> returns &false; if an error occured. </para> <para> See also <function>Memcache::connect</function>, <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/en/reference/memcache/functions/memcache-connect.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-connect.xml +++ phpdoc/en/reference/memcache/functions/memcache-connect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-connect"> <refnamediv> <refname>Memcache::connect</refname> <refpurpose>Open memcached server connection</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> establishes a connection to the memcached server. Parameters <parameter>host</parameter> and <parameter>port</parameter> point to the host and port, where memcached is listening for connections. Parameter <parameter>port</parameter> is optional, it's default value is 11211. Also you can define a <parameter>timeout</parameter>, which will be used when connecting to the daemon. Think twice before changing the default value - you can loose all the advantages of caching if your connection is too slow. </para> <para> The connection, which was opened using <function>Memcache::connect</function> will be automatically closed at the end of script execution. Also you can close it with <function>Memcache::close</function>. </para> <para> Also you can use <function>memcache_connect</function> function. See example below. </para> <example> <title><function>Memcache::connect</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); /* OO API */ $memcache = new Memcache; $memcache->connect('memcache_host', 11211); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> See also <function>Memcache::pconnect</function> and <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/en/reference/memcache/functions/memcache-decrement.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-decrement.xml +++ phpdoc/en/reference/memcache/functions/memcache-decrement.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-decrement"> <refnamediv> <refname>Memcache::decrement</refname> <refpurpose>Decrement item's value</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> decrements value of the item by <parameter>value</parameter>. Similarly to <function>Memcache::increment</function>, current value of the item is being converted to numerical and after that <parameter>value</parameter> is substracted. </para> <para> Parameter <parameter>value</parameter> is optional. It's default is 1. </para> <note> <para> New item's value will not be less than zero. </para> </note> <note> <para> Do not use <function>Memcache::decrement</function> with item, which was stored compressed, because consequent call to <function>Memcache::get</function> will fail. </para> </note> <para> Also you can use <function>memcache_decrement</function> function. See example below. </para> <example> <title><function>Memcache::decrement</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); /* decrement item by 2 */ $new_value = memcache_decrement($memcache_obj, 'test_item', 2); /* OO API */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); /* decrement item by 3 */ $new_value = $memcache_obj->decrement('test_item', 3); ?> ]]> </programlisting> </example> <para> <function>Memcache::decrement</function> <emphasis>does not</emphasis> create an item if it didn't exist. </para> <para> <function>Memcache::decrement</function> returns item's new value on success or &false; on failure. </para> <para> See also <function>Memcache::increment</function>, <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/en/reference/memcache/functions/memcache-delete.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-delete.xml +++ phpdoc/en/reference/memcache/functions/memcache-delete.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-delete"> <refnamediv> <refname>Memcache::delete</refname> <refpurpose>Delete item from the server</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> deletes item with the <parameter>key</parameter>. If parameter <parameter>timeout</parameter> is specified, the item will expire after <parameter>timeout</parameter> seconds. </para> <para> Also you can use <function>memcache_delete</function> function. See example below. </para> <example> <title><function>Memcache::delete</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); /* after 10 seconds item will be deleted by the server */ memcache_delete('key_to_delete', 10); /* OO API */ $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/en/reference/memcache/functions/memcache-flush.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-flush.xml +++ phpdoc/en/reference/memcache/functions/memcache-flush.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-flush"> <refnamediv> <refname>Memcache::flush</refname> <refpurpose>Flush all existing items at the server</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>bool</type><methodname>Memcache::flush</methodname> <void/> </methodsynopsis> <para> <function>Memcache::flush</function> immediately invalidates all existing items. <function>Memcache::flush</function> doesn't actually free any resources, it only marks all the items as expired, so occupied memory will be overwritten by new items. </para> <para> Also you can use <function>memcache_flush</function> function. See example below. </para> <example> <title><function>Memcache::flush</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); memcache_flush($memcache_obj); /* OO API */ $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/en/reference/memcache/functions/memcache-get.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-get.xml +++ phpdoc/en/reference/memcache/functions/memcache-get.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-get"> <refnamediv> <refname>Memcache::get</refname> <refpurpose>Retrieve item from the server</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> returns previously stored data if an item with such <parameter>key</parameter> exists on the server at this moment. </para> <example> <title><function>Memcache::get</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); $var = memcache_get($memcache_obj, 'some_key'); /* OO API */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); $var = $memcache_obj->get('some_key'); ?> ]]> </programlisting> </example> <para> <function>Memcache::get</function> returns &false; on failure. </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/en/reference/memcache/functions/memcache-getstats.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-getstats.xml +++ phpdoc/en/reference/memcache/functions/memcache-getstats.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-getStats"> <refnamediv> <refname>Memcache::getStats</refname> <refpurpose>Get statistics of the server</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>array</type><methodname>Memcache::getStats</methodname> <void/> </methodsynopsis> <para> <function>Memcache::getStats</function> returns an associative array with server's statistics. Array keys correspond to stats parameters and values to parameter's values. </para> <para> Also you can use <function>memcache_get_stats</function> function. </para> <para> <function>Memcache::getStats</function> returns &false; in case of an error. </para> <para> See also <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/en/reference/memcache/functions/memcache-getversion.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-getversion.xml +++ phpdoc/en/reference/memcache/functions/memcache-getversion.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-getVersion"> <refnamediv> <refname>Memcache::getVersion</refname> <refpurpose>Return version of the server</refpurpose> </refnamediv> <refsect1> <title>Description</title> <methodsynopsis> <type>string</type><methodname>Memcache::getVersion</methodname> <void/> </methodsynopsis> <para> <function>Memcache::getVersion</function> returns a string with server's version number. </para> <para> Also you can use <function>memcache_get_version</function> function. See example below. </para> <example> <title><function>Memcache::getVersion</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); echo memcache_get_version($memcache_obj); /* OO API */ $memcache_obj = new Memcache; echo $memcache_obj->getVersion(); ?> ]]> </programlisting> </example> <para> <function>Memcache::getVersion</function> returns &false; if an error occured. </para> <para> See also <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/en/reference/memcache/functions/memcache-increment.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-increment.xml +++ phpdoc/en/reference/memcache/functions/memcache-increment.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-increment"> <refnamediv> <refname>Memcache::increment</refname> <refpurpose>Increment item's value</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> increments value of the item on the specified <parameter>value</parameter>. If item with key <parameter>key</parameter> was not numeric and cannot be converted to number, it will change it's value to <parameter>value</parameter>. </para> <para> Parameter <parameter>value</parameter> is optional. It's default value is 1. </para> <note> <para> Do not use <function>Memcache::increment</function> with item, which was stored compressed, because consequent call to <function>Memcache::get</function> will fail. </para> </note> <para> Also you can use <function>memcache_increment</function> function. See example below. </para> <example> <title><function>Memcache::increment</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_connect('memcache_host', 11211); /* increment counter by 2 */ $current_value = memcache_increment($memcache_obj, 'counter', 2); /* OO API */ $memcache_obj = new Memcache; $memcache_obj->connect('memcache_host', 11211); /* increment counter by 3 */ $current_value = $memcache_obj->increment('counter', 3); ?> ]]> </programlisting> </example> <para> <function>Memcache::increment</function> returns new item's value on success or &false; on failure. </para> <para> <function>Memcache::increment</function> <emphasis>does not</emphasis> create an item if it didn't exist. </para> <para> See also <function>Memcache::decrement</function>, <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/en/reference/memcache/functions/memcache-pconnect.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-pconnect.xml +++ phpdoc/en/reference/memcache/functions/memcache-pconnect.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-pconnect"> <refnamediv> <refname>Memcache::pconnect</refname> <refpurpose>Open memcached server persistent connection</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> is similar to <function>Memcache::connect</function> with the difference, that the connection it establishes is persistent. This connection is not closed after the end of script execution and by <function>Memcache::close</function> function. </para> <para> Also you can use <function>memcache_pconnect</function> function. See example below. </para> <example> <title><function>Memcache::pconnect</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ $memcache_obj = memcache_pconnect('memcache_host', 11211); /* OO API */ $memcache_obj = new Memcache; $memcache_obj->pconnect('memcache_host', 11211); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> See also <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/en/reference/memcache/functions/memcache-replace.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-replace.xml +++ phpdoc/en/reference/memcache/functions/memcache-replace.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-replace"> <refnamediv> <refname>Memcache::replace</refname> <refpurpose>Replace value of the existing item</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> should be used to replace value of existing item with <parameter>key</parameter>. In case if item with such key doesn't exists, <function>Memcache::replace</function> returns &false;. For the rest <function>Memcache::replace</function> behaves similarly to <function>Memcache::set</function>. </para> <para> Also you can use <function>memcache_replace</function> function. See example below. </para> <example> <title><function>Memcache::replace</function> example</title> <programlisting role="php"> <![CDATA[ <?php $memcache_obj = memcache_connect('memcache_host', 11211); /* procedural API */ memcache_replace($memcache_obj, "test_key", "some variable", false, 30); /* OO API */ $memcache_obj->replace("test_key", "some variable", false, 30); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> See also <function>Memcache::set</function>, <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/en/reference/memcache/functions/memcache-set.xml?r=1.1&p=1 Index: phpdoc/en/reference/memcache/functions/memcache-set.xml +++ phpdoc/en/reference/memcache/functions/memcache-set.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <refentry id="function.Memcache-set"> <refnamediv> <refname>Memcache::set</refname> <refpurpose>Store data at the server</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> stores an item <parameter>var</parameter> with <parameter>key</parameter> on the memcached server. Parameter <parameter>expire</parameter> is expiration time in seconds. If it's 0, the item never expires (but memcached server doesn't guarantee this item to be stored all the time, it could be deleted from the cache to make place for other items). </para> <para> You can use <constant>MEMCACHE_COMPRESSED</constant> constant as <parameter>flag</parameter> value if you want to use on-the-fly compression (uses zlib). </para> <para> Also you can use <function>memcache_set</function> function. See example below. </para> <note> <para> Remember that resource variables (i.e. file and connection descriptors) cannot be stored in the cache, because they cannot be adequately represented in serialized state. </para> </note> <example> <title><function>Memcache::set</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* procedural API */ /* connect to memcached server */ $memcache_obj = memcache_connect('memcache_host', 11211); /* set value of item with key 'var_key' using 0 as flag value, compression is not used expire time is 30 seconds */ memcache_set($memcache_obj, 'var_key', 'some variable', 0, 30); echo memcache_get($memcache_obj, 'var_key'); ?> ]]> </programlisting> </example> <example> <title><function>Memcache::set</function> example</title> <programlisting role="php"> <![CDATA[ <?php /* OO API */ $memcache_obj = new Memcache; /* connect to memcached server */ $memcache->connect('memcache_host', 11211); /* set value of item with key 'var_key', using on-the-fly compression expire time is 50 seconds */ $memcache_obj->set('var_key', 'some really big variable', MEMCACHE_COMPRESSED, 50); echo $memcache_obj->get('var_key'); ?> ]]> </programlisting> </example> <para> &return.success; </para> <para> See also <function>Memcache::add</function>, <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 -->