mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
backup support zip
This commit is contained in:
@@ -12,14 +12,14 @@ class BackuAll extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'backup:all';
|
||||
protected $signature = 'backup:all {--method=}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Backup all data, include web root and database.';
|
||||
protected $description = 'Backup all data, include web root and database. options: --method';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
@@ -38,8 +38,10 @@ class BackuAll extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$method = $this->option('method');
|
||||
$this->info("method: $method");
|
||||
$rep = new ToolRepository();
|
||||
$result = $rep->backupAll();
|
||||
$result = $rep->backupAll($method);
|
||||
$log = sprintf(
|
||||
'[%s], %s, result: %s',
|
||||
nexus()->getRequestId(), __METHOD__, var_export($result, true)
|
||||
|
||||
@@ -12,14 +12,14 @@ class BackupWeb extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'backup:web';
|
||||
protected $signature = 'backup:web {--method=}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'BackupWeb web data';
|
||||
protected $description = 'BackupWeb web data, options: --method';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
@@ -38,8 +38,10 @@ class BackupWeb extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$method = $this->option('method');
|
||||
$this->info("method: $method");
|
||||
$rep = new ToolRepository();
|
||||
$result = $rep->backupWeb();
|
||||
$result = $rep->backupWeb($method);
|
||||
$log = sprintf('[%s], %s, result: %s', nexus()->getRequestId(), __METHOD__, var_export($result, true));
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
|
||||
@@ -128,13 +128,7 @@ class Test extends Command
|
||||
// $r = $rep->getContinuousDays($attendance);
|
||||
// $r = $rep->getContinuousPoints(11);
|
||||
|
||||
$rep = new ToolRepository();
|
||||
$filename = resource_path('lang/zh_CN.json');
|
||||
$setting = [
|
||||
'via_sftp' => 'yes',
|
||||
];
|
||||
// $r = $rep->saveToSftp($setting, $filename);
|
||||
$r = strval(true);
|
||||
$r = trim(exec('command -v 7z.exe'));
|
||||
dd($r);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user