Properties

$excludeZip

$excludeZip : boolean

Whether to exclude zip archives.

Type

boolean — true|false

$zip

$zip : resource

Container for zip file.

Type

resource — ZIP file

$zipArchiveFileCount

$zipArchiveFileCount : integer

Backup files count.

Type

integer — Files count.

$zipArchiveSizeCount

$zipArchiveSizeCount : float

Backup archive file size.

Type

float — File size.

$zipArchiveFileName

$zipArchiveFileName : string

Backup archive file name.

Type

string — File name.

$file_descriptors

$file_descriptors : integer

Backup file descriptors.

Type

integer — File descriptors.

$loadFilesBeforeZip

$loadFilesBeforeZip : boolean

Whether to load file before zip.

Type

boolean — true|false

$timeout

$timeout : integer

Hold the current timeout length.

Type

integer — Timeout length.

$lastRun

$lastRun : string

Last time a backup has been run.

Type

string — Last backup run.

$gcCnt

$gcCnt : integer

Garbage collection count.

Type

integer — Garbage collection count.

$testContent

$testContent : boolean

Archive test content.

Type

boolean — Test backup content.

$archiver

$archiver : object

Backup process archiver.

Type

object — Backup process archiver.

$instance

$instance : mixed

Protected static variable to hold the single instance of the class.

Type

mixed — Default null

Methods

get()

get() : mixed

Create a public static instance.

Returns

mixed —

Class instance.

create_full_backup()

create_full_backup(array  $excludes, string  $filePrefix = '', boolean  $addConfig = false, boolean  $includeCoreFiles = false, integer  $file_descriptors, boolean  $fileSuffix = false, boolean  $excludezip = false, boolean  $excludenonwp = false, boolean  $loadFilesBeforeZip = true, string  $ext = 'zip', boolean  $pid = false, boolean  $append = false) : array|boolean

Create full backup.

Parameters

array $excludes

Files to exclude from the backup.

string $filePrefix

Backup archive file prefix.

boolean $addConfig

Add config file to backup.

boolean $includeCoreFiles

Include WordPress core files.

integer $file_descriptors

Number of backup archive file descriptors.

boolean $fileSuffix

Backup archive file suffix.

boolean $excludezip

Exclude zip files from the backup.

boolean $excludenonwp

Exclude non-WordPress directories in site root.

boolean $loadFilesBeforeZip

Load files before zip.

string $ext

Backup file extension.

boolean $pid

PID true|false.

boolean $append

Append to backup file name.

Returns

array|boolean —

Action results on success, false on failure.

backup_poll()

backup_poll() 

Check whether the file is an archive or not & create a json_encoded, serialized, base64_encoded string.

backup_full()

backup_full(string  $fileName) : array|boolean

Perform a full backup.

Parameters

string $fileName

Backup archive file name.

Returns

array|boolean —

Returns an array containing the Backup location & file size. Return FALSE on failure.

backup_db()

backup_db(string  $fileName = '', string  $ext = 'zip') : array|boolean

Backup site database.

Parameters

string $fileName

Backup arhive file name.

string $ext

Backup achive extension.

Returns

array|boolean —

$success Returns an array containing the Backup location & file size. Return FALSE on failure.

zip_file()

zip_file(array  $files, string  $archive) : boolean

Create the ZIP file.

Parameters

array $files

Files to zip.

string $archive

Type of archive to create.

Returns

boolean —

Return FALSE on failure, TRUE on success.

m_zip_file()

m_zip_file(array  $files, string  $archive) : boolean

Create m_zip_file.

Parameters

array $files

Files to zip.

string $archive

Type of archive to create.

Returns

boolean —

Return false on failure.

m_zip_file_console()

m_zip_file_console() : boolean

Method m_zip_file_console().

Returns

boolean —

Return false.

m_zip_file_pcl()

m_zip_file_pcl(array  $files, string  $archive) : array

Use pclzip to add files to the zip archive.

Parameters

array $files

Files to zip.

string $archive

Type of archive to create.

Returns

array —

$rslt Return array of results.

check_zip_support()

check_zip_support() : boolean

Check for default PHP zip support.

Returns

boolean —

Returns true if class_name is a defined class, false otherwise.

check_zip_console()

check_zip_console() : boolean

Check if we could run zip on console

Returns

boolean —

Return false.

create_zip_full_backup()

create_zip_full_backup(string  $filepath, array  $excludes, boolean  $addConfig, boolean  $includeCoreFiles, boolean  $excludezip, boolean  $excludenonwp) : boolean

Create full backup using default PHP zip library.

Parameters

string $filepath

File path to create.

array $excludes

Files to exclude from the backup.

boolean $addConfig

Add config file to backup.

boolean $includeCoreFiles

Include WordPress core files.

boolean $excludezip

Exclude zip files from the backup.

boolean $excludenonwp

Exclude non-WordPress directories in site root.

Returns

boolean —

Return true on success & false on failure.

copy_dir()

copy_dir(array  $nodes, array  $excludes, string  $backupfolder, boolean  $excludenonwp) 

Copy directory.

Parameters

array $nodes

Default nodes.

array $excludes

Files & directories to exclude.

string $backupfolder

Backup folder.

boolean $excludenonwp

Whether or not to exclude any wp core files.

create_zip_pcl_full_backup2()

create_zip_pcl_full_backup2(string  $filepath, array  $excludes, boolean  $addConfig, boolean  $includeCoreFiles, boolean  $excludezip, boolean  $excludenonwp) : boolean

Create PCL zip full backup 2.

Parameters

string $filepath

Path to file.

array $excludes

Files & directories to exclude.

boolean $addConfig

Add config file to backup.

boolean $includeCoreFiles

Whether to include core files.

boolean $excludezip

Whether to exclude zip archives.

boolean $excludenonwp

Whether or not to exclude any wp core files.

Returns

boolean —

Return true on success.

zip_add_dir()

zip_add_dir(string  $path, array  $excludes) 

Recursively add directory to default PHP zip library.

Parameters

string $path

Path to directory.

array $excludes

Files or directories to exclude.

add_file_from_string_to_zip()

add_file_from_string_to_zip(resource  $file, string  $str) : boolean

Add file from a string to zip file.

Parameters

resource $file

File to add to zip.

string $str

String to add.

Returns

boolean —

true|false.

add_file_from_string_to_pcl_zip()

add_file_from_string_to_pcl_zip(resource  $file, string  $str, string  $filepath) : boolean

Add file from a string to pclzip file.

Parameters

resource $file

File to add to zip.

string $str

String to add.

string $filepath

Path to file.

Returns

boolean —

true|false.

add_file_to_zipp()

add_file_to_zipp(string  $path, string  $zipEntryName) : boolean

Add file to zip.

Parameters

string $path

Path to zip file.

string $zipEntryName

File to add to zip.

Returns

boolean —

True|false.

create_zip_console_full_backup()

create_zip_console_full_backup() : boolean

Create full backup via console.

Returns

boolean —

Return false.

create_backup_db()

create_backup_db(string  $filepath_prefix, boolean  $archiveExt = false, object  $archiver = null) : array|array<mixed,string>

Create DB backup.

Parameters

string $filepath_prefix

File path prefix.

boolean $archiveExt

Archive extension.

object $archiver

Archiver.

Returns

array|array<mixed,string> —

Action response.

include_core_files()

include_core_files(array  $nodes) 

Exclude certain core files from the backup.

Parameters

array $nodes

Default nodes.