Режим обслуживания: down/up и кнопка в панели
503 всем чужим до роутера, пока флаг стоит на диске — своим (system.manage) и списку допуска не мешает
This commit is contained in:
1 parent
84d6382c1d
commit
af4409924f
12 files changed
+380
-14
No files matched your search
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Rsgrinko\Proton\Console\Commands;
|
||||
|
||||
use Rsgrinko\Proton\Console\Command;
|
||||
use Rsgrinko\Proton\Support\Maintenance;
|
||||
|
||||
/**
|
||||
* выключить режим обслуживания.
|
||||
*/
|
||||
final class UpCommand extends Command
|
||||
{
|
||||
public function name(): string
|
||||
{
|
||||
return 'up';
|
||||
}
|
||||
|
||||
public function description(): string
|
||||
{
|
||||
return 'выключить режим обслуживания';
|
||||
}
|
||||
|
||||
public function run(): int
|
||||
{
|
||||
if (!Maintenance::active()) {
|
||||
$this->line('Режим обслуживания и так выключен');
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Maintenance::deactivate();
|
||||
|
||||
$this->ok('Режим обслуживания выключен');
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user