Location: PHPKode > scripts > IAM Backup > iam-backup/docs/__filesource/fsource_iam_backup__iam_backup.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 iam_backup.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
						<h1>Source for file iam_backup.php</h1>
<p>Documentation is available at <a href="../iam_backup/_Backup_iam_backup_php.html">iam_backup.php</a></p>
<div class="src-code">
<pre><a name="a1"></a><br />1     <span class="src-php">&lt;?php</span><a name="a2"></a><br />2     <span class="src-doc">/**</span><a name="a3"></a><br />3     <span class="src-doc"> *  IAM_Backup A class for backing up an entire Database and send the dump to the browser or download it as a file</span><a name="a4"></a><br />4     <span class="src-doc"> *</span><span class="src-doc">  </span><span class="src-doc-tag">@desc</span><span class="src-doc"> IAM_Backup A class for backing up an entire Database and send the dump to the browser or download it as a file.</span><a name="a5"></a><br />5     <span class="src-doc"> *</span><span class="src-doc">  </span><span class="src-doc-coretag">@package</span><span class="src-doc"> iam_backup</span><a name="a6"></a><br />6     <span class="src-doc"> *</span><span class="src-doc">  </span><span class="src-doc-coretag">@author</span><span class="src-doc">     Iván Ariel Melgrati &lt;hide@address.com&gt;</span><a name="a7"></a><br />7     <span class="src-doc"> *</span><span class="src-doc">  </span><span class="src-doc-coretag">@version</span><span class="src-doc"> 1.2</span><a name="a8"></a><br />8     <span class="src-doc"> *</span><a name="a9"></a><br />9     <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc">  Requires PHP v 4.0+ and MySQL 3.23+</span><a name="a10"></a><br />10    <span class="src-doc"> *</span><a name="a11"></a><br />11    <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc">  This library is free software; you can redistribute it and/or</span><a name="a12"></a><br />12    <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc">  modify it under the terms of the GNU Lesser General Public</span><a name="a13"></a><br />13    <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc">  License as published by the Free Software Foundation; either</span><a name="a14"></a><br />14    <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc">  version 2 of the License, or (at your option) any later version.</span><a name="a15"></a><br />15    <span class="src-doc"> *</span><a name="a16"></a><br />16    <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc">  This library is distributed in the hope that it will be useful,</span><a name="a17"></a><br />17    <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc">  but WITHOUT ANY WARRANTY; without even the implied warranty of</span><a name="a18"></a><br />18    <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc">  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span><a name="a19"></a><br />19    <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc">  Lesser General Public License for more details.</span><a name="a20"></a><br />20    <span class="src-doc"> */</span><a name="a21"></a><br />21    <a name="a22"></a><br />22    <a name="a23"></a><br />23    <span class="src-doc">/**</span><a name="a24"></a><br />24    <span class="src-doc"> * IAM_Backup A class for backing up an entire Database and send the dump to the browser or download it as a file</span><a name="a25"></a><br />25    <span class="src-doc"> *</span><span class="src-doc"> </span><span class="src-doc-coretag">@package</span><span class="src-doc"> iam_backup</span><a name="a26"></a><br />26    <span class="src-doc">*/</span><a name="a27"></a><br />27    <span class="src-key">class</span> <a href="../iam_backup/iam_backup.html">iam_backup</a><a name="a28"></a><br />28    <span class="src-sym">{</span><a name="a29"></a><br />29    <span class="src-doc">/**</span><a name="a30"></a><br />30    <span class="src-doc">*</span><a name="a31"></a><br />31    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc-var">$host </span><span class="src-doc">Host that holds the DB</span><a name="a32"></a><br />32    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a33"></a><br />33    <span class="src-doc">*/</span><a name="a34"></a><br />34        <span class="src-key">var</span> <a href="../iam_backup/iam_backup.html#var$host">$host</a>=<span class="src-str">&quot;localhost&quot;</span>;<a name="a35"></a><br />35    <a name="a36"></a><br />36    <span class="src-doc">/**</span><a name="a37"></a><br />37    <span class="src-doc">*</span><a name="a38"></a><br />38    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc-var">$dbname </span><span class="src-doc">Database to back up</span><a name="a39"></a><br />39    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a40"></a><br />40    <span class="src-doc">*/</span><a name="a41"></a><br />41        <span class="src-key">var</span> <a href="../iam_backup/iam_backup.html#var$dbname">$dbname</a>=<span class="src-str">&quot;mysql&quot;</span>;<a name="a42"></a><br />42    <a name="a43"></a><br />43    <span class="src-doc">/**</span><a name="a44"></a><br />44    <span class="src-doc">*</span><a name="a45"></a><br />45    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc-var">$dbuser </span><span class="src-doc">User to access the Database</span><a name="a46"></a><br />46    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a47"></a><br />47    <span class="src-doc">*/</span><a name="a48"></a><br />48        <span class="src-key">var</span> <a href="../iam_backup/iam_backup.html#var$dbuser">$dbuser</a>=<span class="src-str">&quot;root&quot;</span>;<a name="a49"></a><br />49    <a name="a50"></a><br />50    <span class="src-doc">/**</span><a name="a51"></a><br />51    <span class="src-doc">*</span><a name="a52"></a><br />52    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc-var">$dbpass </span><span class="src-doc">Password to access the Database</span><a name="a53"></a><br />53    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a54"></a><br />54    <span class="src-doc">*/</span><a name="a55"></a><br />55        <span class="src-key">var</span> <a href="../iam_backup/iam_backup.html#var$dbpass">$dbpass</a>=<span class="src-str">&quot;&quot;</span>;<a name="a56"></a><br />56    <a name="a57"></a><br />57    <span class="src-doc">/**</span><a name="a58"></a><br />58    <span class="src-doc">*</span><a name="a59"></a><br />59    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc-var">$newline </span><span class="src-doc">Newline character (OS dependant)</span><a name="a60"></a><br />60    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a61"></a><br />61    <span class="src-doc">*/</span><a name="a62"></a><br />62        <span class="src-key">var</span> <a href="../iam_backup/iam_backup.html#var$newline">$newline</a>;<a name="a63"></a><br />63    <a name="a64"></a><br />64    <span class="src-doc">/**</span><a name="a65"></a><br />65    <span class="src-doc">*</span><a name="a66"></a><br />66    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">Boolean </span><span class="src-doc"></span><span class="src-doc-var">$struct_only </span><span class="src-doc">Indicates whether the backup will contain only the DB structure and no data (when true)</span><a name="a67"></a><br />67    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a68"></a><br />68    <span class="src-doc">*/</span><a name="a69"></a><br />69        <span class="src-key">var</span> <a href="../iam_backup/iam_backup.html#var$struct_only">$struct_only</a> = <span class="src-id">false</span>;<a name="a70"></a><br />70    <a name="a71"></a><br />71    <span class="src-doc">/**</span><a name="a72"></a><br />72    <span class="src-doc">*</span><a name="a73"></a><br />73    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc-var">$output </span><span class="src-doc">Whether to send the output to the browser (when false)or download it as a file (when true)</span><a name="a74"></a><br />74    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a75"></a><br />75    <span class="src-doc">*/</span><a name="a76"></a><br />76        <span class="src-key">var</span> <a href="../iam_backup/iam_backup.html#var$output">$output</a> = <span class="src-id">true</span>;<a name="a77"></a><br />77    <a name="a78"></a><br />78    <span class="src-doc">/**</span><a name="a79"></a><br />79    <span class="src-doc">*</span><a name="a80"></a><br />80    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc-var">$compress </span><span class="src-doc">Indicates whether the dump will be compressed (using GZIP compression). It only has an effect when downloading the file.</span><a name="a81"></a><br />81    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a82"></a><br />82    <span class="src-doc">*/</span><a name="a83"></a><br />83        <span class="src-key">var</span> <a href="../iam_backup/iam_backup.html#var$compress">$compress</a> = <span class="src-id">true</span>;<a name="a84"></a><br />84    <a name="a85"></a><br />85    <span class="src-doc">/**</span><a name="a86"></a><br />86    <span class="src-doc">*</span><a name="a87"></a><br />87    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@var </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc-var">$filename </span><span class="src-doc">Indicates Path and name of the file (when the dump is done on the server). If not null, the dump will be performed on the local server. If null, the file will be sent to the browser.</span><a name="a88"></a><br />88    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a89"></a><br />89    <span class="src-doc">*/</span><a name="a90"></a><br />90        <span class="src-key">var</span> <a href="../iam_backup/iam_backup.html#var$filename">$filename</a> = <span class="src-str">&quot;&quot;</span>;<a name="a91"></a><br />91    <a name="a92"></a><br />92    <span class="src-doc">/**</span><a name="a93"></a><br />93    <span class="src-doc">* Initialize this class. Constructor</span><a name="a94"></a><br />94    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span><a name="a95"></a><br />95    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">Mixed </span><span class="src-doc"></span><span class="src-doc-var">$host </span><span class="src-doc">Host that holds the DB. The user of the class can pass it either a Hostaname (and fill in the rest of the data) or a Connection Object (and avoid filling in all the parameters). Thanks Sebastiaan van Stijn</span><a name="a96"></a><br />96    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">String </span><span class="src-doc"></span><span class="src-doc-var">$dbanme </span><span class="src-doc">Database to back up</span><a name="a97"></a><br />97    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">String </span><span class="src-doc"></span><span class="src-doc-var">$dbuser </span><span class="src-doc">User to access the Database</span><a name="a98"></a><br />98    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">String </span><span class="src-doc"></span><span class="src-doc-var">$dbpass </span><span class="src-doc">Password to access the Database</span><a name="a99"></a><br />99    <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">Boolean </span><span class="src-doc"></span><span class="src-doc-var">$output </span><span class="src-doc">Whether to send the output to the browser (when false)or download it as a file (when true)</span><a name="a100"></a><br />100   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">Boolean </span><span class="src-doc"></span><span class="src-doc-var">$struct_only </span><span class="src-doc">Indicates whether the backup will contain only the DB structure and no data (when true)</span><a name="a101"></a><br />101   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">Boolean </span><span class="src-doc"></span><span class="src-doc-var">$compress </span><span class="src-doc">Indicates whether the dump will be compressed (using GZIP compression). It only has an effect when downloading the file.</span><a name="a102"></a><br />102   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">String </span><span class="src-doc"></span><span class="src-doc-var">$filename </span><span class="src-doc">Indicates Path and name of the file (when the dump is done on the server)</span><a name="a103"></a><br />103   <span class="src-doc">*/</span><a name="a104"></a><br />104       <span class="src-key">function</span> <a href="../iam_backup/iam_backup.html#methodiam_backup">iam_backup</a><span class="src-sym">(</span><span class="src-var">$host</span> = <span class="src-str">'localhost'</span><span class="src-sym">,</span> <span class="src-var">$dbname</span> = <span class="src-str">'mysql'</span><span class="src-sym">,</span> <span class="src-var">$dbuser</span> = <span class="src-str">'root'</span><span class="src-sym">,</span> <span class="src-var">$dbpass</span> = <span class="src-str">''</span><span class="src-sym">,</span> <span class="src-var">$struct_only</span> = <span class="src-id">false</span><span class="src-sym">,</span> <span class="src-var">$output</span> = <span class="src-id">true</span><span class="src-sym">,</span> <span class="src-var">$compress</span> = <span class="src-id">true</span><span class="src-sym">,</span> <span class="src-var">$filename</span>=<span class="src-str">&quot;&quot;</span><span class="src-sym">)</span><a name="a105"></a><br />105       <span class="src-sym">{</span><a name="a106"></a><br />106           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$output">output</a>       = <span class="src-var">$output</span>;<a name="a107"></a><br />107           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$struct_only">struct_only</a>  = <span class="src-var">$struct_only</span>;<a name="a108"></a><br />108           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$compress">compress</a>     = <span class="src-var">$compress</span>;<a name="a109"></a><br />109   <a name="a110"></a><br />110           <span class="src-comm">/*</span><a name="a111"></a><br />111   <span class="src-comm">        * check if 'host' contains a connection instead of a hostname</span><a name="a112"></a><br />112   <span class="src-comm">        * Check takes place on two properties;</span><a name="a113"></a><br />113   <span class="src-comm">        * 1) check if 'host' is an object</span><a name="a114"></a><br />114   <span class="src-comm">        * 2) check if 'host' has a property called 'database' (any other connection-specific property should do)</span><a name="a115"></a><br />115   <span class="src-comm">        */</span><a name="a116"></a><br />116           <span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_object">is_object</a><span class="src-sym">(</span><span class="src-var">$host</span><span class="src-sym">)</span> &amp;&amp; isset<span class="src-sym">(</span><span class="src-var">$host</span><span class="src-sym">-&gt;</span><span class="src-id">database</span><span class="src-sym">)</span><span class="src-sym">)</span><span class="src-sym">{</span><a name="a117"></a><br />117               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$host">host</a>     = <span class="src-var">$host</span><span class="src-sym">-&gt;</span><span class="src-id">host</span>;<a name="a118"></a><br />118               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbname">dbname</a>     = <span class="src-var">$host</span><span class="src-sym">-&gt;</span><span class="src-id">database</span>;<a name="a119"></a><br />119               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbuser">dbuser</a>     = <span class="src-var">$host</span><span class="src-sym">-&gt;</span><span class="src-id">user</span>;<a name="a120"></a><br />120               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbpass">dbpass</a>     = <span class="src-var">$host</span><span class="src-sym">-&gt;</span><span class="src-id">password</span>;<a name="a121"></a><br />121           <span class="src-sym">}</span><span class="src-key">else</span><span class="src-sym">{</span><a name="a122"></a><br />122               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$host">host</a>     = <span class="src-var">$host</span>;<a name="a123"></a><br />123               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbname">dbname</a>     = <span class="src-var">$dbname</span>;<a name="a124"></a><br />124               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbuser">dbuser</a>     = <span class="src-var">$dbuser</span>;<a name="a125"></a><br />125               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbpass">dbpass</a>     = <span class="src-var">$dbpass</span>;<a name="a126"></a><br />126           <span class="src-sym">}</span><a name="a127"></a><br />127           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$filename">filename</a>    = <span class="src-var">$filename</span>;<a name="a128"></a><br />128           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>     = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#method_define_newline">_define_newline</a><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a129"></a><br />129       <span class="src-sym">}</span><a name="a130"></a><br />130   <a name="a131"></a><br />131   <span class="src-doc">/**</span><a name="a132"></a><br />132   <span class="src-doc">* Generate the DB Dump.</span><a name="a133"></a><br />133   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a134"></a><br />134   <span class="src-doc">*/</span><a name="a135"></a><br />135       <span class="src-key">function</span> <a href="../iam_backup/iam_backup.html#method_backup">_backup</a><span class="src-sym">(</span><span class="src-sym">)</span><a name="a136"></a><br />136       <span class="src-sym">{</span><a name="a137"></a><br />137           <span class="src-var">$now</span> = <a href="http://www.php.net/gmdate">gmdate</a><span class="src-sym">(</span><span class="src-str">'D, d M Y H:i:s'</span><span class="src-sym">)</span> . <span class="src-str">' GMT'</span>;<a name="a138"></a><br />138   <a name="a139"></a><br />139           <span class="src-var">$newfile</span>.= <span class="src-str">&quot;#------------------------------------------&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>;<a name="a140"></a><br />140           <span class="src-var">$newfile</span>.= <span class="src-str">&quot;# Database Backup Class by Iván Melgrati&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>;<a name="a141"></a><br />141           <span class="src-var">$newfile</span>.= &quot;<span class="src-str"># <span class="src-id">Database</span>: <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbname">dbname</a>"</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>;<a name="a142"></a><br />142           <span class="src-var">$newfile</span>.= &quot;<span class="src-str"># <span class="src-id">Date</span>: <span class="src-var">$now</span></span>&quot;.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>;<a name="a143"></a><br />143           <span class="src-var">$newfile</span>.= <span class="src-str">&quot;#------------------------------------------&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>;<a name="a144"></a><br />144   <a name="a145"></a><br />145           <span class="src-var">$result</span> = <a href="http://www.php.net/mysql_pconnect">mysql_pconnect</a><span class="src-sym">(</span>&quot;<span class="src-str"><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$host">host</a>"</span><span class="src-sym">,</span>&quot;<span class="src-str"><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbuser">dbuser</a>"</span><span class="src-sym">,</span>&quot;<span class="src-str"><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbpass">dbpass</a>"</span><span class="src-sym">)</span>;<a name="a146"></a><br />146           <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$result</span><span class="src-sym">)</span>     <span class="src-comm">// If no connection can be obtained, return empty string</span><a name="a147"></a><br />147           <span class="src-sym">{</span><a name="a148"></a><br />148           <span class="src-key">return</span> &quot;<span class="src-str"><span class="src-id">Error</span>. <span class="src-id">Can´t</span> <span class="src-id">connect</span> <span class="src-id">to</span> <span class="src-id">Database</span>: <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbname">dbname</a>"</span>;<a name="a149"></a><br />149           <span class="src-sym">}</span><a name="a150"></a><br />150   <a name="a151"></a><br />151           <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/mysql_select_db">mysql_select_db</a><span class="src-sym">(</span>&quot;<span class="src-str"><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbname">dbname</a>"</span><span class="src-sym">)</span><span class="src-sym">)</span>  <span class="src-comm">// If db can't be set, return empty string</span><a name="a152"></a><br />152           <span class="src-sym">{</span><a name="a153"></a><br />153           <span class="src-key">return</span> &quot;<span class="src-str"><span class="src-id">Error</span>. <span class="src-id">Database</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbname">dbname</a> <span class="src-id">could</span> <span class="src-id">not</span> <span class="src-id">be</span> <span class="src-id">selected</span>.</span>&quot;;<a name="a154"></a><br />154           <span class="src-sym">}</span><a name="a155"></a><br />155   <a name="a156"></a><br />156           <span class="src-var">$result</span> = <span class="src-sym">@</span><a href="http://www.php.net/mysql_query">mysql_query</a><span class="src-sym">(</span>&quot;<span class="src-str"><span class="src-id">show</span> <span class="src-id">tables</span> <span class="src-id">from</span> <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbname">dbname</a>"</span><span class="src-sym">)</span>;<a name="a157"></a><br />157           <span class="src-key">while</span> <span class="src-sym">(</span>list<span class="src-sym">(</span><span class="src-var">$table</span><span class="src-sym">)</span> = <span class="src-sym">@</span><a href="http://www.php.net/mysql_fetch_row">mysql_fetch_row</a><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">)</span><span class="src-sym">)</span><a name="a158"></a><br />158           <span class="src-sym">{</span><a name="a159"></a><br />159           <span class="src-var">$newfile</span> .= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#method_get_def">_get_def</a><span class="src-sym">(</span><span class="src-var">$table</span><span class="src-sym">)</span>;<a name="a160"></a><br />160           <span class="src-var">$newfile</span> .= &quot;<span class="src-str"><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>"</span>;<a name="a161"></a><br />161           <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$struct_only</span><span class="src-sym">)</span> <span class="src-comm">// If table data also has to be written, get table contents</span><a name="a162"></a><br />162               <span class="src-var">$newfile</span> .= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#method_get_content">_get_content</a><span class="src-sym">(</span><span class="src-var">$table</span><span class="src-sym">)</span>;<a name="a163"></a><br />163           <span class="src-var">$newfile</span> .= &quot;<span class="src-str"><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>"</span>;<a name="a164"></a><br />164           <span class="src-var">$i</span>++;<a name="a165"></a><br />165           <span class="src-sym">}</span><a name="a166"></a><br />166   <a name="a167"></a><br />167           <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#method_out">_out</a><span class="src-sym">(</span><span class="src-var">$newfile</span><span class="src-sym">)</span>;<a name="a168"></a><br />168       <span class="src-sym">}</span><a name="a169"></a><br />169   <a name="a170"></a><br />170   <span class="src-doc">/**</span><a name="a171"></a><br />171   <span class="src-doc">* Send the output to the browser</span><a name="a172"></a><br />172   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a173"></a><br />173   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">string </span><span class="src-doc"></span><span class="src-doc-var">$output </span><span class="src-doc">Contains the database dump</span><a name="a174"></a><br />174   <span class="src-doc">*/</span><a name="a175"></a><br />175       <span class="src-key">function</span> <a href="../iam_backup/iam_backup.html#method_out">_out</a><span class="src-sym">(</span><span class="src-var">$dump</span><span class="src-sym">)</span><a name="a176"></a><br />176       <span class="src-sym">{</span><a name="a177"></a><br />177           <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$filename">filename</a><span class="src-sym">)</span><a name="a178"></a><br />178           <span class="src-sym">{</span><a name="a179"></a><br />179               <span class="src-var">$fptr</span>= <a href="http://www.php.net/fopen">fopen</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$filename">filename</a><span class="src-sym">,</span> <span class="src-str">&quot;wb&quot;</span><span class="src-sym">)</span>;<a name="a180"></a><br />180               <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$fptr</span><span class="src-sym">)</span><a name="a181"></a><br />181               <span class="src-sym">{</span><a name="a182"></a><br />182                   <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$compress">compress</a><span class="src-sym">)</span><a name="a183"></a><br />183                   <span class="src-sym">{</span><a name="a184"></a><br />184                      <span class="src-var">$gzbackupData</span> = <span class="src-str">&quot;\x1f\x8b\x08\x00\x00\x00\x00\x00&quot;</span>.<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/gzcompress">gzcompress</a><span class="src-sym">(</span><span class="src-var">$dump</span><span class="src-sym">,</span><span class="src-num">9</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span>-<span class="src-num">4</span><span class="src-sym">)</span>.<a href="http://www.php.net/pack">pack</a><span class="src-sym">(</span><span class="src-str">'V'</span><span class="src-sym">,</span><a href="http://www.php.net/crc32">crc32</a><span class="src-sym">(</span><span class="src-var">$dump</span><span class="src-sym">)</span><span class="src-sym">)</span>.<a href="http://www.php.net/pack">pack</a><span class="src-sym">(</span><span class="src-str">'V'</span><span class="src-sym">,</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$dump</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a185"></a><br />185                      <a href="http://www.php.net/fwrite">fwrite</a><span class="src-sym">(</span><span class="src-var">$fptr</span><span class="src-sym">,</span> <span class="src-var">$gzbackupData</span><span class="src-sym">)</span>;<a name="a186"></a><br />186                   <span class="src-sym">}</span><a name="a187"></a><br />187                   <span class="src-key">else</span><a name="a188"></a><br />188                      <a href="http://www.php.net/fwrite">fwrite</a><span class="src-sym">(</span><span class="src-var">$fptr</span><span class="src-sym">,</span> <span class="src-var">$dump</span><span class="src-sym">)</span>;<a name="a189"></a><br />189                   <a href="http://www.php.net/fclose">fclose</a><span class="src-sym">(</span><span class="src-var">$fptr</span><span class="src-sym">)</span>;<a name="a190"></a><br />190               <span class="src-sym">}</span><a name="a191"></a><br />191           <span class="src-sym">}</span><a name="a192"></a><br />192           <span class="src-key">else</span><a name="a193"></a><br />193           <span class="src-sym">{</span><a name="a194"></a><br />194               <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$compress">compress</a><span class="src-sym">)</span> <span class="src-key">and</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$output">output</a><span class="src-sym">)</span><span class="src-sym">)</span><a name="a195"></a><br />195               <span class="src-sym">{</span><a name="a196"></a><br />196                  <span class="src-var">$gzbackupData</span> = <span class="src-str">&quot;\x1f\x8b\x08\x00\x00\x00\x00\x00&quot;</span>.<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/gzcompress">gzcompress</a><span class="src-sym">(</span><span class="src-var">$dump</span><span class="src-sym">,</span><span class="src-num">9</span><span class="src-sym">)</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span>-<span class="src-num">4</span><span class="src-sym">)</span>.<a href="http://www.php.net/pack">pack</a><span class="src-sym">(</span><span class="src-str">'V'</span><span class="src-sym">,</span><a href="http://www.php.net/crc32">crc32</a><span class="src-sym">(</span><span class="src-var">$dump</span><span class="src-sym">)</span><span class="src-sym">)</span>.<a href="http://www.php.net/pack">pack</a><span class="src-sym">(</span><span class="src-str">'V'</span><span class="src-sym">,</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$dump</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a197"></a><br />197                  echo <span class="src-var">$gzbackupData</span>;<a name="a198"></a><br />198               <span class="src-sym">}</span><a name="a199"></a><br />199               <span class="src-key">else</span><a name="a200"></a><br />200                  echo <span class="src-var">$dump</span>;<a name="a201"></a><br />201           <span class="src-sym">}</span><a name="a202"></a><br />202       <span class="src-sym">}</span><a name="a203"></a><br />203   <a name="a204"></a><br />204   <span class="src-doc">/**</span><a name="a205"></a><br />205   <span class="src-doc">* Generate the selected table's definition</span><a name="a206"></a><br />206   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a207"></a><br />207   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@return </span><span class="src-doc"></span><span class="src-doc-type">String </span><span class="src-doc"></span><span class="src-doc">table definition dump</span><a name="a208"></a><br />208   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">String </span><span class="src-doc"></span><span class="src-doc-var">$tablename </span><span class="src-doc">Name of the table to back up</span><a name="a209"></a><br />209   <span class="src-doc">*/</span><a name="a210"></a><br />210       <span class="src-key">function</span> <a href="../iam_backup/iam_backup.html#method_get_def">_get_def</a><span class="src-sym">(</span><span class="src-var">$tablename</span><span class="src-sym">)</span><a name="a211"></a><br />211       <span class="src-sym">{</span><a name="a212"></a><br />212           <span class="src-var">$def</span> = <span class="src-str">&quot;&quot;</span>;<a name="a213"></a><br />213           <span class="src-var">$def</span> .=<span class="src-str">&quot;#------------------------------------------&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>;<a name="a214"></a><br />214           <span class="src-var">$def</span> .=&quot;<span class="src-str"># <span class="src-id">Table</span> <span class="src-id">definition</span> <span class="src-id">for</span> <span class="src-var">$tablename</span></span>&quot;.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>;<a name="a215"></a><br />215           <span class="src-var">$def</span> .=<span class="src-str">&quot;#------------------------------------------&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>;<a name="a216"></a><br />216           <span class="src-var">$def</span> .= &quot;<span class="src-str"><span class="src-id">DROP</span> <span class="src-id">TABLE</span> <span class="src-id">IF</span> <span class="src-id">EXISTS</span> <span class="src-var">$tablename</span>;</span>&quot;.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>;<a name="a217"></a><br />217           <span class="src-var">$def</span> .= &quot;<span class="src-str"><span class="src-id">CREATE</span> <span class="src-id">TABLE</span> <span class="src-var">$tablename</span> (</span>&quot;.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>;<a name="a218"></a><br />218           <span class="src-var">$result</span> = <span class="src-sym">@</span><a href="http://www.php.net/mysql_query">mysql_query</a><span class="src-sym">(</span>&quot;<span class="src-str"><span class="src-id">SHOW</span> <span class="src-id">FIELDS</span> <span class="src-id">FROM</span> <span class="src-var">$tablename</span></span>&quot;<span class="src-sym">)</span> <span class="src-key">or</span> <span class="src-key">die</span><span class="src-sym">(</span>&quot;<span class="src-str"><span class="src-id">Table</span> <span class="src-var">$tablename</span> <span class="src-id">not</span> <span class="src-id">existing</span> <span class="src-id">in</span> <span class="src-id">database</span></span>&quot;<span class="src-sym">)</span>;<a name="a219"></a><br />219           <span class="src-key">while</span><span class="src-sym">(</span><span class="src-var">$row</span> = <span class="src-sym">@</span><a href="http://www.php.net/mysql_fetch_array">mysql_fetch_array</a><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">)</span><span class="src-sym">)</span><a name="a220"></a><br />220           <span class="src-sym">{</span><a name="a221"></a><br />221             <span class="src-var">$def</span> .= &quot;<span class="src-str">    <span class="src-var">$row</span><span class="src-sym">[</span><span class="src-id">Field</span><span class="src-sym">]</span> <span class="src-var">$row</span><span class="src-sym">[</span><span class="src-id">Type</span><span class="src-sym">]</span></span>&quot;;<a name="a222"></a><br />222             <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$row</span><span class="src-sym">[</span><span class="src-str">&quot;Default&quot;</span><span class="src-sym">]</span> != <span class="src-str">&quot;&quot;</span><span class="src-sym">)</span> <span class="src-var">$def</span> .= &quot;<span class="src-str"> <span class="src-id">DEFAULT</span> '<span class="src-var">$row</span><span class="src-sym">[</span><span class="src-id">Default</span><span class="src-sym">]</span>'</span>&quot;;<a name="a223"></a><br />223             <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$row</span><span class="src-sym">[</span><span class="src-str">&quot;Null&quot;</span><span class="src-sym">]</span> != <span class="src-str">&quot;YES&quot;</span><span class="src-sym">)</span> <span class="src-var">$def</span> .= <span class="src-str">&quot; NOT NULL&quot;</span>;<a name="a224"></a><br />224             <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$row</span><span class="src-sym">[</span><span class="src-id">Extra</span><span class="src-sym">]</span> != <span class="src-str">&quot;&quot;</span><span class="src-sym">)</span> <span class="src-var">$def</span> .= &quot;<span class="src-str"> <span class="src-var">$row</span><span class="src-sym">[</span><span class="src-id">Extra</span><span class="src-sym">]</span></span>&quot;;<a name="a225"></a><br />225             <span class="src-var">$def</span> .= &quot;<span class="src-str">,<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>"</span>;<a name="a226"></a><br />226           <span class="src-sym">}</span><a name="a227"></a><br />227           <span class="src-var">$def</span> = <a href="http://www.php.net/ereg_replace">ereg_replace</a><span class="src-sym">(</span>&quot;<span class="src-str">,<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>$</span>&quot;<span class="src-sym">,</span><span class="src-str">&quot;&quot;</span><span class="src-sym">,</span> <span class="src-var">$def</span><span class="src-sym">)</span>;<a name="a228"></a><br />228   <a name="a229"></a><br />229           <span class="src-var">$result</span> = <span class="src-sym">@</span><a href="http://www.php.net/mysql_query">mysql_query</a><span class="src-sym">(</span>&quot;<span class="src-str"><span class="src-id">SHOW</span> <span class="src-id">KEYS</span> <span class="src-id">FROM</span> <span class="src-var">$tablename</span></span>&quot;<span class="src-sym">)</span>;<a name="a230"></a><br />230           <span class="src-key">while</span><span class="src-sym">(</span><span class="src-var">$row</span> = <span class="src-sym">@</span><a href="http://www.php.net/mysql_fetch_array">mysql_fetch_array</a><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">)</span><span class="src-sym">)</span><a name="a231"></a><br />231           <span class="src-sym">{</span><a name="a232"></a><br />232             <span class="src-var">$kname</span>=<span class="src-var">$row</span><span class="src-sym">[</span><span class="src-id">Key_name</span><span class="src-sym">]</span>;<a name="a233"></a><br />233             <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">(</span><span class="src-var">$kname</span> != <span class="src-str">&quot;PRIMARY&quot;</span><span class="src-sym">)</span> &amp;&amp; <span class="src-sym">(</span><span class="src-var">$row</span><span class="src-sym">[</span><span class="src-id">Non_unique</span><span class="src-sym">]</span> == <span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-var">$kname</span>=&quot;<span class="src-str"><span class="src-id">UNIQUE</span>|<span class="src-var">$kname</span></span>&quot;;<a name="a234"></a><br />234             <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$index</span><span class="src-sym">[</span><span class="src-var">$kname</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-var">$index</span><span class="src-sym">[</span><span class="src-var">$kname</span><span class="src-sym">]</span> = <span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a235"></a><br />235             <span class="src-var">$index</span><span class="src-sym">[</span><span class="src-var">$kname</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">]</span> = <span class="src-var">$row</span><span class="src-sym">[</span><span class="src-id">Column_name</span><span class="src-sym">]</span>;<a name="a236"></a><br />236           <span class="src-sym">}</span><a name="a237"></a><br />237   <a name="a238"></a><br />238           <span class="src-key">while</span><span class="src-sym">(</span>list<span class="src-sym">(</span><span class="src-var">$x</span><span class="src-sym">,</span> <span class="src-var">$columns</span><span class="src-sym">)</span> = <span class="src-sym">@</span><a href="http://www.php.net/each">each</a><span class="src-sym">(</span><span class="src-var">$index</span><span class="src-sym">)</span><span class="src-sym">)</span><a name="a239"></a><br />239           <span class="src-sym">{</span><a name="a240"></a><br />240             <span class="src-var">$def</span> .= &quot;<span class="src-str">,<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>"</span>;<a name="a241"></a><br />241             <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$x</span> == <span class="src-str">&quot;PRIMARY&quot;</span><span class="src-sym">)</span> <span class="src-var">$def</span> .= <span class="src-str">&quot;   PRIMARY KEY (&quot;</span> . <a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-var">$columns</span><span class="src-sym">,</span> <span class="src-str">&quot;, &quot;</span><span class="src-sym">)</span> . <span class="src-str">&quot;)&quot;</span>;<a name="a242"></a><br />242             <span class="src-key">else</span> <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$x</span><span class="src-sym">,</span><span class="src-num">0</span><span class="src-sym">,</span><span class="src-num">6</span><span class="src-sym">)</span> == <span class="src-str">&quot;UNIQUE&quot;</span><span class="src-sym">)</span> <span class="src-var">$def</span> .= <span class="src-str">&quot;   UNIQUE &quot;</span>.<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$x</span><span class="src-sym">,</span><span class="src-num">7</span><span class="src-sym">)</span>.<span class="src-str">&quot; (&quot;</span> . <a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-var">$columns</span><span class="src-sym">,</span> <span class="src-str">&quot;, &quot;</span><span class="src-sym">)</span> . <span class="src-str">&quot;)&quot;</span>;<a name="a243"></a><br />243             <span class="src-key">else</span> <span class="src-var">$def</span> .= &quot;<span class="src-str">   <span class="src-id">KEY</span> <span class="src-var">$x</span> (</span>&quot; . <a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-var">$columns</span><span class="src-sym">,</span> <span class="src-str">&quot;, &quot;</span><span class="src-sym">)</span> . <span class="src-str">&quot;)&quot;</span>;<a name="a244"></a><br />244           <span class="src-sym">}</span><a name="a245"></a><br />245           <span class="src-var">$def</span> .= &quot;<span class="src-str"><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>);</span>&quot;;<a name="a246"></a><br />246   <a name="a247"></a><br />247           <span class="src-key">return</span> <span class="src-sym">(</span><a href="http://www.php.net/stripslashes">stripslashes</a><span class="src-sym">(</span><span class="src-var">$def</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a248"></a><br />248       <span class="src-sym">}</span><a name="a249"></a><br />249   <a name="a250"></a><br />250   <span class="src-doc">/**</span><a name="a251"></a><br />251   <span class="src-doc">* Generate the selected table's contents</span><a name="a252"></a><br />252   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a253"></a><br />253   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@return </span><span class="src-doc"></span><span class="src-doc-type">String </span><span class="src-doc"></span><span class="src-doc">table data as INSERT statements</span><a name="a254"></a><br />254   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@param </span><span class="src-doc"></span><span class="src-doc-type">String </span><span class="src-doc"></span><span class="src-doc-var">$tablename </span><span class="src-doc">Name of the table to back up</span><a name="a255"></a><br />255   <span class="src-doc">*/</span><a name="a256"></a><br />256       <span class="src-key">function</span> <a href="../iam_backup/iam_backup.html#method_get_content">_get_content</a><span class="src-sym">(</span><span class="src-var">$tablename</span><span class="src-sym">)</span><a name="a257"></a><br />257       <span class="src-sym">{</span><a name="a258"></a><br />258           <span class="src-var">$content</span> = <span class="src-str">&quot;&quot;</span>;<a name="a259"></a><br />259   <a name="a260"></a><br />260           <span class="src-var">$result</span> = <span class="src-sym">@</span><a href="http://www.php.net/mysql_query">mysql_query</a><span class="src-sym">(</span>&quot;<span class="src-str"><span class="src-id">SELECT</span> * <span class="src-id">FROM</span> <span class="src-var">$tablename</span></span>&quot;<span class="src-sym">)</span>;<a name="a261"></a><br />261   <a name="a262"></a><br />262           <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">@</span><a href="http://www.php.net/mysql_num_rows">mysql_num_rows</a><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">)</span>&gt;<span class="src-num">0</span><span class="src-sym">)</span><a name="a263"></a><br />263           <span class="src-sym">{</span><a name="a264"></a><br />264               <span class="src-var">$content</span> .=<span class="src-str">&quot;#------------------------------------------&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>;<a name="a265"></a><br />265               <span class="src-var">$content</span> .=&quot;<span class="src-str"># <span class="src-id">Data</span> <span class="src-id">inserts</span> <span class="src-id">for</span> <span class="src-var">$tablename</span></span>&quot;.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>;<a name="a266"></a><br />266               <span class="src-var">$content</span> .=<span class="src-str">&quot;#------------------------------------------&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>;<a name="a267"></a><br />267           <span class="src-sym">}</span><a name="a268"></a><br />268   <a name="a269"></a><br />269           <span class="src-key">while</span><span class="src-sym">(</span><span class="src-var">$row</span> = <span class="src-sym">@</span><a href="http://www.php.net/mysql_fetch_row">mysql_fetch_row</a><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">)</span><span class="src-sym">)</span><a name="a270"></a><br />270           <span class="src-sym">{</span><a name="a271"></a><br />271             <span class="src-var">$insert</span> = &quot;<span class="src-str"><span class="src-id">INSERT</span> <span class="src-id">INTO</span> <span class="src-var">$tablename</span> <span class="src-id">VALUES</span> (</span>&quot;;<a name="a272"></a><br />272   <a name="a273"></a><br />273             <span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$j</span>=<span class="src-num">0</span>; <span class="src-var">$j</span>&lt;<span class="src-sym">@</span><a href="http://www.php.net/mysql_num_fields">mysql_num_fields</a><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">)</span>;<span class="src-var">$j</span>++<span class="src-sym">)</span><a name="a274"></a><br />274             <span class="src-sym">{</span><a name="a275"></a><br />275               <span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$row</span><span class="src-sym">[</span><span class="src-var">$j</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">)</span> <span class="src-var">$insert</span> .= <span class="src-str">&quot;NULL,&quot;</span>;<a name="a276"></a><br />276               <span class="src-key">else</span> <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$row</span><span class="src-sym">[</span><span class="src-var">$j</span><span class="src-sym">]</span> != <span class="src-str">&quot;&quot;</span><span class="src-sym">)</span> <span class="src-var">$insert</span> .= <span class="src-str">&quot;'&quot;</span>.<a href="http://www.php.net/addslashes">addslashes</a><span class="src-sym">(</span><span class="src-var">$row</span><span class="src-sym">[</span><span class="src-var">$j</span><span class="src-sym">]</span><span class="src-sym">)</span>.<span class="src-str">&quot;',&quot;</span>;<a name="a277"></a><br />277               <span class="src-key">else</span> <span class="src-var">$insert</span> .= <span class="src-str">&quot;'',&quot;</span>;<a name="a278"></a><br />278             <span class="src-sym">}</span><a name="a279"></a><br />279   <a name="a280"></a><br />280             <span class="src-var">$insert</span> = <a href="http://www.php.net/ereg_replace">ereg_replace</a><span class="src-sym">(</span>&quot;<span class="src-str">,$</span>&quot;<span class="src-sym">,</span> <span class="src-str">&quot;&quot;</span><span class="src-sym">,</span> <span class="src-var">$insert</span><span class="src-sym">)</span>;<a name="a281"></a><br />281             <span class="src-var">$insert</span> .= &quot;<span class="src-str">);<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>"</span>;<a name="a282"></a><br />282             <span class="src-var">$content</span> .= <span class="src-var">$insert</span>;<a name="a283"></a><br />283           <span class="src-sym">}</span><a name="a284"></a><br />284   <a name="a285"></a><br />285           <span class="src-key">return</span> <span class="src-var">$content</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$newline">newline</a>;<a name="a286"></a><br />286       <span class="src-sym">}</span><a name="a287"></a><br />287   <a name="a288"></a><br />288   <span class="src-doc">/**</span><a name="a289"></a><br />289   <span class="src-doc">* Define EOL character according to target OS</span><a name="a290"></a><br />290   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@return </span><span class="src-doc"></span><span class="src-doc-type">String </span><span class="src-doc"></span><span class="src-doc">a string containing the newline sequence used by the client (browser)</span><a name="a291"></a><br />291   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a292"></a><br />292   <span class="src-doc">*/</span><a name="a293"></a><br />293       <span class="src-key">function</span> <a href="../iam_backup/iam_backup.html#method_define_newline">_define_newline</a><span class="src-sym">(</span><span class="src-sym">)</span><a name="a294"></a><br />294       <span class="src-sym">{</span><a name="a295"></a><br />295            <span class="src-var">$unewline</span> = <span class="src-str">&quot;\r\n&quot;</span>;<a name="a296"></a><br />296   <a name="a297"></a><br />297            <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">&quot;HTTP_USER_AGENT&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-str">'win'</span><span class="src-sym">)</span><span class="src-sym">)</span><a name="a298"></a><br />298            <span class="src-sym">{</span><a name="a299"></a><br />299               <span class="src-var">$unewline</span> = <span class="src-str">&quot;\r\n&quot;</span>;<a name="a300"></a><br />300            <span class="src-sym">}</span><a name="a301"></a><br />301            <span class="src-key">else</span> <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/strstr">strstr</a><span class="src-sym">(</span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">&quot;HTTP_USER_AGENT&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-str">'mac'</span><span class="src-sym">)</span><span class="src-sym">)</span><a name="a302"></a><br />302            <span class="src-sym">{</span><a name="a303"></a><br />303               <span class="src-var">$unewline</span> = <span class="src-str">&quot;\r&quot;</span>;<a name="a304"></a><br />304            <span class="src-sym">}</span><a name="a305"></a><br />305            <span class="src-key">else</span><a name="a306"></a><br />306            <span class="src-sym">{</span><a name="a307"></a><br />307               <span class="src-var">$unewline</span> = <span class="src-str">&quot;\n&quot;</span>;<a name="a308"></a><br />308            <span class="src-sym">}</span><a name="a309"></a><br />309   <a name="a310"></a><br />310            <span class="src-key">return</span> <span class="src-var">$unewline</span>;<a name="a311"></a><br />311       <span class="src-sym">}</span><a name="a312"></a><br />312   <a name="a313"></a><br />313   <span class="src-doc">/**</span><a name="a314"></a><br />314   <span class="src-doc">* Define the client's browser type</span><a name="a315"></a><br />315   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@return </span><span class="src-doc"></span><span class="src-doc-type">String </span><span class="src-doc"></span><span class="src-doc">a String containing the browser type (IE, OPERA, MOZILA, etc.)</span><a name="a316"></a><br />316   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a317"></a><br />317   <span class="src-doc">*/</span><a name="a318"></a><br />318       <span class="src-key">function</span> <a href="../iam_backup/iam_backup.html#method_get_browser_type">_get_browser_type</a><span class="src-sym">(</span><span class="src-sym">)</span><a name="a319"></a><br />319       <span class="src-sym">{</span><a name="a320"></a><br />320           <span class="src-var">$USER_BROWSER_AGENT</span>=<span class="src-str">&quot;&quot;</span>;<a name="a321"></a><br />321   <a name="a322"></a><br />322           <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/ereg">ereg</a><span class="src-sym">(</span><span class="src-str">'OPERA(/| )([0-9].[0-9]{1,2})'</span><span class="src-sym">,</span> <a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">&quot;HTTP_USER_AGENT&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$log_version</span><span class="src-sym">)</span><span class="src-sym">)</span><a name="a323"></a><br />323           <span class="src-sym">{</span><a name="a324"></a><br />324               <span class="src-var">$USER_BROWSER_AGENT</span>=<span class="src-str">'OPERA'</span>;<a name="a325"></a><br />325           <span class="src-sym">}</span><a name="a326"></a><br />326           <span class="src-key">else</span> <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/ereg">ereg</a><span class="src-sym">(</span><span class="src-str">'MSIE ([0-9].[0-9]{1,2})'</span><span class="src-sym">,</span><a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">&quot;HTTP_USER_AGENT&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$log_version</span><span class="src-sym">)</span><span class="src-sym">)</span><a name="a327"></a><br />327           <span class="src-sym">{</span><a name="a328"></a><br />328               <span class="src-var">$USER_BROWSER_AGENT</span>=<span class="src-str">'IE'</span>;<a name="a329"></a><br />329           <span class="src-sym">}</span><a name="a330"></a><br />330           <span class="src-key">else</span> <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/ereg">ereg</a><span class="src-sym">(</span><span class="src-str">'OMNIWEB/([0-9].[0-9]{1,2})'</span><span class="src-sym">,</span> <a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">&quot;HTTP_USER_AGENT&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$log_version</span><span class="src-sym">)</span><span class="src-sym">)</span><a name="a331"></a><br />331           <span class="src-sym">{</span><a name="a332"></a><br />332               <span class="src-var">$USER_BROWSER_AGENT</span>=<span class="src-str">'OMNIWEB'</span>;<a name="a333"></a><br />333           <span class="src-sym">}</span><a name="a334"></a><br />334           <span class="src-key">else</span> <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/ereg">ereg</a><span class="src-sym">(</span><span class="src-str">'MOZILLA/([0-9].[0-9]{1,2})'</span><span class="src-sym">,</span> <a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">&quot;HTTP_USER_AGENT&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$log_version</span><span class="src-sym">)</span><span class="src-sym">)</span><a name="a335"></a><br />335           <span class="src-sym">{</span><a name="a336"></a><br />336               <span class="src-var">$USER_BROWSER_AGENT</span>=<span class="src-str">'MOZILLA'</span>;<a name="a337"></a><br />337           <span class="src-sym">}</span><a name="a338"></a><br />338           <span class="src-key">else</span> <span class="src-key">if</span> <span class="src-sym">(</span><a href="http://www.php.net/ereg">ereg</a><span class="src-sym">(</span><span class="src-str">'KONQUEROR/([0-9].[0-9]{1,2})'</span><span class="src-sym">,</span> <a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$_SERVER</span><span class="src-sym">[</span><span class="src-str">&quot;HTTP_USER_AGENT&quot;</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,</span> <span class="src-var">$log_version</span><span class="src-sym">)</span><span class="src-sym">)</span><a name="a339"></a><br />339           <span class="src-sym">{</span><a name="a340"></a><br />340               <span class="src-var">$USER_BROWSER_AGENT</span>=<span class="src-str">'KONQUEROR'</span>;<a name="a341"></a><br />341           <span class="src-sym">}</span><a name="a342"></a><br />342           <span class="src-key">else</span><a name="a343"></a><br />343           <span class="src-sym">{</span><a name="a344"></a><br />344               <span class="src-var">$USER_BROWSER_AGENT</span>=<span class="src-str">'OTHER'</span>;<a name="a345"></a><br />345           <span class="src-sym">}</span><a name="a346"></a><br />346   <a name="a347"></a><br />347           <span class="src-key">return</span> <span class="src-var">$USER_BROWSER_AGENT</span>;<a name="a348"></a><br />348       <span class="src-sym">}</span><a name="a349"></a><br />349   <a name="a350"></a><br />350   <span class="src-doc">/**</span><a name="a351"></a><br />351   <span class="src-doc">* Define MIME-TYPE according to target Browser</span><a name="a352"></a><br />352   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@return </span><span class="src-doc"></span><span class="src-doc-type">String </span><span class="src-doc"></span><span class="src-doc">a string containing the MIME-TYPE header to send to the browser</span><a name="a353"></a><br />353   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> private</span><a name="a354"></a><br />354   <span class="src-doc">*/</span><a name="a355"></a><br />355       <span class="src-key">function</span> <a href="../iam_backup/iam_backup.html#method_get_mime_type">_get_mime_type</a><span class="src-sym">(</span><span class="src-sym">)</span><a name="a356"></a><br />356       <span class="src-sym">{</span><a name="a357"></a><br />357           <span class="src-var">$USER_BROWSER_AGENT</span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#method_get_browser_type">_get_browser_type</a><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a358"></a><br />358   <a name="a359"></a><br />359           <span class="src-var">$mime_type</span> = <span class="src-sym">(</span><span class="src-var">$USER_BROWSER_AGENT</span> == <span class="src-str">'IE'</span> || <span class="src-var">$USER_BROWSER_AGENT</span> == <span class="src-str">'OPERA'</span><span class="src-sym">)</span><a name="a360"></a><br />360                          ? <span class="src-str">'application/octetstream'</span><a name="a361"></a><br />361                          : <span class="src-str">'application/octet-stream'</span>;<a name="a362"></a><br />362           <span class="src-key">return</span> <span class="src-var">$mime_type</span>;<a name="a363"></a><br />363       <span class="src-sym">}</span><a name="a364"></a><br />364   <a name="a365"></a><br />365   <span class="src-doc">/**</span><a name="a366"></a><br />366   <span class="src-doc">* Generate the DB backup and send it to browser or download it as a file</span><a name="a367"></a><br />367   <span class="src-doc">*</span><span class="src-doc"> </span><span class="src-doc-coretag">@access</span><span class="src-doc"> public</span><a name="a368"></a><br />368   <span class="src-doc">*/</span><a name="a369"></a><br />369       <span class="src-key">function</span> <a href="../iam_backup/iam_backup.html#methodperform_backup">perform_backup</a><span class="src-sym">(</span><span class="src-sym">)</span><a name="a370"></a><br />370       <span class="src-sym">{</span><a name="a371"></a><br />371   <a name="a372"></a><br />372           <span class="src-var">$now</span> = <a href="http://www.php.net/gmdate">gmdate</a><span class="src-sym">(</span><span class="src-str">'D, d M Y H:i:s'</span><span class="src-sym">)</span> . <span class="src-str">' GMT'</span>;<a name="a373"></a><br />373           <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$compress">compress</a><span class="src-sym">)</span><a name="a374"></a><br />374           <span class="src-sym">{</span><a name="a375"></a><br />375               <span class="src-var">$filename</span> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbname">dbname</a>.<span class="src-str">&quot;.sql&quot;</span>;<a name="a376"></a><br />376               <span class="src-var">$ext</span> = <span class="src-str">&quot;gz&quot;</span>;<a name="a377"></a><br />377           <span class="src-sym">}</span><a name="a378"></a><br />378           <span class="src-key">else</span><a name="a379"></a><br />379           <span class="src-sym">{</span><a name="a380"></a><br />380               <span class="src-var">$filename</span> = <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$dbname">dbname</a>;<a name="a381"></a><br />381               <span class="src-var">$ext</span> = <span class="src-str">&quot;sql&quot;</span>;<a name="a382"></a><br />382           <span class="src-sym">}</span><a name="a383"></a><br />383   <a name="a384"></a><br />384           <span class="src-var">$USER_BROWSER_AGENT</span>= <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#method_get_browser_type">_get_browser_type</a><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a385"></a><br />385   <a name="a386"></a><br />386           <span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$filename">filename</a><span class="src-sym">)</span><a name="a387"></a><br />387           <span class="src-sym">{</span><a name="a388"></a><br />388               <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#method_backup">_backup</a><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a389"></a><br />389           <span class="src-sym">}</span><a name="a390"></a><br />390           <span class="src-key">else</span><a name="a391"></a><br />391               <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#var$output">output</a> == <span class="src-id">true</span><span class="src-sym">)</span><a name="a392"></a><br />392               <span class="src-sym">{</span><a name="a393"></a><br />393                    <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">'Content-Type: '</span> . <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#method_get_mime_type">_get_mime_type</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a394"></a><br />394                    <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">'Expires: '</span> . <span class="src-var">$now</span><span class="src-sym">)</span>;<a name="a395"></a><br />395                    <span class="src-key">if</span> <span class="src-sym">(</span><span class="src-var">$USER_BROWSER_AGENT</span> == <span class="src-str">'IE'</span><span class="src-sym">)</span><a name="a396"></a><br />396                    <span class="src-sym">{</span><a name="a397"></a><br />397                         <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">'Content-Disposition: inline; filename=&quot;'</span> . <span class="src-var">$filename</span> . <span class="src-str">'.'</span> . <span class="src-var">$ext</span> . <span class="src-str">'&quot;'</span><span class="src-sym">)</span>;<a name="a398"></a><br />398                         <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">'Cache-Control: must-revalidate, post-check=0, pre-check=0'</span><span class="src-sym">)</span>;<a name="a399"></a><br />399                         <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">'Pragma: public'</span><span class="src-sym">)</span>;<a name="a400"></a><br />400                    <span class="src-sym">}</span><a name="a401"></a><br />401                    <span class="src-key">else</span><a name="a402"></a><br />402                    <span class="src-sym">{</span><a name="a403"></a><br />403                         <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">'Content-Disposition: attachment; filename=&quot;'</span> . <span class="src-var">$filename</span> . <span class="src-str">'.'</span> . <span class="src-var">$ext</span> . <span class="src-str">'&quot;'</span><span class="src-sym">)</span>;<a name="a404"></a><br />404                         <a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-str">'Pragma: no-cache'</span><span class="src-sym">)</span>;<a name="a405"></a><br />405                    <span class="src-sym">}</span><a name="a406"></a><br />406   <a name="a407"></a><br />407                    <span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#method_backup">_backup</a><span class="src-sym">(</span><span class="src-sym">)</span>;<a name="a408"></a><br />408               <span class="src-sym">}</span><a name="a409"></a><br />409               <span class="src-key">else</span><a name="a410"></a><br />410               <span class="src-sym">{</span><a name="a411"></a><br />411                    echo <span class="src-str">&quot;&lt;html&gt;&lt;body&gt;&lt;pre&gt;&quot;</span>;<a name="a412"></a><br />412                    echo <a href="http://www.php.net/htmlspecialchars">htmlspecialchars</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../iam_backup/iam_backup.html#method_backup">_backup</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">)</span>;<a name="a413"></a><br />413                    echo <span class="src-str">&quot;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;&quot;</span>;<a name="a414"></a><br />414               <span class="src-sym">}</span><a name="a415"></a><br />415       <span class="src-sym">}</span><a name="a416"></a><br />416   <span class="src-sym">}</span><a name="a417"></a><br />417   <a name="a418"></a><br />418   <span class="src-php">?&gt;</span></pre>
</div>
	<p class="notes" id="credit">
		Documentation generated on Tue, 16 Dec 2003 20:31:34 -0300 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.2.3</a>
	</p>
	</body>
</html>
Return current item: IAM Backup