PHP Класс Services\Synchronize

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$includes array What is backed up(can be database, modules, public directory)
$listener

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
dbConnections ( )

Описание методов

Unzip() публичный Метод

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

Zip() публичный Метод

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

__construct() публичный Метод

public __construct ( $listener )

authorizeRemote() публичный Метод

Authorize the user on the remote server
public authorizeRemote ( Input $input ) : Guzzle\Service\Client
$input Input
Результат Guzzle\Service\Client

backupDB() публичный Метод

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

backupModules() публичный Метод

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

backupPublic() публичный Метод

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

backupTables() публичный Метод

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() публичный Метод

Copy the backup file received from the post data to the restore folder
public copyToRestore ( Input $input ) : string
$input Input "The post input data"
Результат string "Filename"

dbConnections() защищенный Метод

protected dbConnections ( )

dropTables() публичный Метод

Drop all the tables in the database
public dropTables ( )

restore() публичный Метод

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() публичный Метод

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

restoreModules() публичный Метод

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

restorePublic() публичный Метод

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

saveBackupToDB() публичный Метод

Save the information of the created backup to database
public saveBackupToDB ( $description = '' ) : Object
Результат Object

startBackup() публичный Метод

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

startLocalToRemoteSync() публичный Метод

public startLocalToRemoteSync ( $input )

startRemoteToLocalSync() публичный Метод

public startRemoteToLocalSync ( $input )

syncFromRemote() публичный Метод

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

syncToRemote() публичный Метод

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]

Описание свойств

$includes защищенное свойство

What is backed up(can be database, modules, public directory)
protected array $includes
Результат array

$listener защищенное свойство

protected $listener