mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-08 00:04:27 +02:00
Move Container logic into own class
This commit is contained in:
parent
6d77eb9b10
commit
40fbb02149
14 changed files with 147 additions and 88 deletions
|
@ -9,10 +9,11 @@ declare(strict_types=1);
|
|||
|
||||
namespace Friendica\Console;
|
||||
|
||||
use Asika\SimpleConsole\CommandArgsException;
|
||||
use Friendica\App\Mode;
|
||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||
use Asika\SimpleConsole\Console;
|
||||
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
|
||||
use Friendica\Core\Logger\Capability\LogChannel;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Core\Update;
|
||||
use Friendica\Core\Worker;
|
||||
|
@ -26,8 +27,10 @@ use RuntimeException;
|
|||
/**
|
||||
* Console command for interacting with the daemon
|
||||
*/
|
||||
final class Daemon extends Console
|
||||
final class Daemon extends AbstractConsole
|
||||
{
|
||||
public const LOG_CHANNEL = LogChannel::DAEMON;
|
||||
|
||||
private Mode $mode;
|
||||
private IManageConfigValues $config;
|
||||
private IManageKeyValuePairs $keyValue;
|
||||
|
@ -98,6 +101,8 @@ HELP;
|
|||
throw new RuntimeException("Friendica isn't properly installed yet");
|
||||
}
|
||||
|
||||
$this->logger->warning('blah!');
|
||||
|
||||
$this->mode->setExecutor(Mode::DAEMON);
|
||||
|
||||
$this->config->reload();
|
||||
|
@ -120,7 +125,7 @@ HELP;
|
|||
$foreground = $this->getOption(['f', 'foreground']) ?? false;
|
||||
|
||||
if (empty($daemonMode)) {
|
||||
throw new RuntimeException("Please use either 'start', 'stop' or 'status'");
|
||||
throw new CommandArgsException("Please use either 'start', 'stop' or 'status'");
|
||||
}
|
||||
|
||||
$this->daemon->init($pidfile);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue