BackupCommand
extends Command
in package
CLI backup management: create and restore backups.
Usage: bin/cake backup create --key "my-secret-key" bin/cake backup restore kmp-backup-20260220-120000.kmpbackup --key "my-secret-key"
Table of Contents
Methods
- defaultName() : string
- Get the default command name.
- execute() : int|null
- Execute the command.
- buildOptionParser() : ConsoleOptionParser
- Configure the command option parser.
- doCreate() : int
- Do create.
- doRestore() : int
- Do restore.
- formatBytes() : string
- Format bytes.
Methods
defaultName()
Get the default command name.
public
static defaultName() : string
Return values
stringexecute()
Execute the command.
public
execute(Arguments $args, ConsoleIo $io) : int|null
Parameters
- $args : Arguments
- $io : ConsoleIo
Return values
int|nullbuildOptionParser()
Configure the command option parser.
protected
buildOptionParser(ConsoleOptionParser $parser) : ConsoleOptionParser
Parameters
- $parser : ConsoleOptionParser
Return values
ConsoleOptionParserdoCreate()
Do create.
private
doCreate(string $key, ConsoleIo $io) : int
Parameters
- $key : string
- $io : ConsoleIo
Return values
intdoRestore()
Do restore.
private
doRestore(string $key, Arguments $args, ConsoleIo $io) : int
Parameters
- $key : string
- $args : Arguments
- $io : ConsoleIo
Return values
intformatBytes()
Format bytes.
private
formatBytes(int $bytes) : string
Parameters
- $bytes : int