mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 19:37:23 +08:00
add bonus exchange downloaded
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Repositories\PluginRepository;
|
||||
use Illuminate\Console\Command;
|
||||
use Nexus\Plugin\BasePlugin;
|
||||
|
||||
class PluginCronjob extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'plugin:cronjob {--action=} {--id=} {--force=}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Plugin install / update / delete cronjob handler';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$action = $this->option('action');
|
||||
$id = $this->option('id');
|
||||
$force = $this->option('force');
|
||||
$pluginRep = new PluginRepository();
|
||||
$pluginRep->cronjob($action, $id, $force);
|
||||
$log = sprintf("[%s], action: %s, id: %s, force: %s run done !", nexus()->getRequestId(), $action, $id, $force);
|
||||
$this->info($log);
|
||||
do_log($log);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ use App\Repositories\AgentAllowRepository;
|
||||
use App\Repositories\AttendanceRepository;
|
||||
use App\Repositories\ExamRepository;
|
||||
use App\Repositories\HitAndRunRepository;
|
||||
use App\Repositories\PluginRepository;
|
||||
use App\Repositories\SearchBoxRepository;
|
||||
use App\Repositories\SearchRepository;
|
||||
use App\Repositories\TagRepository;
|
||||
@@ -87,7 +88,10 @@ class Test extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$r = \Illuminate\Support\Facades\Cache::lock();
|
||||
$rep = new PluginRepository();
|
||||
// $rep->installCronjob();
|
||||
$r = $rep->getInstalledVersion('xiaomlove/nexusphp-post-like');
|
||||
dd($r);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ class Kernel extends ConsoleKernel
|
||||
$schedule->command('claim:settle')->hourly()->when(function () {
|
||||
return Carbon::now()->format('d') == '01';
|
||||
})->withoutOverlapping();
|
||||
|
||||
// $schedule->command('plugin:cronjob')->everyMinute()->withoutOverlapping();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user