Sophie

Sophie

distrib > Mageia > 7 > armv7hl > by-pkgid > 2b917e0437961edec048f1d15e2d7449 > files > 9660

php-manual-en-7.2.11-1.mga7.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Retrieve an item from a specific server</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="memcached.getallkeys.html">Memcached::getAllKeys</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="memcached.getdelayed.html">Memcached::getDelayed</a></div>
 <div class="up"><a href="class.memcached.html">Memcached</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="memcached.getbykey" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Memcached::getByKey</h1>
  <p class="verinfo">(PECL memcached &gt;= 0.1.0)</p><p class="refpurpose"><span class="refname">Memcached::getByKey</span> &mdash; <span class="dc-title">Retrieve an item from a specific server</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-memcached.getbykey-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <span class="methodname"><strong>Memcached::getByKey</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$server_key</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span>
   [, <span class="methodparam"><span class="type"><a href="language.types.callable.html" class="type callable">callable</a></span> <code class="parameter">$cache_cb</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code></span>
  ]] )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>Memcached::getByKey()</strong></span> is functionally equivalent to
   <span class="methodname"><a href="memcached.get.html" class="methodname">Memcached::get()</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.getbykey-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">server_key</code></dt>

     <dd>

      <p class="para">
       The key identifying the server to store the value on or retrieve it from. Instead of hashing on the actual key for the item, we hash on the server key when deciding which memcached server to talk to. This allows related items to be grouped together on a single server for efficiency with multi operations.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">key</code></dt>

     <dd>

      <p class="para">
       The key of the item to fetch.
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">cache_cb</code></dt>

     <dd>

      <p class="para">
       Read-through caching callback or <strong><code>NULL</code></strong>
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">flags</code></dt>

     <dd>

      <p class="para">
       Flags to control the returned result. When value of <strong><code>Memcached::GET_EXTENDED</code></strong>
       is given will return the CAS token.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-memcached.getbykey-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the value stored in the cache or <strong><code>FALSE</code></strong> otherwise.
   The <span class="methodname"><a href="memcached.getresultcode.html" class="methodname">Memcached::getResultCode()</a></span> will return
   <strong><code>Memcached::RES_NOTFOUND</code></strong> if the key does not exist.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-memcached.getbykey-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>3.0.0</td>
      <td>
       The <code class="parameter reference">&cas_token</code> parameter was removed.
       Instead <code class="parameter">flags</code> was added and when it is given the value of <strong><code>Memcached::GET_EXTENDED</code></strong> it will ensure the CAS token to be fetched.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-memcached.getbykey-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="memcached.get.html" class="methodname" rel="rdfs-seeAlso">Memcached::get()</a> - Retrieve an item</span></li>
    <li class="member"><span class="methodname"><a href="memcached.getmulti.html" class="methodname" rel="rdfs-seeAlso">Memcached::getMulti()</a> - Retrieve multiple items</span></li>
    <li class="member"><span class="methodname"><a href="memcached.getdelayed.html" class="methodname" rel="rdfs-seeAlso">Memcached::getDelayed()</a> - Request multiple items</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="memcached.getallkeys.html">Memcached::getAllKeys</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="memcached.getdelayed.html">Memcached::getDelayed</a></div>
 <div class="up"><a href="class.memcached.html">Memcached</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>