\DatabasebackupLog
keeps a record for every database backup made...
Synopsis
class DatabasebackupLog
extends DataObject
{
- // members
- private static string $singular_name = "Database Backup";
- private static string $plural_name = "Database Backups";
- private static array $db = ;
- private static array $indexes = ;
- private static string $default_sort = "Created DESC";
- private static array $casting = ;
- private static array $summary_fields = ;
- private static String $full_location_for_db_backup_file = "";
- private static Int $max_db_copies = 3;
- private static String $compression = "";
- private static Boolean $allow_restores_in_live_environment = false;
- // methods
- public void canCreate()
- public void canDelete()
- public void canEdit()
- public void getCMSFields()
- public Int getSizeInMegabytes()
- public void getCMSActions()
- public void onBeforeWrite()
- public void onAfterWrite()
- public void onBeforeDelete()
- public Boolean restoreDatabaseBackup()
- protected void saveToSession()
- protected void retrieveFromSession()
- protected string cycleDatabaseBackupFiles()
- protected String getFullLocationWithExtension()
- protected String olderBackupFileName()
- public void requireDefaultRecords()
Hierarchy
Extends
- DataObject
Members
private
- $allow_restores_in_live_environment
—
Boolean
for security reasons we set this to false ... - $casting
- $compression
—
String
at the moment only the gzip compression is supported! - $db
- $default_sort
- $full_location_for_db_backup_file
—
String
location for backup file e.g. /var/backups/db.sql - $indexes
- $max_db_copies
—
Int
number of cycles before the database backups get deleted forgood... - $plural_name
- $singular_name
- $summary_fields
Methods
protected
- cycleDatabaseBackupFiles() — move all of the database copies up one, deleting the upper one.
- getFullLocationWithExtension() — returns best file location with compression extension...
- olderBackupFileName() — returns file name for older back up file (cycled one)
- retrieveFromSession() — retrieves and updates all the logs from session
- saveToSession() — we have this so that when we restore a database we dont loose the backup information...
public
- canCreate()
- canDelete()
- canEdit()
- getCMSActions() — Adds a button the Site Config page of the CMS to rebuild the Lucene search index.
- getCMSFields()
- getSizeInMegabytes()
- onAfterWrite() — delete me if file does not exist
- onBeforeDelete() — delete file if I get deleted
- onBeforeWrite() — if backup does not exist then make it ...
- requireDefaultRecords() — check for existing backups
- restoreDatabaseBackup()