PHP Class HM\BackUpWordPress\Database_Backup_Engine

All Database Backup Engine implementations should extend this class
Inheritance: extends Backup_Engine
Datei anzeigen Open project: humanmade/backupwordpress Class Usage Examples

Public Properties

Property Type Description
$backup_filename string The filename for the resulting Backup

Public Methods

Method Description
__construct ( ) Setup some general database backup settings
backup ( ) : boolean Individual Database Backup Engine implementations must include a backup method at a minimum.
get_charset ( ) : string Get the database charset setting.
get_collate ( ) : string Get the database collate setting.
get_host ( ) : string Get the database hostname.
get_name ( ) : string Get the database name.
get_password ( ) : string Get the database password.
get_port ( ) : integer Get the database port.
get_socket ( ) : string Get the database socket.
get_user ( ) : string Get the database user.
parse_db_host_constant ( string $constant = 'DB_HOST' ) Parse the DB_HOST constant.
verify_backup ( ) : boolean Verify that the database backup was successful.

Method Details

__construct() public method

Child classes must call parent::__construct in their own constructor.
public __construct ( )

backup() abstract public method

Individual Database Backup Engine implementations must include a backup method at a minimum.
abstract public backup ( ) : boolean
return boolean Whether the backup completed successfully or not.

get_charset() public method

Get the database charset setting.
public get_charset ( ) : string
return string The database charset.

get_collate() public method

Get the database collate setting.
public get_collate ( ) : string
return string The database collage setting.

get_host() public method

Get the database hostname.
public get_host ( ) : string
return string The database hostname.

get_name() public method

Get the database name.
public get_name ( ) : string
return string The database name.

get_password() public method

Get the database password.
public get_password ( ) : string
return string The database password.

get_port() public method

Get the database port.
public get_port ( ) : integer
return integer The database port.

get_socket() public method

Get the database socket.
public get_socket ( ) : string
return string The database socket.

get_user() public method

Get the database user.
public get_user ( ) : string
return string The database user.

parse_db_host_constant() public method

The DB_HOST constant potentially contains the hostname, port or socket. We need to parse it to figure out the type of mysql connection to make.
public parse_db_host_constant ( string $constant = 'DB_HOST' )
$constant string The Constant to parse. If the string isn't a defined Constant then it will be parsed directly.

verify_backup() public method

It's important this function is performant as it's called after every backup.
public verify_backup ( ) : boolean
return boolean Whether the backup completed successfully

Property Details

$backup_filename public_oe property

The filename for the resulting Backup
public string $backup_filename
return string