Export
in package
Table of Contents
Properties
- $split_size : int
- $split_table : bool
- $dbms : ExportDBMS|null
- $file_idx : int
- $file_size : int
- $filename_prefix : string
- $generated_files : array<string|int, string>
- $hdr : string
- $tables : array<string|int, ExportTableSQL>
Methods
- addTable() : void
- Adds a table to the export.
- buildArchive() : void
- Loads all of the generated export files into a ZIP file
- exportSql() : void
- Exports the specified tables to an SQL file
- getGeneratedFiles() : array<string|int, mixed>
- Gets the generated files.
- setDbms() : void
- Sets the DBMS for the export.
- setFilenamePrefix() : void
- Sets the filename prefix for the export files.
- createNextFilename() : string
- Creates the filename which should be used for the next file if the current file is deemed to be too full
- getPkColNames() : array<string|int, mixed>
- Gets the column names for the primary key
- sizeCheckWrite() : resource
- Writes data to a file, if allowed by the file size restrictions.
Properties
$split_size
public
int
$split_size
= 0
$split_table
public
bool
$split_table
= false
$dbms
private
ExportDBMS|null
$dbms
= null
$file_idx
private
int
$file_idx
= 0
$file_size
private
int
$file_size
= 0
$filename_prefix
private
string
$filename_prefix
= ''
$generated_files
private
array<string|int, string>
$generated_files
= array()
$hdr
private
string
$hdr
= ''
$tables
private
array<string|int, ExportTableSQL>
$tables
= array()
Methods
addTable()
Adds a table to the export.
public
addTable(ExportTableSQL $table) : void
Parameters
- $table : ExportTableSQL
-
The table to add.
buildArchive()
Loads all of the generated export files into a ZIP file
public
buildArchive(string $name) : void
Parameters
- $name : string
-
The name of the archive to create.
exportSql()
Exports the specified tables to an SQL file
public
exportSql() : void
Tags
getGeneratedFiles()
Gets the generated files.
public
getGeneratedFiles() : array<string|int, mixed>
Return values
array<string|int, mixed> —The generated files.
setDbms()
Sets the DBMS for the export.
public
setDbms(ExportDBMS $dbms) : void
Parameters
- $dbms : ExportDBMS
-
The DBMS to use.
setFilenamePrefix()
Sets the filename prefix for the export files.
public
setFilenamePrefix(string $val) : void
Parameters
- $val : string
-
The filename prefix.
createNextFilename()
Creates the filename which should be used for the next file if the current file is deemed to be too full
private
createNextFilename(string|null $table_name, string $ext) : string
Parameters
- $table_name : string|null
-
The table name.
- $ext : string
-
The extension to use for the filename.
Return values
string —The filename.
getPkColNames()
Gets the column names for the primary key
private
getPkColNames(string $table) : array<string|int, mixed>
Parameters
- $table : string
-
The table name.
Tags
Return values
array<string|int, mixed> —The column names.
sizeCheckWrite()
Writes data to a file, if allowed by the file size restrictions.
private
sizeCheckWrite(resource $handle, string $str, string $next_filename) : resource
If not, creates a new file.
Parameters
- $handle : resource
-
The file handle to write to.
- $str : string
-
The data to write.
- $next_filename : string
-
The filename to use for the next file.
Tags
Return values
resource —The file handle.