DbBackup

Type
Class
Namespace
Craft
Inherits
Craft\DbBackup
Since
1.0

This class provides methods for backing up and restore Craft databases.

See also http://craftcms.com

View source (opens new window)

# Public Methods

Method Description
restore() Restores a database backup with the given backup file. Note that all tables and data in the database will be deleted before the backup file is executed.
run() Triggers the database backup including all DML and DDL and writes it out to a file.
setIgnoreDataTables() Controls which (if any) tables will have their data ignored in this database backup.
trimValue()

# restore()

Restores a database backup with the given backup file. Note that all tables and data in the database will be deleted before the backup file is executed.

View source (opens new window)

Arguments

  • $filePath – The file path of the database backup to restore.

Returns

null (opens new window)

Throws

Signature

public null restore ( $filePath )

# run()

Triggers the database backup including all DML and DDL and writes it out to a file.

View source (opens new window)

Returns

string (opens new window) – The path to the database backup file.

Signature

public string run ( )

# setIgnoreDataTables()

Controls which (if any) tables will have their data ignored in this database backup.

View source (opens new window)

Arguments

  • $tables (array (opens new window), false (opens new window)) – If set to an array, will merge the given tables with the default list of tables to ignore for data backup in $_ignoreDataTables. If set to false, no tables will be ignored and a full database backup will be performed.

Returns

null (opens new window)

Signature

public null setIgnoreDataTables ( $tables )

# trimValue()

Signature

public null trimValue ( &$value )