Location: PHPKode > projects > SithTemplate > SithTemplate-1.1/docs/html/interface_i_template_i_o_driver.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: ITemplateIODriver Interface 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>  </div>
  <div class="headertitle">
<h1>ITemplateIODriver Interface Reference</h1>  </div>
</div>
<div class="contents">
<!-- doxytag: class="ITemplateIODriver" -->
<p>Interface required for all I/O drivers.  
<a href="#_details">More...</a></p>

<p><a href="interface_i_template_i_o_driver-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="interface_i_template_i_o_driver.html#afe03a2977d7333088bc39deeb1e08264">upToDate</a> (array &amp;$settings, &amp;$template, $mode)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Should check whether given template is up-to-date.  <a href="#afe03a2977d7333088bc39deeb1e08264"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_i_template_i_o_driver.html#aa01b0b76fd3c284531f92d63d583bfed">includeCode</a> (array &amp;$settings, &amp;$template)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Should include template's code into global namespace.  <a href="#aa01b0b76fd3c284531f92d63d583bfed"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_i_template_i_o_driver.html#a4422ce31a10074ea6af13594efd757b1">className</a> (array &amp;$settings, &amp;$template)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Should return template's classname.  <a href="#a4422ce31a10074ea6af13594efd757b1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_i_template_i_o_driver.html#a58d4f66a849626b7341eafeb3f456c03">loadTemplate</a> (array &amp;$settings, &amp;$template)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Should read template source code as whole, and return it.  <a href="#a58d4f66a849626b7341eafeb3f456c03"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_i_template_i_o_driver.html#a01f72bd17947a97cfc0b99290eff163f">loadMetadata</a> (array &amp;$settings, &amp;$template)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Should read template's metadata, and return it.  <a href="#a01f72bd17947a97cfc0b99290eff163f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_i_template_i_o_driver.html#ace0d5330b5b82578b4d3a5021eb1cdd7">saveTemplate</a> (array &amp;$settings, &amp;$template, &amp;$code)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Should save compiled template code.  <a href="#ace0d5330b5b82578b4d3a5021eb1cdd7"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="interface_i_template_i_o_driver.html#a09fcd13602951d6617d9af68118ef851">saveMetadata</a> (array &amp;$settings, &amp;$template, array &amp;$metadata)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Should save template metadata.  <a href="#a09fcd13602951d6617d9af68118ef851"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Interface required for all I/O drivers. </p>
<p>I/O machinery is separated from template plugins. </p>

<p>Definition at line <a class="el" href="_i_i_o_driver_8php_source.html#l00015">15</a> of file <a class="el" href="_i_i_o_driver_8php_source.html">IIODriver.php</a>.</p>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="afe03a2977d7333088bc39deeb1e08264"></a><!-- doxytag: member="ITemplateIODriver::upToDate" ref="afe03a2977d7333088bc39deeb1e08264" args="(array &amp;$settings, &amp;$template, $mode)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ITemplateIODriver::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>Implemented in <a class="el" href="class_template_file_i_o.html#aa4bc432153892d73c14e19ff2fb55400">TemplateFileIO</a>, and <a class="el" href="class_template_string_i_o.html#a24c000d1d1c51f66aafb5675317548b6">TemplateStringIO</a>.</p>

</div>
</div>
<a class="anchor" id="aa01b0b76fd3c284531f92d63d583bfed"></a><!-- doxytag: member="ITemplateIODriver::includeCode" ref="aa01b0b76fd3c284531f92d63d583bfed" args="(array &amp;$settings, &amp;$template)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ITemplateIODriver::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>Implemented in <a class="el" href="class_template_file_i_o.html#aa8a87a009b5abb1b77ede6e514ec1b51">TemplateFileIO</a>, and <a class="el" href="class_template_string_i_o.html#a41da9f90eb44c9624cb3ff2066b8f2d6">TemplateStringIO</a>.</p>

</div>
</div>
<a class="anchor" id="a4422ce31a10074ea6af13594efd757b1"></a><!-- doxytag: member="ITemplateIODriver::className" ref="a4422ce31a10074ea6af13594efd757b1" args="(array &amp;$settings, &amp;$template)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ITemplateIODriver::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>Implemented in <a class="el" href="class_template_file_i_o.html#aed074d5ef58838473230d4b46a954e32">TemplateFileIO</a>, and <a class="el" href="class_template_string_i_o.html#ad9c9f9b3a1333243ce45f26de8a5fa94">TemplateStringIO</a>.</p>

<p>Referenced by <a class="el" href="_compiler_ex_8php_source.html#l00117">TemplateCompilerEx::compile()</a>.</p>

</div>
</div>
<a class="anchor" id="a58d4f66a849626b7341eafeb3f456c03"></a><!-- doxytag: member="ITemplateIODriver::loadTemplate" ref="a58d4f66a849626b7341eafeb3f456c03" args="(array &amp;$settings, &amp;$template)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ITemplateIODriver::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>Implemented in <a class="el" href="class_template_file_i_o.html#ada9cd20bbab985fc9b1a7b1075c1505a">TemplateFileIO</a>.</p>

<p>Referenced by <a class="el" href="_compiler_ex_8php_source.html#l00117">TemplateCompilerEx::compile()</a>.</p>

</div>
</div>
<a class="anchor" id="a01f72bd17947a97cfc0b99290eff163f"></a><!-- doxytag: member="ITemplateIODriver::loadMetadata" ref="a01f72bd17947a97cfc0b99290eff163f" args="(array &amp;$settings, &amp;$template)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ITemplateIODriver::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>Implemented in <a class="el" href="class_template_file_i_o.html#a28ee02c3eb6d02b9acf13af1422f041a">TemplateFileIO</a>.</p>

</div>
</div>
<a class="anchor" id="ace0d5330b5b82578b4d3a5021eb1cdd7"></a><!-- doxytag: member="ITemplateIODriver::saveTemplate" ref="ace0d5330b5b82578b4d3a5021eb1cdd7" args="(array &amp;$settings, &amp;$template, &amp;$code)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ITemplateIODriver::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>Implemented in <a class="el" href="class_template_file_i_o.html#a7985ad8b2254566aa39fe4d98bb624c0">TemplateFileIO</a>.</p>

<p>Referenced by <a class="el" href="_compiler_ex_8php_source.html#l00117">TemplateCompilerEx::compile()</a>.</p>

</div>
</div>
<a class="anchor" id="a09fcd13602951d6617d9af68118ef851"></a><!-- doxytag: member="ITemplateIODriver::saveMetadata" ref="a09fcd13602951d6617d9af68118ef851" args="(array &amp;$settings, &amp;$template, array &amp;$metadata)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ITemplateIODriver::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>Implemented in <a class="el" href="class_template_file_i_o.html#a2ddfb64f962890e154e6dc5ab16f26e7">TemplateFileIO</a>.</p>

<p>Referenced by <a class="el" href="_compiler_ex_8php_source.html#l00117">TemplateCompilerEx::compile()</a>.</p>

</div>
</div>
<hr/>The documentation for this interface was generated from the following file:<ul>
<li><a class="el" href="_i_i_o_driver_8php_source.html">IIODriver.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