class Export (View source)

PhpMyAdmin\Export\Export class

Properties

string $dumpBuffer
int $dumpBufferLength
array $dumpBufferObjects

Methods

__construct(DatabaseInterface $dbi)

No description

void
shutdown()

Sets a session variable upon a possible fatal error during export

bool
isGzHandlerEnabled()

Detect ob_gzhandler

bool
gzencodeNeeded()

Detect whether gzencode is needed; it might not be needed if the server is already compressing by itself

bool
outputHandler(string $line)

Output handler for all exports, if needed buffering, it stores data into $this->dumpBuffer, otherwise it prints them out.

string
getHtmlForDisplayedExportFooter(ExportType $exportType, string $db, string $table)

Returns HTML containing the footer for a displayed export

int
getMemoryLimit()

Computes the memory limit for export

string
getFinalFilename(ExportPlugin $exportPlugin, string $compression, string $filename)

No description

string
getMimeType(ExportPlugin $exportPlugin, string $compression)

No description

void
rememberFilename(Config $config, ExportType $exportType, string $filenameTemplate)

No description

array
openFile(string $filename, bool $quickExport)

Open the export file

closeFile(resource $fileHandle, string $dumpBuffer, string $saveFilename)

Close the export file

array|string|bool
compress(array|string $dumpBuffer, string $compression, string $filename)

Compress the export buffer

void
saveObjectInBuffer(string $objectName, bool $append = false)

Saves the dump buffer for a particular table in an array Used in separate files export

string
getHtmlForDisplayedExportHeader(ExportType $exportType, string $db, string $table)

Returns HTML containing the header for a displayed export

void
exportServer(string|array $dbSelect, ExportPlugin $exportPlugin, array $aliases, string $separateFiles)

Export at the server level

void
exportDatabase(DatabaseName $db, array $tables, array $tableStructure, array $tableData, ExportPlugin $exportPlugin, array $aliases, string $separateFiles)

Export at the database level

static void
exportRaw(ExportPlugin $exportPlugin, string|null $db, string $sqlQuery)

Export a raw query

void
exportTable(string $db, string $table, ExportPlugin $exportPlugin, string|null $allrows, string $limitTo, string $limitFrom, string $sqlQuery, array $aliases)

Export at the table level

string
getPageLocationAndSaveMessage(ExportType $exportType, Message $message)

Loads correct page after doing export

array
mergeAliases(array $aliases1, array $aliases2)

Merge two alias arrays, if array1 and array2 have conflicting alias then array2 value is used if it is non empty otherwise array1 value.

void
lockTables(DatabaseName $db, array $tables, string $lockType = 'WRITE')

Locks tables

void
unlockTables()

Releases table locks

array
getMetadataTypes()

Returns all the metadata types that can be exported with a database or a table

string
getCheckedClause(string $key, array $array)

Returns the checked clause, depending on the presence of key in array

array
getExportSchemaInfo(DatabaseName $db, string $format)

get all the export options and verify call and include the appropriate Schema Class depending on $export_type

array
getTableNames(string $database)

No description

Details

__construct(DatabaseInterface $dbi)

No description

Parameters

DatabaseInterface $dbi

void shutdown()

Sets a session variable upon a possible fatal error during export

Return Value

void

bool isGzHandlerEnabled()

Detect ob_gzhandler

Return Value

bool

bool gzencodeNeeded()

Detect whether gzencode is needed; it might not be needed if the server is already compressing by itself

Return Value

bool

bool outputHandler(string $line)

Output handler for all exports, if needed buffering, it stores data into $this->dumpBuffer, otherwise it prints them out.

Parameters

string $line

the insert statement

Return Value

bool

string getHtmlForDisplayedExportFooter(ExportType $exportType, string $db, string $table)

Returns HTML containing the footer for a displayed export

Parameters

ExportType $exportType

the export type

string $db

the database name

string $table

the table name

Return Value

string

the HTML output

int getMemoryLimit()

Computes the memory limit for export

Return Value

int

the memory limit

string getFinalFilename(ExportPlugin $exportPlugin, string $compression, string $filename)

No description

Parameters

ExportPlugin $exportPlugin
string $compression
string $filename

Return Value

string

string getMimeType(ExportPlugin $exportPlugin, string $compression)

No description

Parameters

ExportPlugin $exportPlugin
string $compression

Return Value

string

void rememberFilename(Config $config, ExportType $exportType, string $filenameTemplate)

No description

Parameters

Config $config
ExportType $exportType
string $filenameTemplate

Return Value

void

array openFile(string $filename, bool $quickExport)

Open the export file

Parameters

string $filename

the export filename

bool $quickExport

whether it's a quick export or not

Return Value

array

Message closeFile(resource $fileHandle, string $dumpBuffer, string $saveFilename)

Close the export file

Parameters

resource $fileHandle

the export file handle

string $dumpBuffer

the current dump buffer

string $saveFilename

the export filename

Return Value

Message

a message object (or empty string)

array|string|bool compress(array|string $dumpBuffer, string $compression, string $filename)

Compress the export buffer

Parameters

array|string $dumpBuffer

the current dump buffer

string $compression

the compression mode

string $filename

the filename

Return Value

array|string|bool

void saveObjectInBuffer(string $objectName, bool $append = false)

Saves the dump buffer for a particular table in an array Used in separate files export

Parameters

string $objectName

the name of current object to be stored

bool $append

optional boolean to append to an existing index or not

Return Value

void

string getHtmlForDisplayedExportHeader(ExportType $exportType, string $db, string $table)

Returns HTML containing the header for a displayed export

Parameters

ExportType $exportType

the export type

string $db

the database name

string $table

the table name

Return Value

string

the generated HTML and back button

void exportServer(string|array $dbSelect, ExportPlugin $exportPlugin, array $aliases, string $separateFiles)

Export at the server level

Parameters

string|array $dbSelect

the selected databases to export

ExportPlugin $exportPlugin

the selected export plugin

array $aliases

alias information for db/table/column

string $separateFiles

whether it is a separate-files export

Return Value

void

void exportDatabase(DatabaseName $db, array $tables, array $tableStructure, array $tableData, ExportPlugin $exportPlugin, array $aliases, string $separateFiles)

Export at the database level

Parameters

DatabaseName $db

the database to export

array $tables

the tables to export

array $tableStructure

whether to export structure for each table

array $tableData

whether to export data for each table

ExportPlugin $exportPlugin

the selected export plugin

array $aliases

Alias information for db/table/column

string $separateFiles

whether it is a separate-files export

Return Value

void

static void exportRaw(ExportPlugin $exportPlugin, string|null $db, string $sqlQuery)

Export a raw query

Parameters

ExportPlugin $exportPlugin

the selected export plugin

string|null $db

the database where the query is executed

string $sqlQuery

the query to be executed

Return Value

void

void exportTable(string $db, string $table, ExportPlugin $exportPlugin, string|null $allrows, string $limitTo, string $limitFrom, string $sqlQuery, array $aliases)

Export at the table level

Parameters

string $db

the database to export

string $table

the table to export

ExportPlugin $exportPlugin

the selected export plugin

string|null $allrows

whether "dump all rows" was ticked

string $limitTo

upper limit

string $limitFrom

starting limit

string $sqlQuery

query for which exporting is requested

array $aliases

Alias information for db/table/column

Return Value

void

string getPageLocationAndSaveMessage(ExportType $exportType, Message $message)

Loads correct page after doing export

Parameters

ExportType $exportType
Message $message

Return Value

string

array mergeAliases(array $aliases1, array $aliases2)

Merge two alias arrays, if array1 and array2 have conflicting alias then array2 value is used if it is non empty otherwise array1 value.

Parameters

array $aliases1

first array of aliases

array $aliases2

second array of aliases

Return Value

array

resultant merged aliases info

void lockTables(DatabaseName $db, array $tables, string $lockType = 'WRITE')

Locks tables

Parameters

DatabaseName $db

database name

array $tables

list of table names

string $lockType

lock type; "[LOW_PRIORITY] WRITE" or "READ [LOCAL]"

Return Value

void

void unlockTables()

Releases table locks

Return Value

void

array getMetadataTypes()

Returns all the metadata types that can be exported with a database or a table

Return Value

array

metadata types.

string getCheckedClause(string $key, array $array)

Returns the checked clause, depending on the presence of key in array

Parameters

string $key

the key to look for

array $array

array to verify

Return Value

string

the checked clause

array getExportSchemaInfo(DatabaseName $db, string $format)

get all the export options and verify call and include the appropriate Schema Class depending on $export_type

Parameters

DatabaseName $db
string $format

Return Value

array

Exceptions

ExportException

array getTableNames(string $database)

No description

Parameters

string $database

Return Value

array