Location: PHPKode > scripts > IAM Backup > iam-backup/docs/iam_backup/iam_backup.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>Docs For Class iam_backup</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class iam_backup</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
			</div>
	<div class="info-box-body">
		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">IAM_Backup A class for backing up an entire Database and send the dump to the browser or download it as a file</p>
		<p class="notes">
			Located in <a class="field" href="_Backup_iam_backup_php.html">/iam_backup.php</a> (line <span class="field"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a27">27</a></span>)
		</p>
		
		        
		<pre></pre>
	
			</div>
</div>


	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<div class="var-summary">
								<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$compress" title="details" class="var-name">$compress</a>
				</div>
								<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$dbname" title="details" class="var-name">$dbname</a>
				</div>
								<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$dbpass" title="details" class="var-name">$dbpass</a>
				</div>
								<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$dbuser" title="details" class="var-name">$dbuser</a>
				</div>
								<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$filename" title="details" class="var-name">$filename</a>
				</div>
								<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$host" title="details" class="var-name">$host</a>
				</div>
								<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$newline" title="details" class="var-name">$newline</a>
				</div>
								<div class="var-title">
					<span class="var-type">string</span>
					<a href="#$output" title="details" class="var-name">$output</a>
				</div>
								<div class="var-title">
					<span class="var-type">Boolean</span>
					<a href="#$struct_only" title="details" class="var-name">$struct_only</a>
				</div>
							</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
								
				<div class="method-definition">
											<span class="method-result">iam_backup</span>
										<a href="#iam_backup" title="details" class="method-name">iam_backup</a>
											([<span class="var-type">Mixed</span>&nbsp;<span class="var-name">$host</span> = <span class="var-default">'localhost'</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$dbname</span> = <span class="var-default">'mysql'</span>], [<span class="var-type">String</span>&nbsp;<span class="var-name">$dbuser</span> = <span class="var-default">'root'</span>], [<span class="var-type">String</span>&nbsp;<span class="var-name">$dbpass</span> = <span class="var-default">''</span>], [<span class="var-type">Boolean</span>&nbsp;<span class="var-name">$struct_only</span> = <span class="var-default">false</span>], [<span class="var-type">Boolean</span>&nbsp;<span class="var-name">$output</span> = <span class="var-default">true</span>], [<span class="var-type">Boolean</span>&nbsp;<span class="var-name">$compress</span> = <span class="var-default">true</span>], [<span class="var-type">String</span>&nbsp;<span class="var-name">$filename</span> = <span class="var-default">""</span>], <span class="var-type">String</span>&nbsp;<span class="var-name">$dbanme</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#perform_backup" title="details" class="method-name">perform_backup</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#_backup" title="details" class="method-name">_backup</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">String</span>
										<a href="#_define_newline" title="details" class="method-name">_define_newline</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">String</span>
										<a href="#_get_browser_type" title="details" class="method-name">_get_browser_type</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">String</span>
										<a href="#_get_content" title="details" class="method-name">_get_content</a>
											(<span class="var-type">String</span>&nbsp;<span class="var-name">$tablename</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">String</span>
										<a href="#_get_def" title="details" class="method-name">_get_def</a>
											(<span class="var-type">String</span>&nbsp;<span class="var-name">$tablename</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">String</span>
										<a href="#_get_mime_type" title="details" class="method-name">_get_mime_type</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#_out" title="details" class="method-name">_out</a>
											(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$dump</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$output</span>)
									</div>
							</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$compress" id="$compress"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$compress</span>
			 = <span class="var-default"> true</span>			(line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a83">83</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> Indicates whether the dump will be compressed (using GZIP compression). It only has an effect when downloading the file.</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$dbname" id="$dbname"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$dbname</span>
			 = <span class="var-default">&quot;mysql&quot;</span>			(line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a41">41</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> Database to back up</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$dbpass" id="$dbpass"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$dbpass</span>
			 = <span class="var-default">&quot;&quot;</span>			(line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a55">55</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> Password to access the Database</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$dbuser" id="$dbuser"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$dbuser</span>
			 = <span class="var-default">&quot;root&quot;</span>			(line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a48">48</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> User to access the Database</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$filename" id="$filename"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$filename</span>
			 = <span class="var-default"> &quot;&quot;</span>			(line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a90">90</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> 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.</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$host" id="$host"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$host</span>
			 = <span class="var-default">&quot;localhost&quot;</span>			(line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a34">34</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> Host that holds the DB</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$newline" id="$newline"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$newline</span>
						(line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a62">62</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> Newline character (OS dependant)</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$output" id="$output"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">string</span>
			<span class="var-name">$output</span>
			 = <span class="var-default"> true</span>			(line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a76">76</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> Whether to send the output to the browser (when false)or download it as a file (when true)</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
<a name="var$struct_only" id="$struct_only"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">Boolean</span>
			<span class="var-name">$struct_only</span>
			 = <span class="var-default"> false</span>			(line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a69">69</a></span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">var:</span> Indicates whether the backup will contain only the DB structure and no data (when true)</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	
		
		

</div>
						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
														<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodiam_backup" id="iam_backup"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">Constructor iam_backup</span> (line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a104">104</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Initialize this class. Constructor</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">iam_backup</span>
		<span class="method-name">
			iam_backup
		</span>
					([<span class="var-type">Mixed</span>&nbsp;<span class="var-name">$host</span> = <span class="var-default">'localhost'</span>], [<span class="var-type">mixed</span>&nbsp;<span class="var-name">$dbname</span> = <span class="var-default">'mysql'</span>], [<span class="var-type">String</span>&nbsp;<span class="var-name">$dbuser</span> = <span class="var-default">'root'</span>], [<span class="var-type">String</span>&nbsp;<span class="var-name">$dbpass</span> = <span class="var-default">''</span>], [<span class="var-type">Boolean</span>&nbsp;<span class="var-name">$struct_only</span> = <span class="var-default">false</span>], [<span class="var-type">Boolean</span>&nbsp;<span class="var-name">$output</span> = <span class="var-default">true</span>], [<span class="var-type">Boolean</span>&nbsp;<span class="var-name">$compress</span> = <span class="var-default">true</span>], [<span class="var-type">String</span>&nbsp;<span class="var-name">$filename</span> = <span class="var-default">""</span>], <span class="var-type">String</span>&nbsp;<span class="var-name">$dbanme</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">Mixed</span>
				<span class="var-name">$host</span><span class="var-description">: 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>			</li>
					<li>
				<span class="var-type">String</span>
				<span class="var-name">$dbanme</span><span class="var-description">: Database to back up</span>			</li>
					<li>
				<span class="var-type">String</span>
				<span class="var-name">$dbuser</span><span class="var-description">: User to access the Database</span>			</li>
					<li>
				<span class="var-type">String</span>
				<span class="var-name">$dbpass</span><span class="var-description">: Password to access the Database</span>			</li>
					<li>
				<span class="var-type">Boolean</span>
				<span class="var-name">$output</span><span class="var-description">: Whether to send the output to the browser (when false)or download it as a file (when true)</span>			</li>
					<li>
				<span class="var-type">Boolean</span>
				<span class="var-name">$struct_only</span><span class="var-description">: Indicates whether the backup will contain only the DB structure and no data (when true)</span>			</li>
					<li>
				<span class="var-type">Boolean</span>
				<span class="var-name">$compress</span><span class="var-description">: Indicates whether the dump will be compressed (using GZIP compression). It only has an effect when downloading the file.</span>			</li>
					<li>
				<span class="var-type">String</span>
				<span class="var-name">$filename</span><span class="var-description">: Indicates Path and name of the file (when the dump is done on the server)</span>			</li>
				</ul>
		
		
	</div>
<a name="methodperform_backup" id="perform_backup"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">perform_backup</span> (line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a369">369</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Generate the DB backup and send it to browser or download it as a file</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			perform_backup
		</span>
				()
			</div>
	
		
		
	</div>
<a name="method_backup" id="_backup"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">_backup</span> (line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a135">135</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Generate the DB Dump.</p>
	<ul class="tags">
				<li><span class="field">access:</span> private</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			_backup
		</span>
				()
			</div>
	
		
		
	</div>
<a name="method_define_newline" id="_define_newline"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">_define_newline</span> (line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a293">293</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Define EOL character according to target OS</p>
	<ul class="tags">
				<li><span class="field">return:</span> a string containing the newline sequence used by the client (browser)</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">String</span>
		<span class="method-name">
			_define_newline
		</span>
				()
			</div>
	
		
		
	</div>
<a name="method_get_browser_type" id="_get_browser_type"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">_get_browser_type</span> (line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a318">318</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Define the client's browser type</p>
	<ul class="tags">
				<li><span class="field">return:</span> a String containing the browser type (IE, OPERA, MOZILA, etc.)</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">String</span>
		<span class="method-name">
			_get_browser_type
		</span>
				()
			</div>
	
		
		
	</div>
<a name="method_get_content" id="_get_content"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">_get_content</span> (line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a256">256</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Generate the selected table's contents</p>
	<ul class="tags">
				<li><span class="field">return:</span> table data as INSERT statements</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">String</span>
		<span class="method-name">
			_get_content
		</span>
					(<span class="var-type">String</span>&nbsp;<span class="var-name">$tablename</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">String</span>
				<span class="var-name">$tablename</span><span class="var-description">: Name of the table to back up</span>			</li>
				</ul>
		
		
	</div>
<a name="method_get_def" id="_get_def"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">_get_def</span> (line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a210">210</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Generate the selected table's definition</p>
	<ul class="tags">
				<li><span class="field">return:</span> table definition dump</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">String</span>
		<span class="method-name">
			_get_def
		</span>
					(<span class="var-type">String</span>&nbsp;<span class="var-name">$tablename</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">String</span>
				<span class="var-name">$tablename</span><span class="var-description">: Name of the table to back up</span>			</li>
				</ul>
		
		
	</div>
<a name="method_get_mime_type" id="_get_mime_type"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">_get_mime_type</span> (line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a355">355</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Define MIME-TYPE according to target Browser</p>
	<ul class="tags">
				<li><span class="field">return:</span> a string containing the MIME-TYPE header to send to the browser</li>
				<li><span class="field">access:</span> private</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">String</span>
		<span class="method-name">
			_get_mime_type
		</span>
				()
			</div>
	
		
		
	</div>
<a name="method_out" id="_out"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">_out</span> (line <span class="line-number"><a href="..//__filesource/fsource_iam_backup__iam_backup.php.html#a175">175</a></span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Send the output to the browser</p>
	<ul class="tags">
				<li><span class="field">access:</span> private</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			_out
		</span>
					(<span class="var-type">mixed</span>&nbsp;<span class="var-name">$dump</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$output</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$output</span><span class="var-description">: Contains the database dump</span>			</li>
				</ul>
		
		
	</div>
						
		</div>
	</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>
	</div></body>
</html>
Return current item: IAM Backup