Location: PHPKode > projects > PHP on Trax > johnpipi-trax-f599562/trax/doc/__filesource/fsource_PHPonTrax__dataconfigenvironment.php.html
<html>
<head>
<title>File Source for environment.php</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td class="header_top">PHPonTrax</td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
  		  [ <a href="../classtrees_PHPonTrax.html" class="menu">class tree: PHPonTrax</a> ]
		  [ <a href="../elementindex_PHPonTrax.html" class="menu">index: PHPonTrax</a> ]
		  [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
      <b>Packages:</b><br />
              <a href="../li_PHPonTrax.html">PHPonTrax</a><br />
              <a href="../li_PHPonTraxTest.html">PHPonTraxTest</a><br />
            <br /><br />
                  
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file environment.php</h1>
<p>Documentation is available at <a href="../PHPonTrax/_data_config_environment_php.html">environment.php</a></p>
<div class="php">
<div class="listing"><pre><ol><li><a name="a1"></a><span class="src-php">&lt;?php</span></li>
<li><a name="a2"></a><span class="src-doc">/**</span></li>
<li><a name="a3"></a><span class="src-doc"> *  Trax runtime environment definitions</span></li>
<li><a name="a4"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@package</span><span class="src-doc"> PHPonTrax</span></li>
<li><a name="a5"></a><span class="src-doc"> *   $Id$</span></li>
<li><a name="a6"></a><span class="src-doc"> */</span></li>
<li><a name="a7"></a>&nbsp;</li>
<li><a name="a8"></a><span class="src-doc">/**</span></li>
<li><a name="a9"></a><span class="src-doc"> *  Location of the PEAR library on this system</span></li>
<li><a name="a10"></a><span class="src-doc"> *</span></li>
<li><a name="a11"></a><span class="src-doc"> *  Set automatically by the Pear installer when you install Trax with</span></li>
<li><a name="a12"></a><span class="src-doc"> *  the &lt;b&gt;pear install&lt;/b&gt; command.  If you are prevented from using</span></li>
<li><a name="a13"></a><span class="src-doc"> *  &lt;b&gt;pear install&lt;/b&gt;, change &quot;@PHP-DIR@&quot; by hand to the full filesystem</span></li>
<li><a name="a14"></a><span class="src-doc"> *  path of the location where you installed the Pear modules needed</span></li>
<li><a name="a15"></a><span class="src-doc"> *  by Trax.</span></li>
<li><a name="a16"></a><span class="src-doc"> */</span></li>
<li><a name="a17"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;PHP_LIB_ROOT&quot;</span><span class="src-sym">, </span><span class="src-str">&quot;@PHP-DIR@&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a18"></a>&nbsp;</li>
<li><a name="a19"></a><span class="src-doc">/**</span></li>
<li><a name="a20"></a><span class="src-doc"> *  Location of the directories constructed by the &lt;b&gt;trax&lt;/b&gt;</span></li>
<li><a name="a21"></a><span class="src-doc"> *  command.</span></li>
<li><a name="a22"></a><span class="src-doc"> */</span></li>
<li><a name="a23"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;TRAX_ROOT&quot;</span><span class="src-sym">, </span><span class="src-id">dirname</span><span class="src-sym">(</span><span class="src-id">dirname</span><span class="src-sym">(</span>__FILE__<span class="src-sym">)) </span>. <span class="src-str">&quot;/&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a24"></a>&nbsp;</li>
<li><a name="a25"></a><span class="src-doc">/**</span></li>
<li><a name="a26"></a><span class="src-doc"> *  Location of the directory exposed to the public by Apache.</span></li>
<li><a name="a27"></a><span class="src-doc"> *</span></li>
<li><a name="a28"></a><span class="src-doc"> *  The &lt;b&gt;trax&lt;/b&gt; command generates this as &lt;i&gt;TRAX_ROOT&lt;/i&gt;/public/</span></li>
<li><a name="a29"></a><span class="src-doc"> *  but you will probably want to move the files in public/ to somewhere under</span></li>
<li><a name="a30"></a><span class="src-doc"> *  </span><span class="src-doc-inlinetag">{@link http://httpd.apache.org/docs/2.0/  Apache}</span></li>
<li><a name="a31"></a><span class="src-doc"> *  </span><span class="src-doc-inlinetag">{@link http://httpd.apache.org/docs/2.0/mod/core.html#documentroot DocumentRoot}</span><span class="src-doc">.</span></li>
<li><a name="a32"></a><span class="src-doc"> *  Change the second argument to the full filesystem path to the</span></li>
<li><a name="a33"></a><span class="src-doc"> *  directory that holds the files generated in public/</span></li>
<li><a name="a34"></a><span class="src-doc"> */</span></li>
<li><a name="a35"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;TRAX_PUBLIC&quot;</span><span class="src-sym">, </span><span class="src-id">dirname</span><span class="src-sym">(</span><span class="src-id">dirname</span><span class="src-sym">(</span><span class="src-id">dirname</span><span class="src-sym">(</span>__FILE__<span class="src-sym">)))</span>.<span class="src-str">&quot;/public&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a36"></a>&nbsp;</li>
<li><a name="a37"></a><span class="src-doc">/**</span></li>
<li><a name="a38"></a><span class="src-doc"> *  Part of URL between domain name and Trax application</span></li>
<li><a name="a39"></a><span class="src-doc"> *</span></li>
<li><a name="a40"></a><span class="src-doc"> *  That part of the browser's URL after the domain name and before</span></li>
<li><a name="a41"></a><span class="src-doc"> *  the location described by &lt;i&gt;TRAX_PUBLIC&lt;/i&gt;.  If</span></li>
<li><a name="a42"></a><span class="src-doc"> *  &lt;i&gt;TRAX_PUBLIC&lt;/i&gt; is the same as</span></li>
<li><a name="a43"></a><span class="src-doc"> *  </span><span class="src-doc-inlinetag">{@link http://httpd.apache.org/docs/2.0/  Apache}</span></li>
<li><a name="a44"></a><span class="src-doc"> *  </span><span class="src-doc-inlinetag">{@link http://httpd.apache.org/docs/2.0/mod/core.html#documentroot DocumentRoot}</span><span class="src-doc">,</span></li>
<li><a name="a45"></a><span class="src-doc"> *  then TRAX_URL_PREFIX is null.</span></li>
<li><a name="a46"></a><span class="src-doc"> */</span></li>
<li><a name="a47"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;TRAX_URL_PREFIX&quot;</span><span class="src-sym">,       </span><span class="src-id">null</span><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-comm"># no trailing slash</span></li>
<li><a name="a48"></a>&nbsp;</li>
<li><a name="a49"></a><span class="src-doc">/**</span></li>
<li><a name="a50"></a><span class="src-doc"> *  The file extension of files in app/views.  Normally '.phtml'</span></li>
<li><a name="a51"></a><span class="src-doc"> */</span></li>
<li><a name="a52"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;TRAX_VIEWS_EXTENTION&quot;</span><span class="src-sym">,  </span><span class="src-str">&quot;phtml&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a53"></a>&nbsp;</li>
<li><a name="a54"></a><span class="src-doc">/**</span></li>
<li><a name="a55"></a><span class="src-doc"> *  Trax mode of operation</span></li>
<li><a name="a56"></a><span class="src-doc"> *</span></li>
<li><a name="a57"></a><span class="src-doc"> *  Must be one of: 'development', 'test' or 'production'.</span></li>
<li><a name="a58"></a><span class="src-doc"> *  May be set in the</span></li>
<li><a name="a59"></a><span class="src-doc"> *  </span><span class="src-doc-inlinetag">{@link http://httpd.apache.org/docs/2.0/  Apache}</span></li>
<li><a name="a60"></a><span class="src-doc"> *  configuration with the</span></li>
<li><a name="a61"></a><span class="src-doc"> *  </span><span class="src-doc-inlinetag">{@link  http://httpd.apache.org/docs/2.0/mod/mod_env.html#setenv SetEnv}</span></li>
<li><a name="a62"></a><span class="src-doc"> *  directive.  If not set there, then it must be set here.</span></li>
<li><a name="a63"></a><span class="src-doc"> */</span></li>
<li><a name="a64"></a><span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">) </span>&amp;&amp; <a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-str">'TRAX_MODE'</span><span class="src-sym">,</span><span class="src-var">$_SERVER</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a65"></a>    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;TRAX_MODE&quot;</span><span class="src-sym">,   </span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">'TRAX_MODE'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a66"></a><span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a67"></a>    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;TRAX_MODE&quot;</span><span class="src-sym">,   </span><span class="src-str">&quot;development&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a68"></a><span class="src-sym">}</span></li>
<li><a name="a69"></a>&nbsp;</li>
<li><a name="a70"></a><span class="src-doc">/**</span></li>
<li><a name="a71"></a><span class="src-doc"> *  Location of Trax components relative to TRAX_ROOT</span></li>
<li><a name="a72"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@global </span><span class="src-doc-type">$GLOBALS['TRAX_INCLUDES'] </span></li>
<li><a name="a73"></a><span class="src-doc"> */</span></li>
<li><a name="a74"></a><span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">] </span>=</li>
<li><a name="a75"></a>    <span class="src-key">array</span><span class="src-sym">( </span><span class="src-str">&quot;models&quot; </span>=&gt; <span class="src-str">&quot;app/models&quot;</span><span class="src-sym">,</span></li>
<li><a name="a76"></a>           <span class="src-str">&quot;views&quot; </span>=&gt; <span class="src-str">&quot;app/views&quot;</span><span class="src-sym">,</span></li>
<li><a name="a77"></a>           <span class="src-str">&quot;controllers&quot; </span>=&gt; <span class="src-str">&quot;app/controllers&quot;</span><span class="src-sym">,</span></li>
<li><a name="a78"></a>           <span class="src-str">&quot;helpers&quot; </span>=&gt; <span class="src-str">&quot;app/helpers&quot;</span><span class="src-sym">,</span></li>
<li><a name="a79"></a>           <span class="src-str">&quot;layouts&quot; </span>=&gt; <span class="src-str">&quot;app/views/layouts&quot;</span><span class="src-sym">,</span></li>
<li><a name="a80"></a>           <span class="src-str">&quot;config&quot; </span>=&gt; <span class="src-str">&quot;config&quot;</span><span class="src-sym">,</span></li>
<li><a name="a81"></a>           <span class="src-str">&quot;environments&quot; </span>=&gt; <span class="src-str">&quot;config/environments&quot;</span><span class="src-sym">,</span></li>
<li><a name="a82"></a>           <span class="src-str">&quot;lib&quot; </span>=&gt; <span class="src-str">&quot;lib&quot;</span><span class="src-sym">,</span></li>
<li><a name="a83"></a>           <span class="src-str">&quot;app&quot; </span>=&gt; <span class="src-str">&quot;app&quot;</span><span class="src-sym">,</span></li>
<li><a name="a84"></a>           <span class="src-str">&quot;log&quot; </span>=&gt; <span class="src-str">&quot;log&quot;</span><span class="src-sym">,</span></li>
<li><a name="a85"></a>           <span class="src-str">&quot;vendor&quot; </span>=&gt; <span class="src-str">&quot;vendor&quot; </span><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-comm">// FIXME: generated by trax cmd</span></li>
<li><a name="a86"></a>&nbsp;</li>
<li><a name="a87"></a><span class="src-doc">/**</span></li>
<li><a name="a88"></a><span class="src-doc"> *  Set how errors are to be logged</span></li>
<li><a name="a89"></a><span class="src-doc"> *</span></li>
<li><a name="a90"></a><span class="src-doc"> *  The 'log_errors'</span></li>
<li><a name="a91"></a><span class="src-doc"> *  </span><span class="src-doc-inlinetag">{@link http://www.php.net/manual/en/ref.errorfunc.php PHP configuration setting}</span></li>
<li><a name="a92"></a><span class="src-doc"> *  determines whether PHP error messages should be sent to the</span></li>
<li><a name="a93"></a><span class="src-doc"> *  </span><span class="src-doc-inlinetag">{@link http://httpd.apache.org/docs/2.0/  Apache}</span></li>
<li><a name="a94"></a><span class="src-doc"> *  </span><span class="src-doc-inlinetag">{@link http://httpd.apache.org/docs/2.0/logs.html#errorlog error log}</span></li>
<li><a name="a95"></a><span class="src-doc"> *  (log_errors false) or to the log file defined in the 'error_log'</span></li>
<li><a name="a96"></a><span class="src-doc"> *  setting (log_errors true).  Trax uses a different log file for</span></li>
<li><a name="a97"></a><span class="src-doc"> *  each of the three modes defined in TRAX_MODE.</span></li>
<li><a name="a98"></a><span class="src-doc"> *  </span></li>
<li><a name="a99"></a><span class="src-doc"> *  In your application you can write a message to this log file with</span></li>
<li><a name="a100"></a><span class="src-doc"> *   the call &lt;b&gt;error_log(&quot;&lt;/b&gt;&lt;i&gt;text of message&lt;/i&gt;&lt;b&gt;&quot;)&lt;/b&gt;.</span></li>
<li><a name="a101"></a><span class="src-doc"> */</span></li>
<li><a name="a102"></a><a href="http://www.php.net/ini_set">ini_set</a><span class="src-sym">(</span><span class="src-str">&quot;log_errors&quot;</span><span class="src-sym">, </span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a103"></a><a href="http://www.php.net/ini_set">ini_set</a><span class="src-sym">(</span><span class="src-str">&quot;error_log&quot;</span><span class="src-sym">,</span></li>
<li><a name="a104"></a>    <span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_ROOT">TRAX_ROOT</a></span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'log'</span><span class="src-sym">]</span>.<span class="src-str">&quot;/&quot;</span>.<span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_MODE">TRAX_MODE</a></span>.<span class="src-str">&quot;.log&quot;</span><span class="src-sym">)</span><span class="src-sym">; </span></li>
<li><a name="a105"></a>&nbsp;</li>
<li><a name="a106"></a><span class="src-doc">/**</span></li>
<li><a name="a107"></a><span class="src-doc"> *  Whether to generate debugging messages and send errors to the browser</span></li>
<li><a name="a108"></a><span class="src-doc"> *</span></li>
<li><a name="a109"></a><span class="src-doc"> *  The 'display_errors'</span></li>
<li><a name="a110"></a><span class="src-doc"> *  </span><span class="src-doc-inlinetag">{@link http://www.php.net/manual/en/ref.errorfunc.php PHP configuration setting}</span></li>
<li><a name="a111"></a><span class="src-doc"> *  determines whether error messages should be sent to the browser.</span></li>
<li><a name="a112"></a><span class="src-doc"> *  It should be false for production systems.  DEBUG is a define that</span></li>
<li><a name="a113"></a><span class="src-doc"> *  you can test for your own purposes.</span></li>
<li><a name="a114"></a><span class="src-doc"> */</span></li>
<li><a name="a115"></a><span class="src-key">if</span><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_MODE">TRAX_MODE</a> </span>== <span class="src-str">&quot;development&quot;</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a116"></a>    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;DEBUG&quot;</span><span class="src-sym">, </span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a117"></a>    <a href="http://www.php.net/ini_set">ini_set</a><span class="src-sym">(</span><span class="src-str">&quot;display_errors&quot;</span><span class="src-sym">, </span><span class="src-str">&quot;On&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a118"></a><span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a119"></a>    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;DEBUG&quot;</span><span class="src-sym">, </span><span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a120"></a>    <a href="http://www.php.net/ini_set">ini_set</a><span class="src-sym">(</span><span class="src-str">&quot;display_errors&quot;</span><span class="src-sym">, </span><span class="src-str">&quot;Off&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a121"></a><span class="src-sym">}</span></li>
<li><a name="a122"></a>&nbsp;</li>
<li><a name="a123"></a><span class="src-doc">/**</span></li>
<li><a name="a124"></a><span class="src-doc"> *  Load database settings from config/database.ini</span></li>
<li><a name="a125"></a><span class="src-doc"> */</span></li>
<li><a name="a126"></a><span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_DB_SETTINGS'</span><span class="src-sym">] </span>=</li>
<li><a name="a127"></a>    <a href="http://www.php.net/parse_ini_file">parse_ini_file</a><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_ROOT">TRAX_ROOT</a></span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'config'</span><span class="src-sym">]</span></li>
<li><a name="a128"></a>                   .<span class="src-str">&quot;/database.ini&quot;</span><span class="src-sym">,</span><span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a129"></a><span class="src-doc">/**</span></li>
<li><a name="a130"></a><span class="src-doc"> *  Define location of the Trax PHP modules</span></li>
<li><a name="a131"></a><span class="src-doc"> *</span></li>
<li><a name="a132"></a><span class="src-doc"> *  Should we use local copy of the Trax libs in vendor/trax or</span></li>
<li><a name="a133"></a><span class="src-doc"> *  the server Trax libs in the php libs dir defined in PHP_LIB_ROOT</span></li>
<li><a name="a134"></a><span class="src-doc"> */</span></li>
<li><a name="a135"></a><span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_ROOT">TRAX_ROOT</a></span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'vendor'</span><span class="src-sym">]</span>.<span class="src-str">&quot;/trax&quot;</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a136"></a>    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;TRAX_LIB_ROOT&quot;</span><span class="src-sym">, </span><span class="src-id">TRAX_ROOT</span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'vendor'</span><span class="src-sym">]</span>.<span class="src-str">&quot;/trax&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a137"></a><span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#definePHP_LIB_ROOT">PHP_LIB_ROOT</a></span>.<span class="src-str">&quot;/PHPonTrax/vendor/trax&quot;</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a138"></a>    <a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;TRAX_LIB_ROOT&quot;</span><span class="src-sym">, </span><span class="src-id">PHP_LIB_ROOT</span>.<span class="src-str">&quot;/PHPonTrax/vendor/trax&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a139"></a><span class="src-sym">} </span><span class="src-key">else </span><span class="src-sym">{</span></li>
<li><a name="a140"></a>    <a href="http://www.php.net/error_log">error_log</a><span class="src-sym">(</span><span class="src-str">&quot;Can't determine where your Trax Libs are located.&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a141"></a>    <span class="src-key">exit</span><span class="src-sym">;</span></li>
<li><a name="a142"></a><span class="src-sym">}</span></li>
<li><a name="a143"></a>&nbsp;</li>
<li><a name="a144"></a><span class="src-comm"># Set the include_path</span></li>
<li><a name="a145"></a><a href="http://www.php.net/ini_set">ini_set</a><span class="src-sym">(</span><span class="src-str">&quot;include_path&quot;</span><span class="src-sym">,</span></li>
<li><a name="a146"></a>        <span class="src-str">&quot;.&quot;</span>.<span class="src-id">PATH_SEPARATOR</span>.   <span class="src-comm"># current directory</span></li>
<li><a name="a147"></a>                <span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_LIB_ROOT">TRAX_LIB_ROOT</a></span>.<span class="src-id">PATH_SEPARATOR</span>.  <span class="src-comm"># trax libs (vendor/trax or server trax libs)</span></li>
<li><a name="a148"></a>                <span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#definePHP_LIB_ROOT">PHP_LIB_ROOT</a></span>.<span class="src-id">PATH_SEPARATOR</span>.  <span class="src-comm"># php libs dir (ex: /usr/local/lib/php)</span></li>
<li><a name="a149"></a>                <span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_ROOT">TRAX_ROOT</a></span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'lib'</span><span class="src-sym">]</span>.<span class="src-id">PATH_SEPARATOR</span>. <span class="src-comm"># app specific libs extra libs to include</span></li>
<li><a name="a150"></a>                <a href="http://www.php.net/ini_get">ini_get</a><span class="src-sym">(</span><span class="src-str">&quot;include_path&quot;</span><span class="src-sym">))</span><span class="src-sym">; </span><span class="src-comm"># add on old include_path to end</span></li>
<li><a name="a151"></a>&nbsp;</li>
<li><a name="a152"></a><span class="src-comm"># Include Trax library files.</span></li>
<li><a name="a153"></a><span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-str">&quot;session.php&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a154"></a><span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-str">&quot;input_filter.php&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a155"></a><span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-str">&quot;trax_exceptions.php&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a156"></a><span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-str">&quot;inflector.php&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a157"></a><span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-str">&quot;active_record.php&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a158"></a><span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-str">&quot;action_view.php&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a159"></a><span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-str">&quot;action_controller.php&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a160"></a><span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-str">&quot;action_mailer.php&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a161"></a><span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-str">&quot;dispatcher.php&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a162"></a><span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-str">&quot;router.php&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a163"></a>&nbsp;</li>
<li><a name="a164"></a><span class="src-comm"># Include the ApplicationMailer Class which extends ActionMailer for application specific mailing functions</span></li>
<li><a name="a165"></a><span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_ROOT">TRAX_ROOT</a></span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'app'</span><span class="src-sym">]</span>.<span class="src-str">&quot;/application_mailer.php&quot;</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a166"></a>    <span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-id">TRAX_ROOT</span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'app'</span><span class="src-sym">]</span>.<span class="src-str">&quot;/application_mailer.php&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a167"></a><span class="src-sym">}</span></li>
<li><a name="a168"></a>&nbsp;</li>
<li><a name="a169"></a><span class="src-comm"># Include the application environment specific config file</span></li>
<li><a name="a170"></a><span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_ROOT">TRAX_ROOT</a></span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'environments'</span><span class="src-sym">]</span>.<span class="src-str">&quot;/&quot;</span>.<span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_MODE">TRAX_MODE</a></span>.<span class="src-str">&quot;.php&quot;</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a171"></a>    <span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-id">TRAX_ROOT</span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'environments'</span><span class="src-sym">]</span>.<span class="src-str">&quot;/&quot;</span>.<span class="src-id">TRAX_MODE</span>.<span class="src-str">&quot;.php&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a172"></a><span class="src-sym">}</span></li>
<li><a name="a173"></a>&nbsp;</li>
<li><a name="a174"></a><span class="src-doc">/**</span></li>
<li><a name="a175"></a><span class="src-doc"> *  Automatically load a file containing a specified class</span></li>
<li><a name="a176"></a><span class="src-doc"> *</span></li>
<li><a name="a177"></a><span class="src-doc"> *  Given a class name, derive the name of the file containing that</span></li>
<li><a name="a178"></a><span class="src-doc"> *  class then load it.</span></li>
<li><a name="a179"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@param </span><span class="src-doc-type">string </span><span class="src-doc">class_name  Name of the class required</span></li>
<li><a name="a180"></a><span class="src-doc"> */</span></li>
<li><a name="a181"></a><span class="src-key">function </span><a href="../PHPonTrax/_data_config_environment_php.html#function__autoload">__autoload</a><span class="src-sym">(</span><span class="src-var">$class_name</span><span class="src-sym">) </span><span class="src-sym">{</span></li>
<li><a name="a182"></a>    <span class="src-var">$file </span>= <span class="src-id"><a href="../PHPonTrax/Inflector.html">Inflector</a></span><span class="src-sym">::</span><a href="../PHPonTrax/Inflector.html#methodunderscore">underscore</a><span class="src-sym">(</span><span class="src-var">$class_name</span><span class="src-sym">)</span>.<span class="src-str">&quot;.php&quot;</span><span class="src-sym">;</span></li>
<li><a name="a183"></a>    <span class="src-var">$file_org </span>= <span class="src-var">$class_name</span>.<span class="src-str">&quot;.php&quot;</span><span class="src-sym">;</span></li>
<li><a name="a184"></a>&nbsp;</li>
<li><a name="a185"></a>    <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_ROOT">TRAX_ROOT</a></span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'models'</span><span class="src-sym">]</span>.<span class="src-str">&quot;</span><span class="src-str">/<span class="src-var">$file</span></span><span class="src-str">&quot;</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a186"></a>        <span class="src-comm"># Include model classes</span></li>
<li><a name="a187"></a>        <span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_ROOT">TRAX_ROOT</a></span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'models'</span><span class="src-sym">]</span>.<span class="src-str">&quot;</span><span class="src-str">/<span class="src-var">$file</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a188"></a>    <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_ROOT">TRAX_ROOT</a></span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'controllers'</span><span class="src-sym">]</span>.<span class="src-str">&quot;</span><span class="src-str">/<span class="src-var">$file</span></span><span class="src-str">&quot;</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a189"></a>        <span class="src-comm"># Include extra controller classes</span></li>
<li><a name="a190"></a>        <span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_ROOT">TRAX_ROOT</a></span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'controllers'</span><span class="src-sym">]</span>.<span class="src-str">&quot;</span><span class="src-str">/<span class="src-var">$file</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a191"></a>    <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_ROOT">TRAX_ROOT</a></span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'lib'</span><span class="src-sym">]</span>.<span class="src-str">&quot;</span><span class="src-str">/<span class="src-var">$file</span></span><span class="src-str">&quot;</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a192"></a>        <span class="src-comm"># Include users application libs</span></li>
<li><a name="a193"></a>        <span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_ROOT">TRAX_ROOT</a></span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'lib'</span><span class="src-sym">]</span>.<span class="src-str">&quot;</span><span class="src-str">/<span class="src-var">$file</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a194"></a>    <span class="src-sym">} </span><span class="src-key">elseif</span><span class="src-sym">(</span><a href="http://www.php.net/file_exists">file_exists</a><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_ROOT">TRAX_ROOT</a></span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'lib'</span><span class="src-sym">]</span>.<span class="src-str">&quot;</span><span class="src-str">/<span class="src-var">$file_org</span></span><span class="src-str">&quot;</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a195"></a>        <span class="src-comm"># Include users application libs</span></li>
<li><a name="a196"></a>        <span class="src-inc">include_once</span><span class="src-sym">(</span><span class="src-id"><a href="../PHPonTrax/_data_config_environment_php.html#defineTRAX_ROOT">TRAX_ROOT</a></span>.<span class="src-var">$GLOBALS</span><span class="src-sym">[</span><span class="src-str">'TRAX_INCLUDES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'lib'</span><span class="src-sym">]</span>.<span class="src-str">&quot;</span><span class="src-str">/<span class="src-var">$file_org</span></span><span class="src-str">&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a197"></a>    <span class="src-sym">}</span></li>
<li><a name="a198"></a><span class="src-sym">}</span></li>
<li><a name="a199"></a>&nbsp;</li>
<li><a name="a200"></a><span class="src-comm">// -- set Emacs parameters --</span></li>
<li><a name="a201"></a><span class="src-comm">// Local variables:</span></li>
<li><a name="a202"></a><span class="src-comm">// tab-width: 4</span></li>
<li><a name="a203"></a><span class="src-comm">// c-basic-offset: 4</span></li>
<li><a name="a204"></a><span class="src-comm">// c-hanging-comment-ender-p: nil</span></li>
<li><a name="a205"></a><span class="src-comm">// indent-tabs-mode: nil</span></li>
<li><a name="a206"></a><span class="src-comm">// End:</span></li>
<li><a name="a207"></a><span class="src-php">?&gt;</span></li>
</ol></pre></div>
</div>
        <div class="credit">
		    <hr />
		    Documentation generated on Thu, 04 May 2006 19:47:34 -0600 by <a href="http://www.phpdoc.org">phpDocumentor 1.3.0RC4</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>
Return current item: PHP on Trax