db
Packages
Interfaces
Classes
Files

Class: Backup

Source Location: /db/backup.class.php [line 33]

Class Overview


This class helps you to generate the backup file of your data base.

Author(s):

  • Benoît Sautel ben.popeye@gmail.com / Régis Viarre crowkait@phpboost.com


Class Details

This class helps you to generate the backup file of your data base.

Tags:

  • author: Benoît Sautel ben.popeye@gmail.com / Régis Viarre crowkait@phpboost.com
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]


Class Methods

constructor Backup [line 38]

Backup Backup( )
Builds a Backup object
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method concatenate_to_query [line 155]

void concatenate_to_query( string $string)
Concatenates a string at the end of the current script.

Parameters:

string   $string   String to concatenate.
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method export_file [line 217]

void export_file( string $file_path)
Writes the backup script in a text file.

Parameters:

string   $file_path   Path of the file.
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method extract_table_structure [line 231]

unknown_type extract_table_structure( [$tables $tables = array()])

Parameters:

$tables   $tables  
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method generate_create_table_query [line 83]

void generate_create_table_query( [string[] $table_list = array()])
Concatenates the tables creation to the SQL backup script.

Parameters:

string[]   $table_list   names of the tables which must be created by the backup script. If you want to generate the query which will create all the tables, don't use this parameter of let an empty array.
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method generate_drop_table_query [line 65]

void generate_drop_table_query( [string[] $table_list = array()])
Concatenates the query which drops the PHPBoost tables only if they exist to the backup SQL script.

Parameters:

string[]   $table_list   names of the tables which must be dropped by the query. If you want to generate the query which will drop all the tables, don't use this parameter of let an empty array.
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method generate_insert_values_query [line 107]

void generate_insert_values_query( [$tables $tables = array()])
Concatenates the tables content insertion queries to the SQL backup script.

Parameters:

$tables   $tables   names of the tables which must be filled by the backup script. If you want to generate the query which will fill all the tables, don't use this parameter of let an empty array.
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method get_script [line 164]

string get_script( )
Returns the current backup script.

Tags:

  • return: the whole script
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method get_tables_list [line 197]

string[] get_tables_list( )
Retrieves the list of the tables used by PHPBoost.

Tags:

  • return: The list of the table names.
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method get_tables_number [line 207]

int get_tables_number( )
Returns the number of tables used by PHPBoost.

Tags:

  • return: number of tables
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method get_tables_properties_list [line 187]

string[] get_tables_properties_list( )
Lists the tables (name and informations relative to each table) of the data base at which is connected this SQL object. This method calls the SHOW TABLE STATUS MySQL query, to know more about it, see http://dev.mysql.com/doc/refman/5.1/en/show-table-status.html

Tags:

  • return: Map containing the following structure: for each table: table_name => array( 'name' => name of the table, 'engine' => storage engine of the table, 'row_format' => row storage format, 'rows' => number of rows, 'data_length' => the length of the data file, 'index_length' => the length of the index file, 'data_free' => the number of allocated but unused bytes, 'collation' => the table's character set and collation, 'auto_increment' => the next AUTO_INCREMENT value, 'create_time' => when the table was created, 'update_time' => when the data file was last updated )
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]

method list_db_tables [line 49]

void list_db_tables( )
Retrieves the list of the tables present on the database used.
[ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]


Class Variables

[line 276]   string  $backup_script  =  ''

Tags:

    [ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]
    [line 272]   string[]  $tables  = array()

    Tags:

      [ Top ] - [ Class Details ] - [ Methods ] - [ Variables ]
      Documentation generated on Tue, 28 Jul 2009 22:43:34 +0200 by phpDocumentor 1.4.1