FUEL CMS User Guide : Version 1.5.2


Fuel Backup Class

This class extends the Fuel_advanced_module class.

Properties Reference

Property Default Value Description
public
file_prefix AUTO Used for the name of the backup file. A value of AUTO will automatically create the name
file_date_format Y-m-d Date format to append to file name
zip 1 ZIP up the file or not
include_assets none Determines whether to backup assets by default
download 1 Download the file or not from the browser
must_write_zip_file none Specifies whether the zip should be saved to the file system
days_to_keep 30 Number of days to hold backups. A value of 0 or FALSE will be forever
allow_overwrite none Allow the backup to overwrite existing
backup none Determines whether to backup assets by default
cron_email none The email address to send the backup cron notification
cron_email_file 1 Determines whether to send files in an email with cron backup
backup_path /var/www/vhosts/getfuelcms.com/subdomains/docs/httpdocs/fuel/data_backup/ Backup path for data. Deafult is at the same level as the system and application folder
db_backup_prefs
array('ignore' => array
(
)
, 'add_drop' => 1, 'add_insert' => 1, )
allow_ftp none Determines whether to allow FTP transfer to remote server
ftp_prefs
array('hostname' => '', 'username' => '', 'password' => '', 'port' => 21, 'passive' => 1, 'remote_dir' => '', 'delete_local' => 1, )
protected
_backup_data N/A An array of backed up data information

Function Reference [+]

$this->fuel->backup->initialize([$params=array()])

Initialize the backup object. Accepts an associative array as input, containing backup preferences. Also will set the values in the config as properties of this object.

Returns

void

Parameters

(array) $params config preferences

$this->fuel->backup->do_backup([$params=array()])

Backs up the database / and assets (if configured) information to the specified backup path. Accepts an associative array as input, containing backup preferences.

Returns

boolean

Parameters

(array) $params config preferences

$this->fuel->backup->database([$params=array()])

Backs up the database information to the specified backup path. Accepts an associative array as input, containing backup preferences.

Returns

boolean

Parameters

(array) $params config preferences

$this->fuel->backup->assets([$params=array()])

Backs up the assets folder to the specified backup path. Accepts an associative array as input, containing backup preferences.

Returns

boolean

Parameters

(array) $params config preferences

$this->fuel->backup->zip('$file_name', ['$data'=NULL])

Zips up data. Accepts an associative array as input, containing backup preferences.

Returns

boolean

Parameters

(string) $file_name file name
(string) $data information to zip up

$this->fuel->backup->write('$file_name', '$data')

Writes a file to the backup folder.

Returns

boolean

Parameters

(string) $file_name file name
(string) $data information to write to the file

$this->fuel->backup->backup_data()

Returns the backed up data information. Similar to File Upload class, provides post-mortem info.

Returns

array

$this->fuel->backup->remove('$backup_file')

Removes a backup file from the backup directory.

Returns

boolean

Parameters

(string) $backup_file file name

$this->fuel->backup->ftp('$locpath', ['$rempath'=NULL], [$ftp_prefs=array()])

FTP's the backup file to a remote destination.

Returns

boolean

Parameters

(string) $locpath local filepath
(string) $rempath remote filepath (optional)
(array) $ftp_prefs an array of alternative FTP preferences that will overwrite the config values (optional)

$this->fuel->backup->has_ftp_credentials()

Checks whether there is enough config info to FTP.

Returns

boolean