mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-31 18:28:54 +00:00
Add new console command to start and stop tmux (tmux-ui:start and tmux-ui:stop)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
2017-07-27 DariusIII
|
||||
* Chg: Update phpmailer to latest version
|
||||
* Chg: Add new console command to start and stop tmux (tmux-ui:start and tmux-ui:stop)
|
||||
* Chg: Update phpmailer to latest version
|
||||
2017-07-26 DariusIII
|
||||
* Fix: Fix the logic for limits in release_naming_regexes-test and Regexes class. Should fix issue #156
|
||||
* Chg: Declare return types and add @throw annotations where needed in Regexes and ReleaseCleaning classes
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Symfony\Component\Process\Process;
|
||||
|
||||
class TmuxUIStart extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'tmux-ui:start';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Start tmux processing';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
* @throws \Symfony\Component\Process\Exception\LogicException
|
||||
* @throws \Symfony\Component\Process\Exception\RuntimeException
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$process = new Process('php misc/update/nix/tmux/start.php');
|
||||
$process->run(function ($type, $buffer) {
|
||||
if (Process::ERR === $type) {
|
||||
echo 'ERR > '.$buffer;
|
||||
} else {
|
||||
echo $buffer;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Symfony\Component\Process\Process;
|
||||
|
||||
class TmuxUIStop extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'tmux-ui:stop';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Stop tmux processing';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
* @throws \Symfony\Component\Process\Exception\LogicException
|
||||
* @throws \Symfony\Component\Process\Exception\RuntimeException
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$process = new Process('php misc/update/nix/tmux/stop.php');
|
||||
$process->run(function ($type, $buffer) {
|
||||
if (Process::ERR === $type) {
|
||||
echo 'ERR > '.$buffer;
|
||||
} else {
|
||||
echo $buffer;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use App\Console\Commands\TmuxUIStart;
|
||||
use App\Console\Commands\TmuxUIStop;
|
||||
use App\Console\Commands\UpdateNNTmux;
|
||||
use App\Console\Commands\UpdateNNTmuxComposer;
|
||||
use App\Console\Commands\UpdateNNTmuxDB;
|
||||
@@ -24,7 +26,9 @@ class Kernel extends ConsoleKernel
|
||||
UpdateNNTmuxGit::class,
|
||||
UpdateNNTmuxComposer::class,
|
||||
VerifyNNTmuxSettings::class,
|
||||
VerifyNNTmuxVersion::class
|
||||
VerifyNNTmuxVersion::class,
|
||||
TmuxUIStart::class,
|
||||
TmuxUIStop::class
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user