Class iam_backup

Description

IAM_Backup A class for backing up an entire Database and send the dump to the browser or download it as a file

Located in /iam_backup.php (line 27)


	
			
Variable Summary
string $compress
string $dbname
string $dbpass
string $dbuser
string $filename
string $host
string $newline
string $output
Boolean $struct_only
Method Summary
iam_backup iam_backup ([Mixed $host = 'localhost'], [mixed $dbname = 'mysql'], [String $dbuser = 'root'], [String $dbpass = ''], [Boolean $struct_only = false], [Boolean $output = true], [Boolean $compress = true], [String $filename = ""], String $dbanme)
void perform_backup ()
void _backup ()
String _define_newline ()
String _get_browser_type ()
String _get_content (String $tablename)
String _get_def (String $tablename)
String _get_mime_type ()
void _out (mixed $dump, string $output)
Variables
string $compress = true (line 83)
  • var: Indicates whether the dump will be compressed (using GZIP compression). It only has an effect when downloading the file.
  • access: private
string $dbname = "mysql" (line 41)
  • var: Database to back up
  • access: private
string $dbpass = "" (line 55)
  • var: Password to access the Database
  • access: private
string $dbuser = "root" (line 48)
  • var: User to access the Database
  • access: private
string $filename = "" (line 90)
  • var: 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.
  • access: private
string $host = "localhost" (line 34)
  • var: Host that holds the DB
  • access: private
string $newline (line 62)
  • var: Newline character (OS dependant)
  • access: private
string $output = true (line 76)
  • var: Whether to send the output to the browser (when false)or download it as a file (when true)
  • access: private
Boolean $struct_only = false (line 69)
  • var: Indicates whether the backup will contain only the DB structure and no data (when true)
  • access: private
Methods
Constructor iam_backup (line 104)

Initialize this class. Constructor

  • access: public
iam_backup iam_backup ([Mixed $host = 'localhost'], [mixed $dbname = 'mysql'], [String $dbuser = 'root'], [String $dbpass = ''], [Boolean $struct_only = false], [Boolean $output = true], [Boolean $compress = true], [String $filename = ""], String $dbanme)
  • Mixed $host: 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
  • String $dbanme: Database to back up
  • String $dbuser: User to access the Database
  • String $dbpass: Password to access the Database
  • Boolean $output: Whether to send the output to the browser (when false)or download it as a file (when true)
  • Boolean $struct_only: Indicates whether the backup will contain only the DB structure and no data (when true)
  • Boolean $compress: Indicates whether the dump will be compressed (using GZIP compression). It only has an effect when downloading the file.
  • String $filename: Indicates Path and name of the file (when the dump is done on the server)
perform_backup (line 369)

Generate the DB backup and send it to browser or download it as a file

  • access: public
void perform_backup ()
_backup (line 135)

Generate the DB Dump.

  • access: private
void _backup ()
_define_newline (line 293)

Define EOL character according to target OS

  • return: a string containing the newline sequence used by the client (browser)
  • access: private
String _define_newline ()
_get_browser_type (line 318)

Define the client's browser type

  • return: a String containing the browser type (IE, OPERA, MOZILA, etc.)
  • access: private
String _get_browser_type ()
_get_content (line 256)

Generate the selected table's contents

  • return: table data as INSERT statements
  • access: private
String _get_content (String $tablename)
  • String $tablename: Name of the table to back up
_get_def (line 210)

Generate the selected table's definition

  • return: table definition dump
  • access: private
String _get_def (String $tablename)
  • String $tablename: Name of the table to back up
_get_mime_type (line 355)

Define MIME-TYPE according to target Browser

  • return: a string containing the MIME-TYPE header to send to the browser
  • access: private
String _get_mime_type ()
_out (line 175)

Send the output to the browser

  • access: private
void _out (mixed $dump, string $output)
  • string $output: Contains the database dump

Documentation generated on Tue, 16 Dec 2003 20:31:34 -0300 by phpDocumentor 1.2.3