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

Public Methods

MethodDescription
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

Arguments

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

Returns

null

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

Returns

string – 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

Arguments

  • $tables (array, false) – 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

Signature

public null setIgnoreDataTables ( $tables )

trimValue()

View source

Arguments

  • $value

Returns

null

Signature

public null trimValue ( &$value )