PHP Class Services\Synchronize

Afficher le fichier Open project: doptor/doptor Class Usage Examples

Protected Properties

Свойство Type Description
$includes array What is backed up(can be database, modules, public directory)
$listener

Méthodes publiques

Méthode Description
Unzip ( [type] $file, [type] $path ) Decompress a folder
Zip ( [type] $source, [type] $destination, $include_dir = true ) Compresses a folder
__construct ( $listener )
authorizeRemote ( Input $input ) : Guzzle\Service\Client Authorize the user on the remote server
backupDB ( string $current_time ) Create backup of the current database
backupModules ( string $current_time ) Backup all the modules installed
backupPublic ( string $current_time ) Backup the public folder
backupTables ( string $host, string $user, string $password, string $database, string $file_name, string $tables = '*' ) Generate a sql file of the current database
copyToRestore ( Input $input ) : string Copy the backup file received from the post data to the restore folder
dropTables ( ) Drop all the tables in the database
restore ( string $restore_file ) Restore the database and modules from the restore file
restoreDB ( string $restore_dir ) Restore the database from the restore folder
restoreModules ( string $restore_dir ) Restore all the modules
restorePublic ( string $restore_dir ) Restore public folder
saveBackupToDB ( $description = '' ) : Object Save the information of the created backup to database
startBackup ( $backup_db = true, $backup_modules = true, $backup_public = true )
startLocalToRemoteSync ( $input )
startRemoteToLocalSync ( $input )
syncFromRemote ( $current_time, $restore_file, $input )
syncToRemote ( string $current_time, [type] $backup_file, $input ) Send the backup file to remote server for synchronization

Méthodes protégées

Méthode Description
dbConnections ( )

Method Details

Unzip() public méthode

Decompress a folder
public Unzip ( [type] $file, [type] $path )
$file [type]
$path [type]

Zip() public méthode

Compresses a folder
public Zip ( [type] $source, [type] $destination, $include_dir = true )
$source [type]
$destination [type]

__construct() public méthode

public __construct ( $listener )

authorizeRemote() public méthode

Authorize the user on the remote server
public authorizeRemote ( Input $input ) : Guzzle\Service\Client
$input Input
Résultat Guzzle\Service\Client

backupDB() public méthode

Create backup of the current database
public backupDB ( string $current_time )
$current_time string "Current time in string"

backupModules() public méthode

Backup all the modules installed
public backupModules ( string $current_time )
$current_time string "Current time in string"

backupPublic() public méthode

Backup the public folder
public backupPublic ( string $current_time )
$current_time string "Current time in string"

backupTables() public méthode

Generate a sql file of the current database
public backupTables ( string $host, string $user, string $password, string $database, string $file_name, string $tables = '*' )
$host string
$user string
$password string
$database string
$file_name string
$tables string

copyToRestore() public méthode

Copy the backup file received from the post data to the restore folder
public copyToRestore ( Input $input ) : string
$input Input "The post input data"
Résultat string "Filename"

dbConnections() protected méthode

protected dbConnections ( )

dropTables() public méthode

Drop all the tables in the database
public dropTables ( )

restore() public méthode

Restore the database and modules from the restore file
public restore ( string $restore_file )
$restore_file string "The location of teh restore zip file"

restoreDB() public méthode

Restore the database from the restore folder
public restoreDB ( string $restore_dir )
$restore_dir string

restoreModules() public méthode

Restore all the modules
public restoreModules ( string $restore_dir )
$restore_dir string

restorePublic() public méthode

Restore public folder
public restorePublic ( string $restore_dir )
$restore_dir string

saveBackupToDB() public méthode

Save the information of the created backup to database
public saveBackupToDB ( $description = '' ) : Object
Résultat Object

startBackup() public méthode

public startBackup ( $backup_db = true, $backup_modules = true, $backup_public = true )

startLocalToRemoteSync() public méthode

public startLocalToRemoteSync ( $input )

startRemoteToLocalSync() public méthode

public startRemoteToLocalSync ( $input )

syncFromRemote() public méthode

public syncFromRemote ( $current_time, $restore_file, $input )

syncToRemote() public méthode

Send the backup file to remote server for synchronization
public syncToRemote ( string $current_time, [type] $backup_file, $input )
$current_time string "Current time in string"
$backup_file [type]

Property Details

$includes protected_oe property

What is backed up(can be database, modules, public directory)
protected array $includes
Résultat array

$listener protected_oe property

protected $listener