array exportToXmlFile(
array
$progressCallback, [string
$fileName = null]
)
|
|
Extracts an XML schema from an existing database.
Call this method to create an XML schema string from an existing database.
Parameters:
array |
$progressCallback: |
Callback for progress reports. This callback function should update the progress bar that is being used. Currently, the upgrader uses a different mechanism to update the progress bar than the maintenance screens. |
string |
$fileName: |
(optional) Name of the file to write the database extract xml to, if not supplied will default to g2data/backups/backup_date.xml. |
API Tags:
Return: | GalleryStatus a status code string Path name of the backup file array of warning messages to be displayed to the administrator. |
See: | DatabaseBackupTask::progressCallBack and DatabaseBackupStep::backupCallback. |
Information Tags:
Todo: | When the progress bar handling is standardized for both upgrades and maintenance screens, then replace the call back function with a StatusMonitor object. |
This method calls the the status update method that was passed by the caller to the Database Exporter class.
Information Tags:
Todo: | When the various progress bar methods are standardized, change this call to call the update progress bar of a common status notifier. |
string _encodeHtmlSpecialChars(
string
$valueToConvert
)
|
|
Simulate calling htmlspecialchars($value, ENT_COMPAT, 'UTF-8'). We avoid using
htmlspecialchars directly because on some versions of PHP (notable PHP 4.1.2) it changes the character set of the input data (in one environment it converted the UTF-8 data to ISO-8859-1)
Parameters:
string |
$valueToConvert: |
String to escape the html special characters. |
API Tags:
Return: | The escaped string. |
Information Tags:
Todo: | Move this routine to GalleryUtilities as a common function. |
GalleryStatus _exportData(
resource
$handle, string
$table,
&$warnings, array
$warnings
)
|
|
Export the table data to the output stream
Parameters:
resource |
$handle: |
Handle to output export file |
string |
$table: |
The table to export. |
array |
$warnings: |
An array of warning messages to be updated. |
|
&$warnings: |
|
API Tags:
GalleryStatus _exportModule(
resource
$handle, string
$pluginId,
&$warnings, array
$warnings
)
|
|
Export a module to the export file.
Parameters:
resource |
$handle: |
Handle to output export file |
string |
$pluginId: |
A plugin id |
array |
$warnings: |
An array of warning messages to be updated. |
|
&$warnings: |
|
API Tags:
GalleryStatus _exportPluginStatus(
resource
$handle, string
$pluginType, array
$plugins,
&$warnings, array
$warnings
)
|
|
Export the list of installed plugins. For each plugin include whether it is active or not, the module version number, the required core version and the required gallery version.
Parameters:
resource |
$handle: |
Handle to output export file. |
string |
$pluginType: |
What type of plugin is it (module or theme) |
array |
$plugins: |
A Gallery Plugin status array |
array |
$warnings: |
An array of warning messages to be updated. |
|
&$warnings: |
|
API Tags:
GalleryStatus _exportSequence(
resource
$handle, string
$sequenceId
)
|
|
Export the a sequence. Sequences are not defined by the schema.tpl file but are created by calling adoDB directly.
Parameters:
resource |
$handle: |
Handle to output export file |
string |
$sequenceId: |
The sequence Id to export. |
API Tags:
GalleryStatus _exportTable(
resource
$handle, string
$table,
&$warnings, array
$warnings
)
|
|
Export a gallery table to the output stream
Parameters:
resource |
$handle: |
Handle to output export file |
string |
$table: |
The table to export. |
array |
$warnings: |
An array of warning messages to be updated. |
|
&$warnings: |
|
API Tags:
array _openBackupFileForWriting(
[string
$fileName = null]
)
|
|
Creates the file name and opens the file to write the content of the backup.
Parameters:
string |
$fileName: |
(optional) Name of the file to write the database extract xml to, if not supplied will default to g2data/backups/g2backup_date.txt |
API Tags:
Return: | GalleryStatus a status code fileHandle file handle to the open file string path name of the backup file |