<!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>Retrieves information about data stored in the user cache</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.wincache-ucache-inc.html">wincache_ucache_inc</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.wincache-ucache-meminfo.html">wincache_ucache_meminfo</a></div> <div class="up"><a href="ref.wincache.html">WinCache Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.wincache-ucache-info" class="refentry"> <div class="refnamediv"> <h1 class="refname">wincache_ucache_info</h1> <p class="verinfo">(PECL wincache >= 1.1.0)</p><p class="refpurpose"><span class="refname">wincache_ucache_info</span> — <span class="dc-title"> Retrieves information about data stored in the user cache </span></p> </div> <div class="refsect1 description" id="refsect1-function.wincache-ucache-info-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">array</span> <span class="methodname"><strong>wincache_ucache_info</strong></span> ([ <span class="methodparam"><span class="type">bool</span> <code class="parameter">$summaryonly</code><span class="initializer"> = false</span></span> [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$key</code></span> ]] )</div> <p class="para rdfs-comment"> Retrieves information about data stored in the user cache. </p> </div> <div class="refsect1 parameters" id="refsect1-function.wincache-ucache-info-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">summaryonly</code></em></span> <dd> <p class="para"> Controls whether the returned array will contain information about individual cache entries along with the user cache summary. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">key</code></em></span> <dd> <p class="para"> The key of an entry in the user cache. If specified then the returned array will contain information only about that cache entry. If not specified and <em><code class="parameter">summaryonly</code></em> is set to <strong><code>FALSE</code></strong> then the returned array will contain information about all entries in the cache. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.wincache-ucache-info-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Array of meta data about user cache or <strong><code>FALSE</code></strong> on failure </p> <p class="para"> The array returned by this function contains the following elements: <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"> <em>total_cache_uptime</em> - total time in seconds that the user cache has been active </span> </li> <li class="listitem"> <span class="simpara"> <em>total_item_count</em> - total number of elements that are currently in the user cache </span> </li> <li class="listitem"> <span class="simpara"> <em>is_local_cache</em> - true is the cache metadata is for a local cache instance, false if the metadata is for the global cache </span> </li> <li class="listitem"> <span class="simpara"> <em>total_hit_count</em> - number of times the data has been served from the cache </span> </li> <li class="listitem"> <span class="simpara"> <em>total_miss_count</em> - number of times the data has not been found in the cache </span> </li> <li class="listitem"> <p class="para"> <em>ucache_entries</em> - an array that contains the information about all the cached items: <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"> <em>key_name</em> - name of the key which is used to store the data </span> </li> <li class="listitem"> <span class="simpara"> <em>value_type</em> - type of value stored by the key </span> </li> <li class="listitem"> <span class="simpara"> <em>use_time</em> - time in seconds since the file has been accessed in the opcode cache </span> </li> <li class="listitem"> <span class="simpara"> <em>last_check</em> - time in seconds since the file has been checked for modifications </span> </li> <li class="listitem"> <span class="simpara"> <em>is_session</em> - indicates if the data is a session variable </span> </li> <li class="listitem"> <span class="simpara"> <em>ttl_seconds</em> - time remaining for the data to live in the cache, 0 meaning infinite </span> </li> <li class="listitem"> <span class="simpara"> <em>age_seconds</em> - time elapsed from the time data has been added in the cache </span> </li> <li class="listitem"> <span class="simpara"> <em>hitcount</em> - number of times data has been served from the cache </span> </li> </ul> </p> </li> </ul> </p> </div> <div class="refsect1 examples" id="refsect1-function.wincache-ucache-info-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-581"> <p><strong>Example #1 Using <span class="function"><strong>wincache_ucache_info()</strong></span></strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br />wincache_ucache_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'green'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">wincache_ucache_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'green'</span><span style="color: #007700">, </span><span style="color: #0000BB">2922</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">wincache_ucache_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'green'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">wincache_ucache_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'green'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">wincache_ucache_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'green'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">wincache_ucache_info</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> Array ( ["total_cache_uptime"] => int(0) ["is_local_cache"] => bool(false) ["total_item_count"] => int(1) ["total_hit_count"] => int(3) ["total_miss_count"] => int(1) ["ucache_entries"] => Array(1) ( [1] => Array(6) ( ["key_name"] => string(5) "green" ["value_type"] => string(4) "long" ["is_session"] => int(0) ["ttl_seconds"] => int(0) ["age_seconds"] => int(0) ["hitcount"] => int(3) ) ) ) </pre></div> </div> </div> </p> </div> <div class="refsect1 seealso" id="refsect1-function.wincache-ucache-info-seealso"> <h3 class="title">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.wincache-fcache-meminfo.html" class="function" rel="rdfs-seeAlso">wincache_fcache_meminfo()</a> - Retrieves information about file cache memory usage</span></li> <li class="member"> <span class="function"><a href="function.wincache-ocache-fileinfo.html" class="function" rel="rdfs-seeAlso">wincache_ocache_fileinfo()</a> - Retrieves information about files cached in the opcode cache</span></li> <li class="member"> <span class="function"><a href="function.wincache-ocache-meminfo.html" class="function" rel="rdfs-seeAlso">wincache_ocache_meminfo()</a> - Retrieves information about opcode cache memory usage</span></li> <li class="member"> <span class="function"><a href="function.wincache-rplist-meminfo.html" class="function" rel="rdfs-seeAlso">wincache_rplist_meminfo()</a> - Retrieves information about memory usage by the resolve file path cache</span></li> <li class="member"> <span class="function"><a href="function.wincache-rplist-fileinfo.html" class="function" rel="rdfs-seeAlso">wincache_rplist_fileinfo()</a> - Retrieves information about resolve file path cache</span></li> <li class="member"> <span class="function"><a href="function.wincache-refresh-if-changed.html" class="function" rel="rdfs-seeAlso">wincache_refresh_if_changed()</a> - Refreshes the cache entries for the cached files</span></li> <li class="member"> <span class="function"><a href="function.wincache-ucache-meminfo.html" class="function" rel="rdfs-seeAlso">wincache_ucache_meminfo()</a> - Retrieves information about user cache memory usage</span></li> <li class="member"> <span class="function"><a href="function.wincache-scache-info.html" class="function" rel="rdfs-seeAlso">wincache_scache_info()</a> - Retrieves information about files cached in the session cache</span></li> <li class="member"> <span class="function"><a href="function.wincache-scache-meminfo.html" class="function" rel="rdfs-seeAlso">wincache_scache_meminfo()</a> - Retrieves information about session cache memory usage</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="function.wincache-ucache-inc.html">wincache_ucache_inc</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.wincache-ucache-meminfo.html">wincache_ucache_meminfo</a></div> <div class="up"><a href="ref.wincache.html">WinCache Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>