| Methods |
| public __construct(string $dsn = '', ?string $user = NULL, ?string $pass = NULL, array $settings = [], array $pdoOptions = []) Constructor of Mysqldump.
|
| public addTypeAdapter(string $adapterClassName) : void Add TypeAdapter
|
| public getAdapter(PDO $conn) : Druidfi |
| public getTableLimit(string $tableName) : string|int|false Returns the LIMIT for the table. Must be numeric to be returned. |
| public getTableWhere(string $tableName) : string|false |
| public setInfoHook(callable $callable) : void Set a callable that will be used to report dump information. |
| public setTableLimits(array $tableLimits) : void Keyed by table name, with the value as the numeric limit: e.g. 'users' => 3000 |
| public setTableWheres(array $tableWheres) : void Keyed by table name, with the value as the conditions: e.g. 'users' => 'date_registered > NOW() - INTERVAL 6 MONTH AND deleted=0' |
| public setTransformColumnValueHook(callable $callable) Set a callable that will be used to transform column values. |
| public setTransformTableRowHook(callable $callable) : void Set a callable that will be used to transform table rows. |
| public start(?string $filename = '') : void Primary function, triggers dumping.
|
| Methods |
| protected getColumnStmt(string $tableName) : array Build SQL List of all columns on current table which will be used for selecting.
|
| protected tableColumnTypes() : array Get table column types. |
| Properties |
| private static string $adapterClass = 'Druidfi\Mysqldump\TypeAdapter\TypeAdapterMysql' |
| private ?PDO $conn = NULL |
| private Druidfi |
| private Druidfi |
| private $infoCallable = NULL |
| private Druidfi |
| private array $tableColumnTypes = [] |
| private array $tableLimits = [] |
| private array $tableWheres = [] Keyed on table name, with the value as the conditions. e.g. - 'users' => 'date_registered > NOW() - INTERVAL 6 MONTH' |
| private $transformColumnValueCallable = NULL |
| private $transformTableRowCallable = NULL |
| private Druidfi |
| Methods |
| private connect() : void Connect with PDO using the DatabaseConnector.
|
| private 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.
|
| private endListValues(string $tableName, int $count = 0) Table rows extractor, close locks and commits after dump.
|
| private getColumnNames(string $tableName) : array Build SQL List of all columns on current table which will be used for inserting.
|
| private getDatabaseStructureEvents() : void Reads event names from database. Fills $this->tables array so they will be dumped later. |
| private getDatabaseStructureFunctions() : void Reads functions names from database. Fills $this->tables array so they will be dumped later. |
| private getDatabaseStructureProcedures() : void Reads procedure names from database. Fills $this->tables array so they will be dumped later. |
| private getDatabaseStructureTables() : void Reads table names from database. Fills $this->tables array so they will be dumped later. |
| private getDatabaseStructureTriggers() : void Reads trigger names from database. Fills $this->tables array so they will be dumped later. |
| private getDatabaseStructureViews() : void Reads view names from database. Fills $this->tables array so they will be dumped later. |
| private getDumpFileFooter() : string Returns footer for dump file. |
| private getDumpFileHeader() : string Returns header for dump file. |
| private getEventStructure(string $eventName) Event structure extractor.
|
| private getFunctionStructure(string $functionName) Function structure extractor.
|
| private getInsertType() : string |
| private getProcedureStructure(string $procedureName) Procedure structure extractor.
|
| private getTableColumnTypes(string $tableName) : array Store column types to create data dumps and for Stand-In tables.
|
| private getTableStructure(string $tableName) Table structure extractor.
|
| private getTriggerStructure(string $triggerName) Trigger structure extractor.
|
| private getViewStructureTable(string $viewName) View structure extractor, create table (avoids cyclic references).
|
| private getViewStructureView(string $viewName) View structure extractor, create view. |
| private iterateEvents() : Generator |
| private iterateFunctions() : Generator |
| private iterateProcedures() : Generator |
| private iterateTables() : Generator Stream table names from the database without storing them in memory. Applies include-tables if provided, otherwise yields all tables. |
| private iterateTriggers() : Generator |
| private iterateViews() : Generator |
| private listValues(string $tableName) Table rows extractor.
|
| private matches(string $table, array $arr) : bool Compare if $table name matches with a definition inside $arr. |
| private prepareColumnValues(string $tableName, array $row) : array Prepare values for output.
|
| private prepareListValues(string $tableName) Table rows extractor, append information prior to dump.
|
| private write(string $data) : int |
| Properties |
| private static string $adapterClass = 'Druidfi\Mysqldump\TypeAdapter\TypeAdapterMysql' |