Location: PHPKode > projects > SithTemplate > SithTemplate-1.1/docs/html/class_template_file_i_o.html
<!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"/>
<title>SithTemplate: TemplateFileIO Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.2 -->
<div class="navigation" id="top">
  <div 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 class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a>  </div>
  <div class="headertitle">
<h1>TemplateFileIO Class Reference</h1>  </div>
</div>
<div class="contents">
<!-- doxytag: class="TemplateFileIO" --><!-- doxytag: inherits="ITemplateIODriver" -->
<p>File I/O implementation.  
<a href="#_details">More...</a></p>

<p><a href="class_template_file_i_o-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_template_file_i_o.html#aa4bc432153892d73c14e19ff2fb55400">upToDate</a> (array &amp;$settings, &amp;$template, $mode)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_template_file_i_o.html#aa8a87a009b5abb1b77ede6e514ec1b51">includeCode</a> (array &amp;$settings, &amp;$template)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_template_file_i_o.html#aed074d5ef58838473230d4b46a954e32">className</a> (array &amp;$settings, &amp;$template)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_template_file_i_o.html#ada9cd20bbab985fc9b1a7b1075c1505a">loadTemplate</a> (array &amp;$settings, &amp;$template)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_template_file_i_o.html#a28ee02c3eb6d02b9acf13af1422f041a">loadMetadata</a> (array &amp;$settings, &amp;$template)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_template_file_i_o.html#a7985ad8b2254566aa39fe4d98bb624c0">saveTemplate</a> (array &amp;$settings, &amp;$template, &amp;$code)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_template_file_i_o.html#a2ddfb64f962890e154e6dc5ab16f26e7">saveMetadata</a> (array &amp;$settings, &amp;$template, array &amp;$metadata)</td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_template_file_i_o.html#aa1dac7190bee50dd281b5fd4c312850c">pfn</a> (array &amp;$settings, &amp;$template)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>File I/O implementation. </p>

<p>Definition at line <a class="el" href="_i_o_8php_source.html#l00078">78</a> of file <a class="el" href="_i_o_8php_source.html">IO.php</a>.</p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="aa1dac7190bee50dd281b5fd4c312850c"></a><!-- doxytag: member="TemplateFileIO::pfn" ref="aa1dac7190bee50dd281b5fd4c312850c" args="(array &amp;$settings, &amp;$template)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TemplateFileIO::pfn </td>
          <td>(</td>
          <td class="paramtype">array &amp;$&#160;</td>
          <td class="paramname"> <em>settings</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&amp;$&#160;</td>
          <td class="paramname"> <em>template</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Reimplemented in <a class="el" href="class_template_string_i_o.html#a4a43ba4a23c5087c68e3a45fbd0c061e">TemplateStringIO</a>.</p>

<p>Definition at line <a class="el" href="_i_o_8php_source.html#l00084">84</a> of file <a class="el" href="_i_o_8php_source.html">IO.php</a>.</p>

<p>Referenced by <a class="el" href="_i_o_8php_source.html#l00122">includeCode()</a>, <a class="el" href="_i_o_8php_source.html#l00151">loadMetadata()</a>, <a class="el" href="_i_o_8php_source.html#l00145">loadTemplate()</a>, <a class="el" href="_i_o_8php_source.html#l00163">saveMetadata()</a>, <a class="el" href="_i_o_8php_source.html#l00157">saveTemplate()</a>, and <a class="el" href="_i_o_8php_source.html#l00093">upToDate()</a>.</p>

</div>
</div>
<a class="anchor" id="aa4bc432153892d73c14e19ff2fb55400"></a><!-- doxytag: member="TemplateFileIO::upToDate" ref="aa4bc432153892d73c14e19ff2fb55400" args="(array &amp;$settings, &amp;$template, $mode)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TemplateFileIO::upToDate </td>
          <td>(</td>
          <td class="paramtype">array &amp;$&#160;</td>
          <td class="paramname"> <em>settings</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&amp;$&#160;</td>
          <td class="paramname"> <em>template</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">$&#160;</td>
          <td class="paramname"> <em>mode</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Should check whether given template is up-to-date. </p>
<p>If driver uses <code>recompilationMode</code> setting, then it should use supplied <code>$mode</code> argument instead, to allow per-template mode override. Although parameters are supplied via reference, they should not be modified in any way.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">$settings</td><td>Settings array, see <a class="el" href="class_template_environ.html#a1a6916c9094781e70523b3ed7ba20b68">TemplateEnviron::$settings</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">$template</td><td>Template name </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">$mode</td><td>Recompilation mode </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">true</td><td>Template is up-to-date - no (re)compilation is needed </td></tr>
    <tr><td class="paramname">false</td><td>Template must be (re)compiled </td></tr>
  </table>
  </dd>
</dl>
 
<p>Implements <a class="el" href="interface_i_template_i_o_driver.html#afe03a2977d7333088bc39deeb1e08264">ITemplateIODriver</a>.</p>

<p>Reimplemented in <a class="el" href="class_template_string_i_o.html#a24c000d1d1c51f66aafb5675317548b6">TemplateStringIO</a>.</p>

<p>Definition at line <a class="el" href="_i_o_8php_source.html#l00093">93</a> of file <a class="el" href="_i_o_8php_source.html">IO.php</a>.</p>

<p>References <a class="el" href="_error_8php_source.html#l00074">TemplateError::E_INVALID_ARGUMENT</a>, <a class="el" href="_error_8php_source.html#l00032">TemplateError::E_IO_LOAD_FAILURE</a>, <a class="el" href="_i_o_8php_source.html#l00084">pfn()</a>, <a class="el" href="_environment_8php_source.html#l00202">TemplateEnviron::RECOMPILE_ALWAYS</a>, <a class="el" href="_environment_8php_source.html#l00206">TemplateEnviron::RECOMPILE_IF_CHANGED</a>, and <a class="el" href="_environment_8php_source.html#l00210">TemplateEnviron::RECOMPILE_NEVER</a>.</p>

</div>
</div>
<a class="anchor" id="aa8a87a009b5abb1b77ede6e514ec1b51"></a><!-- doxytag: member="TemplateFileIO::includeCode" ref="aa8a87a009b5abb1b77ede6e514ec1b51" args="(array &amp;$settings, &amp;$template)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TemplateFileIO::includeCode </td>
          <td>(</td>
          <td class="paramtype">array &amp;$&#160;</td>
          <td class="paramname"> <em>settings</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&amp;$&#160;</td>
          <td class="paramname"> <em>template</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Should include template's code into global namespace. </p>
<p>It must ensure that no code redefinition will happen. Although parameters are supplied via reference, they should not be modified in any way.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">$settings</td><td>Settings array, see <a class="el" href="class_template_environ.html#a1a6916c9094781e70523b3ed7ba20b68">TemplateEnviron::$settings</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">$template</td><td>Template name </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Included class name </dd></dl>
 
<p>Implements <a class="el" href="interface_i_template_i_o_driver.html#aa01b0b76fd3c284531f92d63d583bfed">ITemplateIODriver</a>.</p>

<p>Reimplemented in <a class="el" href="class_template_string_i_o.html#a41da9f90eb44c9624cb3ff2066b8f2d6">TemplateStringIO</a>.</p>

<p>Definition at line <a class="el" href="_i_o_8php_source.html#l00122">122</a> of file <a class="el" href="_i_o_8php_source.html">IO.php</a>.</p>

<p>References <a class="el" href="_i_o_8php_source.html#l00140">className()</a>, <a class="el" href="_error_8php_source.html#l00032">TemplateError::E_IO_LOAD_FAILURE</a>, and <a class="el" href="_i_o_8php_source.html#l00084">pfn()</a>.</p>

</div>
</div>
<a class="anchor" id="aed074d5ef58838473230d4b46a954e32"></a><!-- doxytag: member="TemplateFileIO::className" ref="aed074d5ef58838473230d4b46a954e32" args="(array &amp;$settings, &amp;$template)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TemplateFileIO::className </td>
          <td>(</td>
          <td class="paramtype">array &amp;$&#160;</td>
          <td class="paramname"> <em>settings</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&amp;$&#160;</td>
          <td class="paramname"> <em>template</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Should return template's classname. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">$settings</td><td>Settings array, see <a class="el" href="class_template_environ.html#a1a6916c9094781e70523b3ed7ba20b68">TemplateEnviron::$settings</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">$template</td><td>Template name </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Class name </dd></dl>
 
<p>Implements <a class="el" href="interface_i_template_i_o_driver.html#a4422ce31a10074ea6af13594efd757b1">ITemplateIODriver</a>.</p>

<p>Reimplemented in <a class="el" href="class_template_string_i_o.html#ad9c9f9b3a1333243ce45f26de8a5fa94">TemplateStringIO</a>.</p>

<p>Definition at line <a class="el" href="_i_o_8php_source.html#l00140">140</a> of file <a class="el" href="_i_o_8php_source.html">IO.php</a>.</p>

<p>Referenced by <a class="el" href="_i_o_8php_source.html#l00122">includeCode()</a>.</p>

</div>
</div>
<a class="anchor" id="ada9cd20bbab985fc9b1a7b1075c1505a"></a><!-- doxytag: member="TemplateFileIO::loadTemplate" ref="ada9cd20bbab985fc9b1a7b1075c1505a" args="(array &amp;$settings, &amp;$template)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TemplateFileIO::loadTemplate </td>
          <td>(</td>
          <td class="paramtype">array &amp;$&#160;</td>
          <td class="paramname"> <em>settings</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&amp;$&#160;</td>
          <td class="paramname"> <em>template</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Should read template source code as whole, and return it. </p>
<p>SithTemplate ensures that this will be called only when compilation is needed, so no additional checks are needed. Although parameters are supplied via reference, they should not be modified in any way.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">$settings</td><td>Settings array, see <a class="el" href="class_template_environ.html#a1a6916c9094781e70523b3ed7ba20b68">TemplateEnviron::$settings</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">$template</td><td>Template name </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Whole template source </dd></dl>
 
<p>Implements <a class="el" href="interface_i_template_i_o_driver.html#a58d4f66a849626b7341eafeb3f456c03">ITemplateIODriver</a>.</p>

<p>Definition at line <a class="el" href="_i_o_8php_source.html#l00145">145</a> of file <a class="el" href="_i_o_8php_source.html">IO.php</a>.</p>

<p>References <a class="el" href="_i_o_8php_source.html#l00084">pfn()</a>.</p>

</div>
</div>
<a class="anchor" id="a28ee02c3eb6d02b9acf13af1422f041a"></a><!-- doxytag: member="TemplateFileIO::loadMetadata" ref="a28ee02c3eb6d02b9acf13af1422f041a" args="(array &amp;$settings, &amp;$template)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TemplateFileIO::loadMetadata </td>
          <td>(</td>
          <td class="paramtype">array &amp;$&#160;</td>
          <td class="paramname"> <em>settings</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&amp;$&#160;</td>
          <td class="paramname"> <em>template</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Should read template's metadata, and return it. </p>
<p>Although parameters are supplied via reference, they should not be modified in any way.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">$settings</td><td>Settings array, see <a class="el" href="class_template_environ.html#a1a6916c9094781e70523b3ed7ba20b68">TemplateEnviron::$settings</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">$template</td><td>Template name </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Template metadata or <code>false</code>. </dd></dl>
 
<p>Implements <a class="el" href="interface_i_template_i_o_driver.html#a01f72bd17947a97cfc0b99290eff163f">ITemplateIODriver</a>.</p>

<p>Definition at line <a class="el" href="_i_o_8php_source.html#l00151">151</a> of file <a class="el" href="_i_o_8php_source.html">IO.php</a>.</p>

<p>References <a class="el" href="_i_o_8php_source.html#l00084">pfn()</a>.</p>

</div>
</div>
<a class="anchor" id="a7985ad8b2254566aa39fe4d98bb624c0"></a><!-- doxytag: member="TemplateFileIO::saveTemplate" ref="a7985ad8b2254566aa39fe4d98bb624c0" args="(array &amp;$settings, &amp;$template, &amp;$code)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TemplateFileIO::saveTemplate </td>
          <td>(</td>
          <td class="paramtype">array &amp;$&#160;</td>
          <td class="paramname"> <em>settings</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&amp;$&#160;</td>
          <td class="paramname"> <em>template</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&amp;$&#160;</td>
          <td class="paramname"> <em>code</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Should save compiled template code. </p>
<p>Although parameters are supplied via reference, they should not be modified in any way.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">$settings</td><td>Settings array, see <a class="el" href="class_template_environ.html#a1a6916c9094781e70523b3ed7ba20b68">TemplateEnviron::$settings</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">$template</td><td>Template name </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">$code</td><td>Template code </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">true</td><td>Template has been saved </td></tr>
    <tr><td class="paramname">false</td><td>An error occured </td></tr>
  </table>
  </dd>
</dl>
 
<p>Implements <a class="el" href="interface_i_template_i_o_driver.html#ace0d5330b5b82578b4d3a5021eb1cdd7">ITemplateIODriver</a>.</p>

<p>Definition at line <a class="el" href="_i_o_8php_source.html#l00157">157</a> of file <a class="el" href="_i_o_8php_source.html">IO.php</a>.</p>

<p>References <a class="el" href="_i_o_8php_source.html#l00084">pfn()</a>.</p>

</div>
</div>
<a class="anchor" id="a2ddfb64f962890e154e6dc5ab16f26e7"></a><!-- doxytag: member="TemplateFileIO::saveMetadata" ref="a2ddfb64f962890e154e6dc5ab16f26e7" args="(array &amp;$settings, &amp;$template, array &amp;$metadata)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TemplateFileIO::saveMetadata </td>
          <td>(</td>
          <td class="paramtype">array &amp;$&#160;</td>
          <td class="paramname"> <em>settings</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&amp;$&#160;</td>
          <td class="paramname"> <em>template</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">array &amp;$&#160;</td>
          <td class="paramname"> <em>metadata</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Should save template metadata. </p>
<p>Although parameters are supplied via reference, they should not be modified in any way.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">$settings</td><td>Settings array, see <a class="el" href="class_template_environ.html#a1a6916c9094781e70523b3ed7ba20b68">TemplateEnviron::$settings</a> </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">$template</td><td>Template name </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">$metadata</td><td>Metadata </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">true</td><td>Metadata has been saved </td></tr>
    <tr><td class="paramname">false</td><td>An error occured </td></tr>
  </table>
  </dd>
</dl>
 
<p>Implements <a class="el" href="interface_i_template_i_o_driver.html#a09fcd13602951d6617d9af68118ef851">ITemplateIODriver</a>.</p>

<p>Definition at line <a class="el" href="_i_o_8php_source.html#l00163">163</a> of file <a class="el" href="_i_o_8php_source.html">IO.php</a>.</p>

<p>References <a class="el" href="_i_o_8php_source.html#l00084">pfn()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_i_o_8php_source.html">IO.php</a></li>
</ul>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Fri Jan 14 2011 20:08:37 for SithTemplate by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
Return current item: SithTemplate