PHP 클래스 Ifsnop\Mysqldump\Mysqldump

저자: Michael J. Calkins ([email protected])
저자: Diego Torres ([email protected])
파일 보기 프로젝트 열기: clouddueling/mysqldump-php 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$dsn string Connection string for PDO
$fileName string Destination filename, defaults to stdout
$pass string Database password
$user string Database username

공개 메소드들

메소드 설명
__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

비공개 메소드들

메소드 설명
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

메소드 상세

__construct() 공개 메소드

Constructor of Mysqldump. Note that in the case of an SQLite database connection, the filename must be in the $db parameter.
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

__destruct() 공개 메소드

Destructor of Mysqldump. Unsets dbHandlers and database objects.
public __destruct ( )

array_replace_recursive() 공개 정적인 메소드

Custom array_replace_recursive to be used if PHP < 5.3 Replaces elements from passed arrays into the first array recursively
public static array_replace_recursive ( array $array1, array $array2 ) : array
$array1 array The array in which elements are replaced
$array2 array The array from which elements will be extracted
리턴 array Returns an array, or NULL if an error occurs.

createStandInTable() 공개 메소드

Write a create table statement for the table Stand-In, show create table would return a create algorithm when used on a view
public createStandInTable ( string $viewName ) : string
$viewName string Name of view to export
리턴 string create statement

endListValues() 공개 메소드

Table rows extractor, close locks and commits after dump
public endListValues ( string $tableName ) : null
$tableName string Name of table to export
리턴 null

getColumnStmt() 공개 메소드

Build SQL List of all columns on current table
public getColumnStmt ( string $tableName ) : string
$tableName string Name of table to get columns
리턴 string SQL sentence with columns

prepareListValues() 공개 메소드

Table rows extractor, append information prior to dump
public prepareListValues ( string $tableName ) : null
$tableName string Name of table to export
리턴 null

start() 공개 메소드

Main call
public start ( string $filename = '' ) : null
$filename string Name of file to write sql dump to
리턴 null

프로퍼티 상세

$dsn 공개적으로 프로퍼티

Connection string for PDO
public string $dsn
리턴 string

$fileName 공개적으로 프로퍼티

Destination filename, defaults to stdout
public string $fileName
리턴 string

$pass 공개적으로 프로퍼티

Database password
public string $pass
리턴 string

$user 공개적으로 프로퍼티

Database username
public string $user
리턴 string