Location: PHPKode > projects > Program E > docs/developer/__filesource/fsource_Loader__adminbotloader.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 botloader.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
											</head>
		<body>
						
<h1>Source for file botloader.php</h1>
<p>Documentation is available at <a href="../Loader/_admin_botloader_php.html">botloader.php</a></p>
<div class="src-code">
<pre><ol><li><a name="a1"></a><span class="src-php">&lt;?</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>    </li>
<li><a name="a7"></a><span class="src-comm">    This file is part of Program E.</span></li>
<li><a name="a8"></a>    </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"> * Bot loading</span></li>
<li><a name="a26"></a><span class="src-doc"> * </span></li>
<li><a name="a27"></a><span class="src-doc"> * Contains the HTML interface for loading the AIML files in the MySQL database</span></li>
<li><a name="a28"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@author</span><span class="src-doc"> Paul Rydell</span></li>
<li><a name="a29"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@copyright</span><span class="src-doc"> 2002</span></li>
<li><a name="a30"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@version</span><span class="src-doc"> 0.0.8</span></li>
<li><a name="a31"></a><span class="src-doc"> * </span><span class="src-doc-coretag">@package</span><span class="src-doc"> Loader</span></li>
<li><a name="a32"></a><span class="src-doc"> */</span></li>
<li><a name="a33"></a>&nbsp;</li>
<li><a name="a34"></a><span class="src-doc">/**</span></li>
<li><a name="a35"></a><span class="src-doc">* The general preferences and database details.</span></li>
<li><a name="a36"></a><span class="src-doc">*/</span></li>
<li><a name="a37"></a><span class="src-inc">require_once </span><span class="src-str">&quot;dbprefs.php&quot;</span><span class="src-sym">;</span></li>
<li><a name="a38"></a>&nbsp;</li>
<li><a name="a39"></a><span class="src-doc">/**</span></li>
<li><a name="a40"></a><span class="src-doc">* Contains the actual functions used in this file to load the AIML files into MySQL.</span></li>
<li><a name="a41"></a><span class="src-doc">*/</span></li>
<li><a name="a42"></a><span class="src-inc">require_once </span><span class="src-str">&quot;botloaderfuncs.php&quot;</span><span class="src-sym">;</span></li>
<li><a name="a43"></a>&nbsp;</li>
<li><a name="a44"></a>print <span class="src-str">&quot;&lt;font size='3' color='BLACK'&gt;&lt;b&gt;When this script is done running you should see text that says \&quot;DONE LOADING.\&quot; If the script times out it is probably because your PHP is running in safe mode. If this is the case use the file &lt;a href=\&quot;botloaderinc.php\&quot;&gt;botloaderinc.php&lt;/a&gt; to load your AIML files.&lt;/B&gt;&lt;BR&gt;&lt;/font&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a45"></a>&nbsp;</li>
<li><a name="a46"></a><a href="../Loader/_admin_botloaderfuncs_php.html#functionss_timing_start">ss_timing_start</a><span class="src-sym">(</span><span class="src-str">&quot;all&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a47"></a>&nbsp;</li>
<li><a name="a48"></a><span class="src-var">$fp </span>= <span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a49"></a>&nbsp;</li>
<li><a name="a50"></a><span class="src-var">$templatesinserted</span>=<span class="src-num">0</span><span class="src-sym">;</span></li>
<li><a name="a51"></a>&nbsp;</li>
<li><a name="a52"></a><span class="src-var">$depth </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a53"></a><span class="src-var">$whaton </span>= <span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a54"></a>&nbsp;</li>
<li><a name="a55"></a><span class="src-var">$pattern </span>= <span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a56"></a><span class="src-var">$topic </span>= <span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a57"></a><span class="src-var">$that </span>= <span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a58"></a><span class="src-var">$template </span>= <span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a59"></a>&nbsp;</li>
<li><a name="a60"></a><span class="src-var">$startupwhich </span>= <span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a61"></a><span class="src-var">$splitterarray </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a62"></a><span class="src-var">$inputarray </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a63"></a><span class="src-var">$genderarray </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a64"></a><span class="src-var">$personarray </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a65"></a><span class="src-var">$person2array </span>= <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a66"></a>&nbsp;</li>
<li><a name="a67"></a><a href="../Loader/_admin_botloaderfuncs_php.html#functionloadstartup">loadstartup</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a68"></a><a href="../Loader/_admin_botloaderfuncs_php.html#functionmakesubscode">makesubscode</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a69"></a>&nbsp;</li>
<li><a name="a70"></a>print <span class="src-str">&quot;&lt;font size='3' color='RED'&gt;&lt;b&gt;DONE LOADING&lt;/B&gt;&lt;BR&gt;&lt;/font&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a71"></a>print <span class="src-str">&quot;</span>&lt;<span class="src-id">font size</span>='3' <span class="src-id">color</span>='<span class="src-id">BLUE</span>'&gt;<span class="src-id">Inserted </span><span class="src-var">$templatesinserted </span><span class="src-id">categories into database</span>&lt;/<span class="src-id">font</span>&gt;&lt;<span class="src-id">br</span>&gt;&lt;<span class="src-id">BR</span>&gt;\n<span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a72"></a>print <span class="src-str">&quot;&lt;font size='3' color='RED'&gt;&lt;b&gt;WARNING!&lt;/b&gt; You should password protect the admin directory or remove the botloader.php script or people may be able to abuse your server.&lt;/b&gt;&lt;/font&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a73"></a>print <span class="src-str">&quot;&lt;p&gt;&lt;font size='3' color='BLACK'&gt;&lt;a href='../talk.php'&gt;Click here to talk to the bot&lt;/a&gt;&lt;/p&gt;&lt;/font&gt;\n&quot;</span><span class="src-sym">;</span></li>
<li><a name="a74"></a>&nbsp;</li>
<li><a name="a75"></a>print <span class="src-str">&quot;&lt;BR&gt;&quot;</span><span class="src-sym">;</span></li>
<li><a name="a76"></a>&nbsp;</li>
<li><a name="a77"></a><a href="../Loader/_admin_botloaderfuncs_php.html#functionss_timing_stop">ss_timing_stop</a><span class="src-sym">(</span><span class="src-str">&quot;all&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a78"></a>print <span class="src-str">&quot;&lt;BR&gt;&lt;BR&gt;&lt;font size='3' color='BLACK'&gt;execution time: &quot; </span>. <a href="../Loader/_admin_botloaderfuncs_php.html#functionss_timing_current">ss_timing_current</a><span class="src-sym">(</span><span class="src-str">&quot;all&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a79"></a><span class="src-var">$avgts </span>= <span class="src-var">$templatesinserted</span>/<a href="../Loader/_admin_botloaderfuncs_php.html#functionss_timing_current">ss_timing_current</a><span class="src-sym">(</span><span class="src-str">&quot;all&quot;</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a80"></a><span class="src-var">$avgtm </span>= <span class="src-var">$templatesinserted</span>/<span class="src-sym">((</span><a href="../Loader/_admin_botloaderfuncs_php.html#functionss_timing_current">ss_timing_current</a><span class="src-sym">(</span><span class="src-str">&quot;all&quot;</span><span class="src-sym">))</span>/<span class="src-num">60</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a81"></a>print <span class="src-str">&quot;</span>&lt;<span class="src-id">BR</span>&gt;&lt;<span class="src-id">font size</span>='3' <span class="src-id">color</span>='<span class="src-id">BLACK</span>'&gt;<span class="src-id">Templates per second</span>=<span class="src-var">$avgts</span>&lt;<span class="src-id">BR</span>&gt;<span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a82"></a>print <span class="src-str">&quot;</span>&lt;<span class="src-id">font size</span>='3' <span class="src-id">color</span>='<span class="src-id">BLACK</span>'&gt;<span class="src-id">Templates per minute</span>=<span class="src-var">$avgtm</span>&lt;<span class="src-id">BR</span>&gt;<span class="src-str">&quot;</span><span class="src-sym">;</span></li>
<li><a name="a83"></a>&nbsp;</li>
<li><a name="a84"></a>&nbsp;</li>
<li><a name="a85"></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:42 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</body>
</html>
Return current item: Program E