From 4de5ce1452e6de014ca2e00366c8954b2adc8faa Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Tue, 3 Feb 2009 21:39:35 +0000 Subject: [PATCH] memcached docs progress. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@275122 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/memcached/book.xml | 3 +- reference/memcached/expiration.xml | 43 ++++++++++++++++ reference/memcached/memcached/add.xml | 5 +- reference/memcached/memcached/addbykey.xml | 5 +- reference/memcached/memcached/delete.xml | 45 ++++++++++------- reference/memcached/memcached/deletebykey.xml | 49 ++++++------------- reference/memcached/memcached/replace.xml | 5 +- .../memcached/memcached/replacebykey.xml | 5 +- reference/memcached/memcached/set.xml | 19 ++++--- reference/memcached/memcached/setbykey.xml | 5 +- reference/memcached/memcached/setmulti.xml | 5 +- .../memcached/memcached/setmultibykey.xml | 5 +- 12 files changed, 119 insertions(+), 75 deletions(-) create mode 100644 reference/memcached/expiration.xml diff --git a/reference/memcached/book.xml b/reference/memcached/book.xml index 773ba9ca40..05e219330b 100644 --- a/reference/memcached/book.xml +++ b/reference/memcached/book.xml @@ -1,5 +1,5 @@ - + Memcached @@ -32,6 +32,7 @@ &reference.memcached.setup; &reference.memcached.constants; &reference.memcached.examples; + &reference.memcached.expiration; &reference.memcached.memcached; diff --git a/reference/memcached/expiration.xml b/reference/memcached/expiration.xml new file mode 100644 index 0000000000..f487e536f4 --- /dev/null +++ b/reference/memcached/expiration.xml @@ -0,0 +1,43 @@ + + + + + Expiration Times + + Some storage commands involve sending an expiration value (relative to an + item or to an operation requested by the client) to the server. In all such + cases, the actual value sent may either be Unix time (number of seconds + since January 1, 1970, as an integer), or a number of seconds starting from + current time. In the latter case, this number of seconds may not exceed + 60*60*24*30 (number of seconds in 30 days); if the expiration value is + larger than that, the server will consider it to be real Unix time value + rather than an offset from current time. + + + If the expiration value is 0 (the default), the item + never expires (although it may be deleted from the server to make place for + other items). + + + + + diff --git a/reference/memcached/memcached/add.xml b/reference/memcached/memcached/add.xml index d365ccfb29..a23a2e372e 100644 --- a/reference/memcached/memcached/add.xml +++ b/reference/memcached/memcached/add.xml @@ -1,5 +1,5 @@ - + @@ -46,7 +46,8 @@ expiration - The expiration time of the value, as a Unix timestamp. + The expiration time, defaults to 0. See Expiration Times for more info. diff --git a/reference/memcached/memcached/addbykey.xml b/reference/memcached/memcached/addbykey.xml index ed53b766f5..e0c6c65e91 100644 --- a/reference/memcached/memcached/addbykey.xml +++ b/reference/memcached/memcached/addbykey.xml @@ -1,5 +1,5 @@ - + @@ -57,7 +57,8 @@ expiration - The expiration time of the value, as a Unix timestamp. + The expiration time, defaults to 0. See Expiration Times for more info. diff --git a/reference/memcached/memcached/delete.xml b/reference/memcached/memcached/delete.xml index e582df44a6..2201566bfb 100644 --- a/reference/memcached/memcached/delete.xml +++ b/reference/memcached/memcached/delete.xml @@ -1,21 +1,33 @@ - + Memcached::delete - The delete purpose + Delete an item &reftitle.description; - public voidMemcached::delete + public boolMemcached::delete stringkey - stringexpiration + inttime - The method description goes here. + Memcached::delete deletes the + key from the server. The time + parameter is the amount of time in seconds (or Unix time until which) the + client wishes the server to refuse add and + replace commands for this key. For this amount of time, + the item is put into a delete queue, which means that it won't possible to + retrieve it by the get command, but + add and replace command with this key + will also fail (the set command will succeed, however). + After the time passes, the item is finally deleted from server memory. The + parameter time defaults to 0 (which means that the + item will be deleted immediately and further storage commands with this key + will succeed). @@ -27,15 +39,16 @@ key - Description... + The key to be deleted. - expiration + time - Description... + The amount of time the server will wait to delete the item. Defaults to + 0. @@ -46,7 +59,8 @@ &reftitle.returnvalues; - Description... + &return.success; + Use Memcached::getResultCode if necessary. @@ -58,16 +72,13 @@ addServer('localhost', 11211); + +$m->delete('key1'); ?> ]]> - &example.outputs.similar; - - - @@ -76,7 +87,7 @@ &reftitle.seealso; - Classname::Method + Memcached::deleteByKey diff --git a/reference/memcached/memcached/deletebykey.xml b/reference/memcached/memcached/deletebykey.xml index ad1375ca8b..a96c9b01e4 100644 --- a/reference/memcached/memcached/deletebykey.xml +++ b/reference/memcached/memcached/deletebykey.xml @@ -1,22 +1,25 @@ - + Memcached::deleteByKey - The deleteByKey purpose + Delete an item from a specific server &reftitle.description; - public voidMemcached::deleteByKey + public boolMemcached::deleteByKey stringserver_key stringkey - stringexpiration + inttime - The method description goes here. + Memcached::deleteByKey is functionally equivalent to + Memcached::delete, except that the free-form + server_key can be used to map the + key to a specific server. @@ -28,7 +31,7 @@ server_key - Description... + The key identifying the server to delete the item from. @@ -36,15 +39,16 @@ key - Description... + The key to be deleted. - expiration + time - Description... + The amount of time the server will wait to delete the item. Defaults to + 0. @@ -55,29 +59,8 @@ &reftitle.returnvalues; - Description... - - - - - &reftitle.examples; - - - <function>Memcached::deleteByKey</function> example - - -]]> - - &example.outputs.similar; - - - - + &return.success; + Use Memcached::getResultCode if necessary. @@ -85,7 +68,7 @@ &reftitle.seealso; - Classname::Method + Memcached::delete diff --git a/reference/memcached/memcached/replace.xml b/reference/memcached/memcached/replace.xml index c0df267c9e..d0f6e772bf 100644 --- a/reference/memcached/memcached/replace.xml +++ b/reference/memcached/memcached/replace.xml @@ -1,5 +1,5 @@ - + @@ -46,7 +46,8 @@ expiration - The expiration time of the value, as a Unix timestamp. + The expiration time, defaults to 0. See Expiration Times for more info. diff --git a/reference/memcached/memcached/replacebykey.xml b/reference/memcached/memcached/replacebykey.xml index 8c81fb02ff..550a325290 100644 --- a/reference/memcached/memcached/replacebykey.xml +++ b/reference/memcached/memcached/replacebykey.xml @@ -1,5 +1,5 @@ - + @@ -57,7 +57,8 @@ expiration - The expiration time of the value, as a Unix timestamp. + The expiration time, defaults to 0. See Expiration Times for more info. diff --git a/reference/memcached/memcached/set.xml b/reference/memcached/memcached/set.xml index 264eaba0ff..ddcc9daa5d 100644 --- a/reference/memcached/memcached/set.xml +++ b/reference/memcached/memcached/set.xml @@ -1,5 +1,5 @@ - + @@ -18,16 +18,14 @@ Memcached::set stores the value on a memcache server under the specified key. The - expiration parameter is a Unix timestamp that can be - used to control when the value is considered expired. It can be set to - 0 which means that the value will persist until the - server deletes it to make space for new items. + expiration parameter can be used to control when the + value is considered expired. - The value can be any valid PHP type except for resources, because - those cannot be represented in a serialized form. If the - Memcached::OPT_COMPRESSION option is turned on, the serialized - value will also be compressed before storage. + The value can be any valid PHP type except for resources, because those + cannot be represented in a serialized form. If the + Memcached::OPT_COMPRESSION option is turned on, the + serialized value will also be compressed before storage. @@ -55,7 +53,8 @@ expiration - The expiration time of the value, as a Unix timestamp. + The expiration time, defaults to 0. See Expiration Times for more info. diff --git a/reference/memcached/memcached/setbykey.xml b/reference/memcached/memcached/setbykey.xml index f44b5ee5a6..9f2122c6d7 100644 --- a/reference/memcached/memcached/setbykey.xml +++ b/reference/memcached/memcached/setbykey.xml @@ -1,5 +1,5 @@ - + @@ -57,7 +57,8 @@ expiration - The expiration time of the value, as a Unix timestamp. + The expiration time, defaults to 0. See Expiration Times for more info. diff --git a/reference/memcached/memcached/setmulti.xml b/reference/memcached/memcached/setmulti.xml index ef69958c6d..3a5e54d174 100644 --- a/reference/memcached/memcached/setmulti.xml +++ b/reference/memcached/memcached/setmulti.xml @@ -1,5 +1,5 @@ - + @@ -39,7 +39,8 @@ expiration - The expiration time of the entries, as a Unix timestamp. + The expiration time, defaults to 0. See Expiration Times for more info. diff --git a/reference/memcached/memcached/setmultibykey.xml b/reference/memcached/memcached/setmultibykey.xml index 916a31e211..d85e80c53f 100644 --- a/reference/memcached/memcached/setmultibykey.xml +++ b/reference/memcached/memcached/setmultibykey.xml @@ -1,5 +1,5 @@ - + @@ -48,7 +48,8 @@ expiration - The expiration time of the entries, as a Unix timestamp. + The expiration time, defaults to 0. See Expiration Times for more info.