Drush: Drush\Cache\JSONCache Class Reference

  1. 7.x doxygen/html/classDrush_1_1Cache_1_1JSONCache.html
  2. master doxygen/html/classDrush_1_1Cache_1_1JSONCache.html
Inheritance diagram for Drush\Cache\JSONCache:
Collaboration diagram for Drush\Cache\JSONCache:

Public Member Functions

 readFile ($filename)
 writeFile ($filename, $cache)
- Public Member Functions inherited from Drush\Cache\FileCache
 __construct ($bin)
 cacheDirectory ($bin=NULL)
 get ($cid)
 getMultiple (&$cids)
 set ($cid, $data, $expire=DRUSH_CACHE_PERMANENT)
 clear ($cid=NULL, $wildcard=FALSE)
 isEmpty ()

Public Attributes

const EXTENSION = '.json'
- Public Attributes inherited from Drush\Cache\FileCache
const EXTENSION = '.cache'

Additional Inherited Members

- Protected Member Functions inherited from Drush\Cache\FileCache
 getFilePath ($cid)
- Protected Attributes inherited from Drush\Cache\FileCache
 $bin

Detailed Description

JSON cache storage backend.

Definition at line 13 of file JSONCache.php.

Member Function Documentation

Drush\Cache\JSONCache::readFile (   $filename)

Returns the contents of the given filename unserialized.

Parameters
string$filenameAbsolute path to filename to read contents from.

Reimplemented from Drush\Cache\FileCache.

Definition at line 16 of file JSONCache.php.

References drush_json_decode().

Here is the call graph for this function:

Drush\Cache\JSONCache::writeFile (   $filename,
  $cache 
)

Serializes data and write it to the given filename.

Parameters
string$filenameAbsolute path to filename to write cache data.
$cacheCache data to serialize and write to $filename.

Reimplemented from Drush\Cache\FileCache.

Definition at line 21 of file JSONCache.php.

References drush_json_encode().

Here is the call graph for this function:


The documentation for this class was generated from the following file:

File

doxygen/html/classDrush_1_1Cache_1_1JSONCache.html
View source
<!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"/>
<title>Drush: Drush\Cache\JSONCache 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="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</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">Drush
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>Drush</b></li><li class="navelem"><b>Cache</b></li><li class="navelem"><a class="el" href="classDrush_1_1Cache_1_1JSONCache.html">JSONCache</a></li>  </ul>
</div>
</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="classDrush_1_1Cache_1_1JSONCache-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Drush\Cache\JSONCache Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for Drush\Cache\JSONCache:</div>
<div class="dyncontent">
<div class="center"><img src="classDrush_1_1Cache_1_1JSONCache__inherit__graph.png" border="0" usemap="#Drush_0CCache_0CJSONCache_inherit__map" alt="Inheritance graph"/></div>
<map name="Drush_0CCache_0CJSONCache_inherit__map" id="Drush_0CCache_0CJSONCache_inherit__map">
<area shape="rect" id="node2" href="classDrush_1_1Cache_1_1FileCache.html" title="Drush\\Cache\\FileCache" alt="" coords="20,83,183,112"/><area shape="rect" id="node4" href="interfaceDrush_1_1Cache_1_1CacheInterface.html" title="Drush\\Cache\\CacheInterface" alt="" coords="5,5,197,35"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for Drush\Cache\JSONCache:</div>
<div class="dyncontent">
<div class="center"><img src="classDrush_1_1Cache_1_1JSONCache__coll__graph.png" border="0" usemap="#Drush_0CCache_0CJSONCache_coll__map" alt="Collaboration graph"/></div>
<map name="Drush_0CCache_0CJSONCache_coll__map" id="Drush_0CCache_0CJSONCache_coll__map">
<area shape="rect" id="node2" href="classDrush_1_1Cache_1_1FileCache.html" title="Drush\\Cache\\FileCache" alt="" coords="20,83,183,112"/><area shape="rect" id="node4" href="interfaceDrush_1_1Cache_1_1CacheInterface.html" title="Drush\\Cache\\CacheInterface" alt="" coords="5,5,197,35"/></map>
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a8cce2c28c2979437372b8a7adeb7e701"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1Cache_1_1JSONCache.html#a8cce2c28c2979437372b8a7adeb7e701">readFile</a> ($filename)</td></tr>
<tr class="memitem:a65ed9a2957d7c68efe32ab2d1b48e5f0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1Cache_1_1JSONCache.html#a65ed9a2957d7c68efe32ab2d1b48e5f0">writeFile</a> ($filename, $cache)</td></tr>
<tr class="inherit_header pub_methods_classDrush_1_1Cache_1_1FileCache"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classDrush_1_1Cache_1_1FileCache')"><img src="closed.png" alt="-"/>&nbsp;Public Member Functions inherited from <a class="el" href="classDrush_1_1Cache_1_1FileCache.html">Drush\Cache\FileCache</a></td></tr>
<tr class="memitem:a88300712df4c30ea8c0039d037f081ae inherit pub_methods_classDrush_1_1Cache_1_1FileCache"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1Cache_1_1FileCache.html#a88300712df4c30ea8c0039d037f081ae">__construct</a> ($bin)</td></tr>
<tr class="memitem:ab324a73105e21d2e133a440286189d1d inherit pub_methods_classDrush_1_1Cache_1_1FileCache"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1Cache_1_1FileCache.html#ab324a73105e21d2e133a440286189d1d">cacheDirectory</a> ($bin=NULL)</td></tr>
<tr class="memitem:a46fe7a68c7ffd26a080471b7a39edcb4 inherit pub_methods_classDrush_1_1Cache_1_1FileCache"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1Cache_1_1FileCache.html#a46fe7a68c7ffd26a080471b7a39edcb4">get</a> ($cid)</td></tr>
<tr class="memitem:a6679c82e05f8074299bb28ac69b27b7b inherit pub_methods_classDrush_1_1Cache_1_1FileCache"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1Cache_1_1FileCache.html#a6679c82e05f8074299bb28ac69b27b7b">getMultiple</a> (&amp;$cids)</td></tr>
<tr class="memitem:a3dbfdb88cc4a26a874c7ecce16341187 inherit pub_methods_classDrush_1_1Cache_1_1FileCache"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1Cache_1_1FileCache.html#a3dbfdb88cc4a26a874c7ecce16341187">set</a> ($cid, $data, $expire=<a class="el" href="includes_2cache_8inc.html#a9f0a518bb0b1e6c3397756383fc72316">DRUSH_CACHE_PERMANENT</a>)</td></tr>
<tr class="memitem:a44a013d5f478004d9899ebc189bb89d3 inherit pub_methods_classDrush_1_1Cache_1_1FileCache"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1Cache_1_1FileCache.html#a44a013d5f478004d9899ebc189bb89d3">clear</a> ($cid=NULL, $wildcard=FALSE)</td></tr>
<tr class="memitem:a86ab9c0ba83028da4596360f93eeebc8 inherit pub_methods_classDrush_1_1Cache_1_1FileCache"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1Cache_1_1FileCache.html#a86ab9c0ba83028da4596360f93eeebc8">isEmpty</a> ()</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:ab4b0d82445950d8902d1db0e2aef32d1"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab4b0d82445950d8902d1db0e2aef32d1"></a>
const&#160;</td><td class="memItemRight" valign="bottom"><b>EXTENSION</b> = '.json'</td></tr>
<tr class="inherit_header pub_attribs_classDrush_1_1Cache_1_1FileCache"><td colspan="2" onclick="javascript:toggleInherit('pub_attribs_classDrush_1_1Cache_1_1FileCache')"><img src="closed.png" alt="-"/>&nbsp;Public Attributes inherited from <a class="el" href="classDrush_1_1Cache_1_1FileCache.html">Drush\Cache\FileCache</a></td></tr>
<tr class="memitem:a35aa3321c1ad808639bf698debecf130 inherit pub_attribs_classDrush_1_1Cache_1_1FileCache"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a35aa3321c1ad808639bf698debecf130"></a>
const&#160;</td><td class="memItemRight" valign="bottom"><b>EXTENSION</b> = '.cache'</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="inherited"></a>
Additional Inherited Members</h2></td></tr>
<tr class="inherit_header pro_methods_classDrush_1_1Cache_1_1FileCache"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classDrush_1_1Cache_1_1FileCache')"><img src="closed.png" alt="-"/>&nbsp;Protected Member Functions inherited from <a class="el" href="classDrush_1_1Cache_1_1FileCache.html">Drush\Cache\FileCache</a></td></tr>
<tr class="memitem:ad5012c0e30a75f821b2c42320591621f inherit pro_methods_classDrush_1_1Cache_1_1FileCache"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classDrush_1_1Cache_1_1FileCache.html#ad5012c0e30a75f821b2c42320591621f">getFilePath</a> ($cid)</td></tr>
<tr class="inherit_header pro_attribs_classDrush_1_1Cache_1_1FileCache"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classDrush_1_1Cache_1_1FileCache')"><img src="closed.png" alt="-"/>&nbsp;Protected Attributes inherited from <a class="el" href="classDrush_1_1Cache_1_1FileCache.html">Drush\Cache\FileCache</a></td></tr>
<tr class="memitem:a32b9362534f6ec05bb1df509061a9128 inherit pro_attribs_classDrush_1_1Cache_1_1FileCache"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a32b9362534f6ec05bb1df509061a9128"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>$bin</b></td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>JSON cache storage backend. </p>

<p>Definition at line <a class="el" href="JSONCache_8php_source.html#l00013">13</a> of file <a class="el" href="JSONCache_8php_source.html">JSONCache.php</a>.</p>
</div><h2>Member Function Documentation</h2>
<a class="anchor" id="a8cce2c28c2979437372b8a7adeb7e701"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Drush\Cache\JSONCache::readFile </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$filename</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns the contents of the given filename unserialized.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramtype">string</td><td class="paramname">$filename</td><td>Absolute path to filename to read contents from. </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented from <a class="el" href="classDrush_1_1Cache_1_1FileCache.html#afd9722e235555339b315a12dca41d761">Drush\Cache\FileCache</a>.</p>

<p>Definition at line <a class="el" href="JSONCache_8php_source.html#l00016">16</a> of file <a class="el" href="JSONCache_8php_source.html">JSONCache.php</a>.</p>

<p>References <a class="el" href="output_8inc_source.html#l00726">drush_json_decode()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classDrush_1_1Cache_1_1JSONCache_a8cce2c28c2979437372b8a7adeb7e701_cgraph.png" border="0" usemap="#classDrush_1_1Cache_1_1JSONCache_a8cce2c28c2979437372b8a7adeb7e701_cgraph" alt=""/></div>
<map name="classDrush_1_1Cache_1_1JSONCache_a8cce2c28c2979437372b8a7adeb7e701_cgraph" id="classDrush_1_1Cache_1_1JSONCache_a8cce2c28c2979437372b8a7adeb7e701_cgraph">
<area shape="rect" id="node3" href="group__outputfunctions.html#gac70a5f166e0adce50e84edd0238e896b" title="drush_json_decode" alt="" coords="233,13,367,43"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a65ed9a2957d7c68efe32ab2d1b48e5f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Drush\Cache\JSONCache::writeFile </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$cache</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Serializes data and write it to the given filename.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramtype">string</td><td class="paramname">$filename</td><td>Absolute path to filename to write cache data. </td></tr>
    <tr><td class="paramtype"></td><td class="paramname">$cache</td><td>Cache data to serialize and write to $filename. </td></tr>
  </table>
  </dd>
</dl>

<p>Reimplemented from <a class="el" href="classDrush_1_1Cache_1_1FileCache.html#a09e13b7553204d370b5a78a85df395a0">Drush\Cache\FileCache</a>.</p>

<p>Definition at line <a class="el" href="JSONCache_8php_source.html#l00021">21</a> of file <a class="el" href="JSONCache_8php_source.html">JSONCache.php</a>.</p>

<p>References <a class="el" href="output_8inc_source.html#l00706">drush_json_encode()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="classDrush_1_1Cache_1_1JSONCache_a65ed9a2957d7c68efe32ab2d1b48e5f0_cgraph.png" border="0" usemap="#classDrush_1_1Cache_1_1JSONCache_a65ed9a2957d7c68efe32ab2d1b48e5f0_cgraph" alt=""/></div>
<map name="classDrush_1_1Cache_1_1JSONCache_a65ed9a2957d7c68efe32ab2d1b48e5f0_cgraph" id="classDrush_1_1Cache_1_1JSONCache_a65ed9a2957d7c68efe32ab2d1b48e5f0_cgraph">
<area shape="rect" id="node3" href="group__outputfunctions.html#gacfaa0466b264b9f5179c0475fc33c250" title="drush_json_encode" alt="" coords="233,13,367,43"/></map>
</div>
</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>lib/Drush/Cache/<a class="el" href="JSONCache_8php_source.html">JSONCache.php</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Oct 8 2014 09:05:01 for Drush by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</small></address>
</body>
</html>