<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.memcached.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'memcached.touchbykey.php',
    1 => 'Memcached::touchByKey',
    2 => 'Set a new expiration on an item on a specific server',
  ),
  'up' => 
  array (
    0 => 'class.memcached.php',
    1 => 'Memcached',
  ),
  'prev' => 
  array (
    0 => 'memcached.touch.php',
    1 => 'Memcached::touch',
  ),
  'next' => 
  array (
    0 => 'class.memcachedexception.php',
    1 => 'MemcachedException',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/memcached/memcached/touchbykey.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="memcached.touchbykey" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Memcached::touchByKey</h1>
  <p class="verinfo">(PECL memcached &gt;= 2.0.0)</p><p class="refpurpose"><span class="refname">Memcached::touchByKey</span> &mdash; <span class="dc-title">Set a new expiration on an item on a specific server</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-memcached.touchbykey-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Memcached::touchByKey</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$server_key</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$key</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$expiration</code><span class="initializer"> = 0</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>Memcached::touchByKey()</strong></span> is functionally equivalent to
   <span class="methodname"><a href="memcached.touch.php" class="methodname">Memcached::touch()</a></span>, except that the free-form
   <code class="parameter">server_key</code> can be used to map the
   <code class="parameter">key</code> to a specific server.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-memcached.touchbykey-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">server_key</code></dt>
     <dd>
      <p class="para">
       本键名用于识别储存和读取值的服务器。没有将实际的键名散列到具体的项目，而是在决定与哪一个 memcached 服务器通信时将其散列为服务器键名。这使得关联的项目在单一的服务上被组合起来以提高多重操作的效率。
      </p>
     </dd>
    
    
     <dt><code class="parameter">key</code></dt>
     <dd>
      <p class="para">
       用于存储值的键名。
      </p>
     </dd>
    
    
     <dt><code class="parameter">expiration</code></dt>
     <dd>
      <p class="para">
       到期时间，默认为 0。 更多信息请参见<a href="memcached.expiration.php" class="link">到期时间</a>。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-memcached.touchbykey-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>， 或者在失败时返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
   如需要则使用 <span class="methodname"><a href="memcached.getresultcode.php" class="methodname">Memcached::getResultCode()</a></span>。
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-memcached.touchbykey-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="memcached.touch.php" class="methodname" rel="rdfs-seeAlso">Memcached::touch()</a> - Set a new expiration on an item</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>