Add new console command to start and stop tmux (tmux-ui:start and tmux-ui:stop)

This commit is contained in:
DariusIII
2017-07-27 23:52:55 +02:00
parent dc262e923b
commit 55f789c18b
4 changed files with 111 additions and 2 deletions
+2 -1
View File
@@ -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
+52
View File
@@ -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;
}
});
}
}
+52
View File
@@ -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;
}
});
}
}
+5 -1
View File
@@ -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
];
/**