mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-14 20:40:49 +08:00
admin add torrents
This commit is contained in:
@@ -12,14 +12,14 @@ class NexusUpdate extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'nexus:update {--tag=} {--keep_tmp}';
|
||||
protected $signature = 'nexus:update {--tag=} {--keep_tmp} {--include_composer}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Update nexusphp after code updated, remember run `composer update` first. Options: --tag=, --keep_tmp';
|
||||
protected $description = 'Update nexusphp after code updated, remember run `composer update` first. Options: --tag=, --keep_tmp, --include_composer';
|
||||
|
||||
private $update;
|
||||
|
||||
@@ -45,14 +45,19 @@ class NexusUpdate extends Command
|
||||
require ROOT_PATH . 'nexus/Database/helpers.php';
|
||||
$tag = $this->option('tag');
|
||||
$keepTmp = $this->option('keep_tmp');
|
||||
$includeComposer = $this->option('include_composer');
|
||||
$includes = [];
|
||||
if ($includeComposer) {
|
||||
$includes[] = 'composer';
|
||||
}
|
||||
if ($tag !== null) {
|
||||
if ($tag === 'dev') {
|
||||
$url = "https://github.com/xiaomlove/nexusphp/archive/refs/heads/php8.zip";
|
||||
} else {
|
||||
$url = "https://api.github.com/repos/xiaomlove/nexusphp/tarball/v$tag";
|
||||
}
|
||||
$this->doLog("Specific tag: '$tag', download from '$url' and extra code...");
|
||||
$tmpPath = $this->update->downAndExtractCode($url);
|
||||
$this->doLog("Specific tag: '$tag', download from '$url' and extra code, includes: " . implode(', ', $includes));
|
||||
$tmpPath = $this->update->downAndExtractCode($url, $includes);
|
||||
}
|
||||
//Step 1
|
||||
$step = $this->update->currentStep();
|
||||
|
||||
@@ -78,8 +78,8 @@ class Test extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$r = User::query()->find(10003, ['id', 'added', 'donoruntil']);
|
||||
dd($r->donoruntil->toDateTimeString() < '1978');
|
||||
$r = Carbon::parse('2022-07-03 04:00:00')->diffInSeconds();
|
||||
dd($r);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user