Location: PHPKode > projects > SithTemplate > SithTemplate-1.1/docs/html/_sith_template_8php_source.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: SithTemplate.php Source File</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><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><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="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>SithTemplate.php</h1>  </div>
</div>
<div class="contents">
<a href="_sith_template_8php.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?php
<a name="l00161"></a><a class="code" href="_sith_template_8php.html#ac35c8f029a79e04ebd7f1bf14e176c74">00161</a> function <a class="code" href="_sith_template_8php.html#ac35c8f029a79e04ebd7f1bf14e176c74" title="SPL autoloader for SithTemplate.">sithtemplate_spl_autoload</a>($cls) {
<a name="l00162"></a>00162  <span class="comment">// autoloader map</span>
<a name="l00163"></a>00163  <span class="keyword">static</span> $_autoload_map = array(
<a name="l00164"></a>00164   <span class="stringliteral">&#39;templateenviron&#39;</span>    =&gt; <span class="stringliteral">&#39;Environment.php&#39;</span>,
<a name="l00165"></a>00165   <span class="stringliteral">&#39;template&#39;</span>           =&gt; <span class="stringliteral">&#39;Base.php&#39;</span>,
<a name="l00166"></a>00166   <span class="stringliteral">&#39;templateerror&#39;</span>      =&gt; <span class="stringliteral">&#39;Error.php&#39;</span>,
<a name="l00167"></a>00167   <span class="stringliteral">&#39;templateplugins&#39;</span>    =&gt; <span class="stringliteral">&#39;Plugins.php&#39;</span>,
<a name="l00168"></a>00168   <span class="stringliteral">&#39;templatecompilerex&#39;</span> =&gt; <span class="stringliteral">&#39;CompilerEx.php&#39;</span>,
<a name="l00169"></a>00169   <span class="stringliteral">&#39;templatenodeex&#39;</span>     =&gt; <span class="stringliteral">&#39;CompilerEx.php&#39;</span>,
<a name="l00170"></a>00170   <span class="stringliteral">&#39;itemplateplugin&#39;</span>    =&gt; <span class="stringliteral">&#39;api/IPlugin.php&#39;</span>,
<a name="l00171"></a>00171   <span class="stringliteral">&#39;itemplateiodriver&#39;</span>  =&gt; <span class="stringliteral">&#39;api/IIODriver.php&#39;</span>,
<a name="l00172"></a>00172   <span class="stringliteral">&#39;templateutils&#39;</span>      =&gt; <span class="stringliteral">&#39;Utils.php&#39;</span>,
<a name="l00173"></a>00173   <span class="stringliteral">&#39;templatefileio&#39;</span>     =&gt; <span class="stringliteral">&#39;IO.php&#39;</span>,
<a name="l00174"></a>00174   <span class="stringliteral">&#39;templatestringio&#39;</span>   =&gt; <span class="stringliteral">&#39;IO.php&#39;</span>,
<a name="l00175"></a>00175   <span class="stringliteral">&#39;templateio&#39;</span>         =&gt; <span class="stringliteral">&#39;IO.php&#39;</span>,
<a name="l00176"></a>00176  );
<a name="l00177"></a>00177  
<a name="l00178"></a>00178  $cls = strtolower($cls);
<a name="l00179"></a>00179  
<a name="l00180"></a>00180  <span class="keywordflow">if</span> (!isset($_autoload_map[$cls]) || !is_readable(SITHTEMPLATE_DIR.$_autoload_map[$cls])) {
<a name="l00181"></a>00181   <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00182"></a>00182  }
<a name="l00183"></a>00183  
<a name="l00184"></a>00184  include_once $_autoload_map[$cls];
<a name="l00185"></a>00185  <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00186"></a>00186 }
<a name="l00187"></a>00187 
<a name="l00191"></a><a class="code" href="_sith_template_8php.html#a890ba4a885cfbf870e3294bead192a14">00191</a> define(<span class="stringliteral">&#39;SITHTEMPLATE_VERSION&#39;</span>, <span class="stringliteral">&#39;1.1&#39;</span>);
<a name="l00192"></a>00192 
<a name="l00193"></a>00193 <span class="keywordflow">if</span> (!defined(<span class="stringliteral">&#39;SITHTEMPLATE_DIR&#39;</span>)) {
<a name="l00194"></a>00194  define(<span class="stringliteral">&#39;SITHTEMPLATE_DIR&#39;</span>, pathinfo(__FILE__, PATHINFO_DIRNAME).<span class="charliteral">&#39;/&#39;</span>);
<a name="l00195"></a>00195 }
<a name="l00196"></a>00196 
<a name="l00197"></a>00197 <span class="keywordflow">if</span> (!defined(<span class="stringliteral">&#39;SITHTEMPLATE_NO_AUTOLOADER&#39;</span>)) {
<a name="l00198"></a>00198  spl_autoload_register(<span class="stringliteral">&#39;sithtemplate_spl_autoload&#39;</span>);
<a name="l00199"></a>00199 }
<a name="l00200"></a>00200 
<a name="l00201"></a>00201 <span class="keywordflow">if</span> (!defined(<span class="stringliteral">&#39;SITHTEMPLATE_MBSTRING_UTF8&#39;</span>)) {
<a name="l00202"></a>00202  mb_internal_encoding(<span class="stringliteral">&#39;UTF-8&#39;</span>);
<a name="l00203"></a>00203 }
</pre></div></div>
</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