2019-11-06 08:25:55 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace BeyondCode\LaravelWebSockets\Console;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
|
use Illuminate\Support\InteractsWithTime;
|
|
|
|
|
|
|
|
|
|
class RestartWebSocketServer extends Command
|
|
|
|
|
{
|
|
|
|
|
use InteractsWithTime;
|
|
|
|
|
|
2020-08-18 17:21:22 +00:00
|
|
|
/**
|
|
|
|
|
* The name and signature of the console command.
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2019-11-06 08:25:55 +00:00
|
|
|
protected $signature = 'websockets:restart';
|
|
|
|
|
|
2020-08-18 17:21:22 +00:00
|
|
|
/**
|
|
|
|
|
* The console command description.
|
|
|
|
|
*
|
|
|
|
|
* @var string|null
|
|
|
|
|
*/
|
2019-11-06 08:25:55 +00:00
|
|
|
protected $description = 'Restart the Laravel WebSocket Server';
|
|
|
|
|
|
2020-08-18 17:21:22 +00:00
|
|
|
/**
|
|
|
|
|
* Run the command.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
2019-11-06 08:25:55 +00:00
|
|
|
public function handle()
|
|
|
|
|
{
|
|
|
|
|
Cache::forever('beyondcode:websockets:restart', $this->currentTime());
|
|
|
|
|
|
|
|
|
|
$this->info('Broadcasting WebSocket server restart signal.');
|
|
|
|
|
}
|
|
|
|
|
}
|