View file news/libraries/api/classCache.html

File size: 14.15Kb
<!-- HTML header for doxygen 1.8.5-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Fat-Free Framework: Cache Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Fat-Free Framework
   &#160;<span id="projectnumber">3.2.2</span>
   &#160;<span class="menu"><a href="index.html">Overview</a> <a href="annotated.html">Class List</a> <a href="hierarchy.html">Hierarchy</a></span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classCache-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Cache Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Cache engine.  
 <a href="classCache.html#details">More...</a></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for Cache:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
 <div class="center">
  <img src="classCache.png" usemap="#Cache_map" alt=""/>
  <map id="Cache_map" name="Cache_map">
<area href="classPrefab.html" title="Factory class for single-instance objects. " alt="Prefab" shape="rect" coords="0,0,50,24"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac8e1317d73d208d62bc15b4874b95e2a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCache.html#ac8e1317d73d208d62bc15b4874b95e2a">exists</a> ($key, &amp;$val=NULL)</td></tr>
<tr class="separator:ac8e1317d73d208d62bc15b4874b95e2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2af7f347a97a8e8626408df44514dbee"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCache.html#a2af7f347a97a8e8626408df44514dbee">set</a> ($key, $val, $ttl=0)</td></tr>
<tr class="separator:a2af7f347a97a8e8626408df44514dbee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad25f006b5b60f18f23b3009ed18ce35b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCache.html#ad25f006b5b60f18f23b3009ed18ce35b">get</a> ($key)</td></tr>
<tr class="separator:ad25f006b5b60f18f23b3009ed18ce35b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad1e284b1bd8a1d927a9ad0c3591e25c4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCache.html#ad1e284b1bd8a1d927a9ad0c3591e25c4">clear</a> ($key)</td></tr>
<tr class="separator:ad1e284b1bd8a1d927a9ad0c3591e25c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1075f1392063026ef20097e97bbbd621"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCache.html#a1075f1392063026ef20097e97bbbd621">reset</a> ($suffix=NULL, $lifetime=0)</td></tr>
<tr class="separator:a1075f1392063026ef20097e97bbbd621"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8945c7c861557e851f252c24d92309a1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCache.html#a8945c7c861557e851f252c24d92309a1">load</a> ($dsn)</td></tr>
<tr class="separator:a8945c7c861557e851f252c24d92309a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5dabe98b015fd4ff9ce2f1e24a2d458a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCache.html#a5dabe98b015fd4ff9ce2f1e24a2d458a">__construct</a> ($dsn=FALSE)</td></tr>
<tr class="separator:a5dabe98b015fd4ff9ce2f1e24a2d458a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a8d719294c5cd3df46da675a1cb3d0947"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8d719294c5cd3df46da675a1cb3d0947"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCache.html#a8d719294c5cd3df46da675a1cb3d0947">$prefix</a></td></tr>
<tr class="memdesc:a8d719294c5cd3df46da675a1cb3d0947"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prefix for cache entries. <br/></td></tr>
<tr class="separator:a8d719294c5cd3df46da675a1cb3d0947"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac8626c6d188a58f1220d74451fdb24f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aac8626c6d188a58f1220d74451fdb24f"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCache.html#aac8626c6d188a58f1220d74451fdb24f">$ref</a></td></tr>
<tr class="memdesc:aac8626c6d188a58f1220d74451fdb24f"><td class="mdescLeft">&#160;</td><td class="mdescRight">MemCache or Redis object. <br/></td></tr>
<tr class="separator:aac8626c6d188a58f1220d74451fdb24f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:ac021bf9bbe23e7c03af36c23bfc08010"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac021bf9bbe23e7c03af36c23bfc08010"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classCache.html#ac021bf9bbe23e7c03af36c23bfc08010">$dsn</a></td></tr>
<tr class="memdesc:ac021bf9bbe23e7c03af36c23bfc08010"><td class="mdescLeft">&#160;</td><td class="mdescRight">Cache DSN. <br/></td></tr>
<tr class="separator:ac021bf9bbe23e7c03af36c23bfc08010"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pub_static_methods_classPrefab"><td colspan="2" onclick="javascript:toggleInherit('pub_static_methods_classPrefab')"><img src="closed.png" alt="-"/>&#160;Static Public Member Functions inherited from <a class="el" href="classPrefab.html">Prefab</a></td></tr>
<tr class="memitem:a459ac539bc012dbdb77abe0d0ebeba76 inherit pub_static_methods_classPrefab"><td class="memItemLeft" align="right" valign="top">static&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classPrefab.html#a459ac539bc012dbdb77abe0d0ebeba76">instance</a> ()</td></tr>
<tr class="separator:a459ac539bc012dbdb77abe0d0ebeba76 inherit pub_static_methods_classPrefab"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Cache engine. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a5dabe98b015fd4ff9ce2f1e24a2d458a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Cache::__construct </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$dsn</em> = <code>FALSE</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Class constructor </p>
<dl class="section return"><dt>Returns</dt><dd>object </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$dsn</td><td>bool|string </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ad1e284b1bd8a1d927a9ad0c3591e25c4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Cache::clear </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Delete cache entry </p>
<dl class="section return"><dt>Returns</dt><dd>bool </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$key</td><td>string </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ac8e1317d73d208d62bc15b4874b95e2a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Cache::exists </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&amp;&#160;</td>
          <td class="paramname"><em>$val</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Return timestamp and TTL of cache entry or FALSE if not found </p>
<dl class="section return"><dt>Returns</dt><dd>array|FALSE </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$key</td><td>string </td></tr>
    <tr><td class="paramname">$val</td><td>mixed </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ad25f006b5b60f18f23b3009ed18ce35b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Cache::get </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Retrieve value of cache entry </p>
<dl class="section return"><dt>Returns</dt><dd>mixed|FALSE </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$key</td><td>string </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a8945c7c861557e851f252c24d92309a1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Cache::load </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$dsn</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Load/auto-detect cache backend </p>
<dl class="section return"><dt>Returns</dt><dd>string </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$dsn</td><td>bool|string </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a1075f1392063026ef20097e97bbbd621"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Cache::reset </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$suffix</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$lifetime</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Clear contents of cache backend </p>
<dl class="section return"><dt>Returns</dt><dd>bool </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$suffix</td><td>string </td></tr>
    <tr><td class="paramname">$lifetime</td><td>int </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a2af7f347a97a8e8626408df44514dbee"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Cache::set </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$ttl</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Store value in cache </p>
<dl class="section return"><dt>Returns</dt><dd>mixed|FALSE </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">$key</td><td>string </td></tr>
    <tr><td class="paramname">$val</td><td>mixed </td></tr>
    <tr><td class="paramname">$ttl</td><td>int </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>base.php</li>
</ul>
</div><!-- contents -->