phpDocumentor GalleryCore
Storage
[ class tree: GalleryCore ] [ index: GalleryCore ] [ all elements ]

Class: GalleryDatabaseExport

Source Location: /modules/core/classes/GalleryStorage/GalleryDatabaseExport.class

Class GalleryDatabaseExport

Class Overview

GalleryDatabaseExport provides the functionality to export the gallery database.

Creating an GalleryDatabaseExport object is the first step in exporting the information store in the Gallery databases. The export function exports all the versions.dat file, the config.php file, the tables for the modules and all the data contianed in a Gallery installation. The actual albums and items are not exported as part of this process.

For a complete backup, perform this export and then use the operating system faclities to back up both the g2data/album and g2data/backups directory.

Located in /modules/core/classes/GalleryStorage/GalleryDatabaseExport.class [line 54]



		
		
		
		

Properties

Methods

[ Top ]
Property Summary
mixed   $_callBack   This variable contains the call back information and contains the follwoing keys
mixed   $_fieldPrefixLength  
mixed   $_ignoreTables   This array contains a list of tables that are transitory in nature and do not need to have the data in them backed up. The schema table is not rally transitory, but will be recreated as part of the import.
mixed   $_rowChunkSize   Defines the number of rows to be read before letting the user know that we are still working.

[ Top ]
Method Summary
array   exportToXmlFile()   Extracts an XML schema from an existing database.
void   updateStatus()   This method calls the the status update method that was passed by the caller to the Database Exporter class.
string   _encodeHtmlSpecialChars()   Simulate calling htmlspecialchars($value, ENT_COMPAT, 'UTF-8'). We avoid using
GalleryStatus   _exportData()   Export the table data to the output stream
GalleryStatus   _exportModule()   Export a module to the export file.
GalleryStatus   _exportPluginStatus()   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.
GalleryStatus   _exportSequence()   Export the a sequence. Sequences are not defined by the schema.tpl file but are created by calling adoDB directly.
GalleryStatus   _exportTable()   Export a gallery table to the output stream
array   _openBackupFileForWriting()   Creates the file name and opens the file to write the content of the backup.

[ Top ]
Properties
mixed   $_callBack [line 73]

This variable contains the call back information and contains the follwoing keys

'progress' current progress 'total' total work involved 'callback' progress bar notification callback


[ Top ]
mixed   $_fieldPrefixLength [line 78]

[ Top ]
mixed   $_ignoreTables = array('cachemap' => 1, 'lock' => 1, 'sessionmap' => 1, 'schema' => 1) [line 65]

This array contains a list of tables that are transitory in nature and do not need to have the data in them backed up. The schema table is not rally transitory, but will be recreated as part of the import.


[ Top ]
mixed   $_rowChunkSize = 200 [line 58]

Defines the number of rows to be read before letting the user know that we are still working.


[ Top ]
Methods
exportToXmlFile  [line 96]

  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.

[ Top ]
updateStatus  [line 651]

  void updateStatus( )

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.

[ Top ]
_encodeHtmlSpecialChars  [line 293]

  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.

[ Top ]
_exportData  [line 506]

  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:
Return:  A status code.


[ Top ]
_exportModule  [line 305]

  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:
Return:  A status code.


[ Top ]
_exportPluginStatus  [line 240]

  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:
Return:  object


[ Top ]
_exportSequence  [line 377]

  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:
Return:  A status code.


[ Top ]
_exportTable  [line 407]

  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:
Return:  A status code.


[ Top ]
_openBackupFileForWriting  [line 670]

  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


[ Top ]

Documentation generated on Fri, 08 Oct 2010 04:56:43 -0700 by phpDocumentor 1.3.0RC6