Location: PHPKode > projects > Program E > docs/developer/__filesource/fsource_Settings__admindbprefs.php.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!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>
			<!-- template designed by Marco Von Ballmoos  -->
			<title>File Source for dbprefs.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
											</head>
		<body>
						
<h1>Source for file dbprefs.php</h1>
<p>Documentation is available at <a href="../Settings/_admin_dbprefs_php.html">dbprefs.php</a></p>
<div class="src-code">
<pre><ol><li><a name="a1"></a><span class="src-php">&lt;?php</span></li>
<li><a name="a2"></a>&nbsp;</li>
<li><a name="a3"></a><span class="src-comm">/*</span></li>
<li><a name="a4"></a><span class="src-comm">    Program E</span></li>
<li><a name="a5"></a><span class="src-comm">    Copyright 2002, Paul Rydell</span></li>
<li><a name="a6"></a>&nbsp;</li>
<li><a name="a7"></a><span class="src-comm">    This file is part of Program E.</span></li>
<li><a name="a8"></a>&nbsp;</li>
<li><a name="a9"></a><span class="src-comm">    Program E is free software; you can redistribute it and/or modify</span></li>
<li><a name="a10"></a><span class="src-comm">    it under the terms of the GNU General Public License as published by</span></li>
<li><a name="a11"></a><span class="src-comm">    the Free Software Foundation; either version 2 of the License, or</span></li>
<li><a name="a12"></a><span class="src-comm">    (at your option) any later version.</span></li>
<li><a name="a13"></a>&nbsp;</li>
<li><a name="a14"></a><span class="src-comm">    Program E is distributed in the hope that it will be useful,</span></li>
<li><a name="a15"></a><span class="src-comm">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span></li>
<li><a name="a16"></a><span class="src-comm">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></li>
<li><a name="a17"></a><span class="src-comm">    GNU General Public License for more details.</span></li>
<li><a name="a18"></a>&nbsp;</li>
<li><a name="a19"></a><span class="src-comm">    You should have received a copy of the GNU General Public License</span></li>
<li><a name="a20"></a><span class="src-comm">    along with Program E; if not, write to the Free Software</span></li>
<li><a name="a21"></a><span class="src-comm">    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA</span></li>
<li><a name="a22"></a><span class="src-comm">*/</span></li>
<li><a name="a23"></a>&nbsp;</li>
<li><a name="a24"></a><span class="src-doc">/**</span></li>
<li><a name="a25"></a><span class="src-doc"> * Preferences file</span></li>
<li><a name="a26"></a><span class="src-doc"> * </span></li>
<li><a name="a27"></a><span class="src-doc"> * Contains the preferences settings for the database and the application itself. Constants</span></li>
<li><a name="a28"></a><span class="src-doc"> * and the main MySQL connection.</span></li>
<li><a name="a29"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@author</span><span class="src-doc"> Paul Rydell</span></li>
<li><a name="a30"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@author</span><span class="src-doc"> Anne Kootstra</span></li>
<li><a name="a31"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@copyright</span><span class="src-doc"> 2002 &amp; 2004</span></li>
<li><a name="a32"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@version</span><span class="src-doc"> 0.0.9</span></li>
<li><a name="a33"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@package</span><span class="src-doc"> Settings</span></li>
<li><a name="a34"></a><span class="src-doc"> */</span></li>
<li><a name="a35"></a>&nbsp;</li>
<li><a name="a36"></a><span class="src-comm">// Turn this off in case people have it on.</span></li>
<li><a name="a37"></a><a href="http://www.php.net/set_magic_quotes_runtime">set_magic_quotes_runtime</a><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a38"></a>&nbsp;</li>
<li><a name="a39"></a><span class="src-comm">// Can't turn off magic quotes gpc so just redo what it did if it is on.</span></li>
<li><a name="a40"></a><span class="src-key">if </span><span class="src-sym">(</span><a href="http://www.php.net/get_magic_quotes_gpc">get_magic_quotes_gpc</a><span class="src-sym">(</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a41"></a>    <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$HTTP_GET_VARS </span><span class="src-key">as </span><span class="src-var">$k</span>=&gt;<span class="src-var">$v</span><span class="src-sym">)</span></li>
<li><a name="a42"></a>        <span class="src-var">$HTTP_GET_VARS</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">] </span>= <a href="http://www.php.net/stripslashes">stripslashes</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a43"></a>    <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$HTTP_POST_VARS </span><span class="src-key">as </span><span class="src-var">$k</span>=&gt;<span class="src-var">$v</span><span class="src-sym">)</span></li>
<li><a name="a44"></a>        <span class="src-var">$HTTP_POST_VARS</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">] </span>= <a href="http://www.php.net/stripslashes">stripslashes</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a45"></a>    <span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$HTTP_COOKIE_VARS </span><span class="src-key">as </span><span class="src-var">$k</span>=&gt;<span class="src-var">$v</span><span class="src-sym">)</span></li>
<li><a name="a46"></a>        <span class="src-var">$HTTP_COOKIE_VARS</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">] </span>= <a href="http://www.php.net/stripslashes">stripslashes</a><span class="src-sym">(</span><span class="src-var">$v</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a47"></a><span class="src-sym">}</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 errormessage when a loop is detected.</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;LOOPINGERRORMSG&quot;</span><span class="src-sym">, </span><span class="src-str">&quot;Oops. I wasn't paying attention. Tell me again what is going on.&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">* The number of times a loop may occur before the error is thrown. -1 equals to no limit.</span></li>
<li><a name="a56"></a><span class="src-doc">*/</span></li>
<li><a name="a57"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;LOOPINGLIMIT&quot;</span><span class="src-sym">,</span><span class="src-num">150</span><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-comm">// -1 for no limit</span></li>
<li><a name="a58"></a>&nbsp;</li>
<li><a name="a59"></a><span class="src-doc">/**</span></li>
<li><a name="a60"></a><span class="src-doc">* Has something to do with the random generator</span></li>
<li><a name="a61"></a><span class="src-doc">*/</span></li>
<li><a name="a62"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;RANDOMCHANCECLEAN&quot;</span><span class="src-sym">,</span><span class="src-num">100</span><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-comm">// -1 to never check</span></li>
<li><a name="a63"></a>&nbsp;</li>
<li><a name="a64"></a><span class="src-doc">/**</span></li>
<li><a name="a65"></a><span class="src-doc">* the amount of minutes certain data needs to be kept.</span></li>
<li><a name="a66"></a><span class="src-doc">*/</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;MINUTESTOKEEPDATA&quot;</span><span class="src-sym">,</span><span class="src-num">120</span><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-comm">// -1 to keep forever</span></li>
<li><a name="a68"></a>&nbsp;</li>
<li><a name="a69"></a><span class="src-doc">/**</span></li>
<li><a name="a70"></a><span class="src-doc">* Minutes to keep the chatlot, standard set to -1, meaning forever.</span></li>
<li><a name="a71"></a><span class="src-doc">*/</span></li>
<li><a name="a72"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;MINUTESTOKEEPCHATLOG&quot;</span><span class="src-sym">,</span>-<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">; </span><span class="src-comm">// -1 to keep forever</span></li>
<li><a name="a73"></a>&nbsp;</li>
<li><a name="a74"></a><span class="src-doc">/**</span></li>
<li><a name="a75"></a><span class="src-doc">* standard value when a user predicate hasn't been set.</span></li>
<li><a name="a76"></a><span class="src-doc">*/ </span></li>
<li><a name="a77"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;DEFAULTPREDICATEVALUE&quot;</span><span class="src-sym">, </span><span class="src-str">&quot;undefined&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a78"></a>&nbsp;</li>
<li><a name="a79"></a>&nbsp;</li>
<li><a name="a80"></a><span class="src-doc">/**</span></li>
<li><a name="a81"></a><span class="src-doc">* wether or not to use the resonse caching mechanism. 1=yes, 0=no</span></li>
<li><a name="a82"></a><span class="src-doc">*/</span></li>
<li><a name="a83"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'CACHE_CONTROL'</span><span class="src-sym">, </span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a84"></a>&nbsp;</li>
<li><a name="a85"></a><span class="src-doc">/**</span></li>
<li><a name="a86"></a><span class="src-doc">* version number of the application.</span></li>
<li><a name="a87"></a><span class="src-doc">*/</span></li>
<li><a name="a88"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">&quot;PROGRAMEVERSION&quot;</span><span class="src-sym">,</span><span class="src-str">&quot;v0.09&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a89"></a>&nbsp;</li>
<li><a name="a90"></a><span class="src-comm">// This is where all the AIML and startup.xml resides</span></li>
<li><a name="a91"></a><span class="src-var">$rootdir</span>=<span class="src-str">&quot;../../aiml_test/&quot;</span><span class="src-sym">;</span></li>
<li><a name="a92"></a>&nbsp;</li>
<li><a name="a93"></a><span class="src-var">$DB_HOST</span>=<span class="src-str">&quot;localhost&quot;</span><span class="src-sym">;</span></li>
<li><a name="a94"></a><span class="src-var">$DB_UNAME</span>=<span class="src-str">&quot;root&quot;</span><span class="src-sym">;</span></li>
<li><a name="a95"></a><span class="src-var">$DB_PWORD</span>=<span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a96"></a><span class="src-var">$DB_DB</span>=<span class="src-str">&quot;prog_e&quot;</span><span class="src-sym">;</span></li>
<li><a name="a97"></a>&nbsp;</li>
<li><a name="a98"></a><span class="src-var">$errors</span>=<span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a99"></a>&nbsp;</li>
<li><a name="a100"></a><a href="http://www.php.net/mysql_connect">mysql_connect</a><span class="src-sym">(</span><span class="src-var">$DB_HOST</span><span class="src-sym">,</span><span class="src-var">$DB_UNAME</span><span class="src-sym">,</span><span class="src-var">$DB_PWORD</span><span class="src-sym">) </span><span class="src-key">or </span><span class="src-var">$errors </span>= <span class="src-var">$errors </span>. <span class="src-str">&quot;Could not connect to database.\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a101"></a><span class="src-sym">@</span><a href="http://www.php.net/mysql_select_db">mysql_select_db</a><span class="src-sym">(</span><span class="src-var">$DB_DB</span><span class="src-sym">) </span><span class="src-key">or </span><span class="src-var">$errors </span>= <span class="src-var">$errors </span>. <span class="src-str">&quot;Unable to select database\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a102"></a>&nbsp;</li>
<li><a name="a103"></a><span class="src-php">?&gt;</span></li>
</ol></pre>
</div>
	<p class="notes" id="credit">
		Documentation generated on Wed, 12 Jan 2005 12:24:45 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</body>
</html>
Return current item: Program E