Introduce new class Icinga\Clicommands\DaemonCommand

This commit is contained in:
Johannes Meyer 2022-05-17 12:27:25 +02:00
parent 9ed1323e34
commit 4301bedcbb

View File

@ -0,0 +1,22 @@
<?php
/* Icinga Web 2 | (c) 2022 Icinga GmbH | GPLv2+ */
namespace Icinga\Clicommands;
use Icinga\Application\Daemon;
use Icinga\Cli\Command;
use Icinga\Data\ConfigObject;
use React\EventLoop\Loop;
class DaemonCommand extends Command
{
public function runAction()
{
// TODO: Decide where to fetch the socket path for the webserver from (ini? which ini? envvar?)
(new Daemon())
->addJob(new Daemon\HttpJob(new ConfigObject()))
->run();
Loop::get()->run();
}
}