From 942b923fb40701e34bcac494c1762bc52ed11424 Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Wed, 4 Feb 2009 00:19:34 +0000 Subject: [PATCH] Document append* and prepend* methods. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@275155 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/memcached/memcached/append.xml | 51 ++++++++++------- reference/memcached/memcached/appendbykey.xml | 55 +++++-------------- reference/memcached/memcached/prepend.xml | 51 ++++++++++------- .../memcached/memcached/prependbykey.xml | 55 +++++-------------- 4 files changed, 92 insertions(+), 120 deletions(-) diff --git a/reference/memcached/memcached/append.xml b/reference/memcached/memcached/append.xml index 33269bd988..2b45b8270a 100644 --- a/reference/memcached/memcached/append.xml +++ b/reference/memcached/memcached/append.xml @@ -1,23 +1,33 @@ - + Memcached::append - The append purpose + Append data to an existing item &reftitle.description; - public voidMemcached::append + public boolMemcached::append stringkey stringvalue - stringexpiration - The method description goes here. + Memcached::append appends the given + value string to the value of an existing item. The + reason that value is forced to be a string is + that appending mixed types is not well-defined. + + + If the Memcached::OPT_COMPRESSION is enabled, the + operation will fail and a warning will be issued, because appending + compressed data to a value that is potentially already compressed is not + possible. + + @@ -28,7 +38,7 @@ key - Description... + The key of the item to append the data to. @@ -36,15 +46,7 @@ value - Description... - - - - - expiration - - - Description... + The string to append. @@ -55,7 +57,9 @@ &reftitle.returnvalues; - Description... + &return.success; + The Memcached::getResultCode will return + Memcached::RES_NOTSTORED if the key does not exist. @@ -67,14 +71,20 @@ addServer('localhost', 11211); +$m->setOption(Memcached::OPT_COMPRESSION, false); + +$m->set('foo', 'abc'); +$m->append('foo', 'def'); +var_dump($m->get('foo')); ?> ]]> - &example.outputs.similar; + &example.outputs; @@ -85,7 +95,8 @@ &reftitle.seealso; - Classname::Method + Memcached::appendByKey + Memcached::prepend diff --git a/reference/memcached/memcached/appendbykey.xml b/reference/memcached/memcached/appendbykey.xml index 74a49ee9d9..e8020b49de 100644 --- a/reference/memcached/memcached/appendbykey.xml +++ b/reference/memcached/memcached/appendbykey.xml @@ -1,23 +1,25 @@ - + Memcached::appendByKey - The appendByKey purpose + Append data to an existing item on a specific server &reftitle.description; - public voidMemcached::appendByKey + public boolMemcached::appendByKey stringserver_key stringkey stringvalue - stringexpiration - The method description goes here. + Memcached::appendByKey is functionally equivalent to + Memcached::append, except that the free-form + server_key can be used to map the + key to a specific server. @@ -29,7 +31,7 @@ server_key - Description... + The key identifying the server where the item is. @@ -37,7 +39,7 @@ key - Description... + The key of the item to append the data to. @@ -45,15 +47,7 @@ value - Description... - - - - - expiration - - - Description... + The string to append. @@ -64,29 +58,9 @@ &reftitle.returnvalues; - Description... - - - - - &reftitle.examples; - - - <function>Memcached::appendByKey</function> example - - -]]> - - &example.outputs.similar; - - - - + &return.success; + The Memcached::getResultCode will return + Memcached::RES_NOTSTORED if the key does not exist. @@ -94,7 +68,8 @@ &reftitle.seealso; - Classname::Method + Memcached::append + Memcached::prepend diff --git a/reference/memcached/memcached/prepend.xml b/reference/memcached/memcached/prepend.xml index 076c2c2c1e..a35bb463af 100644 --- a/reference/memcached/memcached/prepend.xml +++ b/reference/memcached/memcached/prepend.xml @@ -1,23 +1,33 @@ - + Memcached::prepend - The prepend purpose + Prepend data to an existing item &reftitle.description; - public voidMemcached::prepend + public boolMemcached::prepend stringkey stringvalue - stringexpiration - The method description goes here. + Memcached::prepend prepends the given + value string to the value of an existing item. The + reason that value is forced to be a string is + that prepending mixed types is not well-defined. + + + If the Memcached::OPT_COMPRESSION is enabled, the + operation will fail and a warning will be issued, because prepending + compressed data to a value that is potentially already compressed is not + possible. + + @@ -28,7 +38,7 @@ key - Description... + The key of the item to prepend the data to. @@ -36,15 +46,7 @@ value - Description... - - - - - expiration - - - Description... + The string to prepend. @@ -55,7 +57,9 @@ &reftitle.returnvalues; - Description... + &return.success; + The Memcached::getResultCode will return + Memcached::RES_NOTSTORED if the key does not exist. @@ -67,14 +71,20 @@ addServer('localhost', 11211); +$m->setOption(Memcached::OPT_COMPRESSION, false); + +$m->set('foo', 'abc'); +$m->prepend('foo', 'def'); +var_dump($m->get('foo')); ?> ]]> - &example.outputs.similar; + &example.outputs; @@ -85,7 +95,8 @@ &reftitle.seealso; - Classname::Method + Memcached::prependByKey + Memcached::append diff --git a/reference/memcached/memcached/prependbykey.xml b/reference/memcached/memcached/prependbykey.xml index 057a55fdcd..39d020f619 100644 --- a/reference/memcached/memcached/prependbykey.xml +++ b/reference/memcached/memcached/prependbykey.xml @@ -1,23 +1,25 @@ - + Memcached::prependByKey - The prependByKey purpose + Prepend data to an existing item on a specific server &reftitle.description; - public voidMemcached::prependByKey + public boolMemcached::prependByKey stringserver_key stringkey stringvalue - stringexpiration - The method description goes here. + Memcached::prependByKey is functionally equivalent to + Memcached::prepend, except that the free-form + server_key can be used to map the + key to a specific server. @@ -29,7 +31,7 @@ server_key - Description... + The key identifying the server where the item is. @@ -37,7 +39,7 @@ key - Description... + The key of the item to prepend the data to. @@ -45,15 +47,7 @@ value - Description... - - - - - expiration - - - Description... + The string to prepend. @@ -64,29 +58,9 @@ &reftitle.returnvalues; - Description... - - - - - &reftitle.examples; - - - <function>Memcached::prependByKey</function> example - - -]]> - - &example.outputs.similar; - - - - + &return.success; + The Memcached::getResultCode will return + Memcached::RES_NOTSTORED if the key does not exist. @@ -94,7 +68,8 @@ &reftitle.seealso; - Classname::Method + Memcached::prepend + Memcached::append