Property | Type | Description | |
---|---|---|---|
$dsn | string | Connection string for PDO | |
$fileName | string | Destination filename, defaults to stdout | |
$pass | string | Database password | |
$user | string | Database username |
Method | Description | |
---|---|---|
__construct ( string $dsn = '', string $user = '', string $pass = '', array $dumpSettings = [], array $pdoSettings = [] ) | Constructor of Mysqldump. Note that in the case of an SQLite database connection, the filename must be in the $db parameter. | |
__destruct ( ) | Destructor of Mysqldump. Unsets dbHandlers and database objects. | |
array_replace_recursive ( array $array1, array $array2 ) : array | Custom array_replace_recursive to be used if PHP < 5.3 Replaces elements from passed arrays into the first array recursively | |
createStandInTable ( string $viewName ) : string | Write a create table statement for the table Stand-In, show create table would return a create algorithm when used on a view | |
endListValues ( string $tableName ) : null | Table rows extractor, close locks and commits after dump | |
getColumnStmt ( string $tableName ) : string | Build SQL List of all columns on current table | |
prepareListValues ( string $tableName ) : null | Table rows extractor, append information prior to dump | |
start ( string $filename = '' ) : null | Main call |
Method | Description | |
---|---|---|
connect ( ) : null | Connect with PDO | |
escape ( string $tableName, array $row ) : string | Escape values with quotes when needed | |
exportProcedures ( ) : null | Exports all the procedures found in database | |
exportTables ( ) : null | Exports all the tables selected from database | |
exportTriggers ( ) : null | Exports all the triggers found in database | |
exportViews ( ) : null | Exports all the views found in database | |
getDatabaseStructure ( ) : null | Reads table and views names from database. | |
getDumpFileFooter ( ) : string | Returns footer for dump file | |
getDumpFileHeader ( ) : string | Returns header for dump file | |
getProcedureStructure ( string $procedureName ) : null | Procedure structure extractor | |
getTableColumnTypes ( string $tableName ) : array | Store column types to create data dumps and for Stand-In tables | |
getTableStructure ( string $tableName ) : null | Table structure extractor | |
getTriggerStructure ( string $triggerName ) : null | Trigger structure extractor | |
getViewStructureTable ( string $viewName ) : null | View structure extractor, create table (avoids cyclic references) | |
getViewStructureView ( string $viewName ) : null | View structure extractor, create view | |
listValues ( string $tableName ) : null | Table rows extractor | |
matches ( $table, $arr ) : boolean | Compare if $table name matches with a definition inside $arr | |
parseDsn ( string $dsn ) | Parse DSN string and extract dbname value Several examples of a DSN string mysql:host=localhost;dbname=testdb mysql:host=localhost;port=3307;dbname=testdb mysql:unix_socket=/tmp/mysql.sock;dbname=testdb |
public __construct ( string $dsn = '', string $user = '', string $pass = '', array $dumpSettings = [], array $pdoSettings = [] ) | ||
$dsn | string | PDO DSN connection string |
$user | string | SQL account username |
$pass | string | SQL account password |
$dumpSettings | array | SQL database settings |
$pdoSettings | array | PDO configured attributes |
public __destruct ( ) |
public createStandInTable ( string $viewName ) : string | ||
$viewName | string | Name of view to export |
return | string | create statement |
public endListValues ( string $tableName ) : null | ||
$tableName | string | Name of table to export |
return | null |
public getColumnStmt ( string $tableName ) : string | ||
$tableName | string | Name of table to get columns |
return | string | SQL sentence with columns |
public prepareListValues ( string $tableName ) : null | ||
$tableName | string | Name of table to export |
return | null |
public string $fileName | ||
return | string |