mirror of
https://github.com/friendica/friendica
synced 2025-01-09 20:44:43 +00:00
Make PHP-CS super-happy :)
This commit is contained in:
parent
3e5872d0b1
commit
f2ce5647f2
6 changed files with 44 additions and 41 deletions
|
@ -23,15 +23,12 @@ use Friendica\Core\Hook;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
use Friendica\Core\Worker\Repository\Process as ProcessRepository;
|
use Friendica\Core\Worker\Repository\Process as ProcessRepository;
|
||||||
use Friendica\Database\DBA;
|
|
||||||
use Friendica\Database\Definition\DbaDefinition;
|
use Friendica\Database\Definition\DbaDefinition;
|
||||||
use Friendica\Database\Definition\ViewDefinition;
|
use Friendica\Database\Definition\ViewDefinition;
|
||||||
use Friendica\Module\Maintenance;
|
use Friendica\Module\Maintenance;
|
||||||
use Friendica\Protocol\ATProtocol\Jetstream;
|
|
||||||
use Friendica\Security\Authentication;
|
use Friendica\Security\Authentication;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Logger;
|
|
||||||
use Friendica\Core\Logger\Capability\LogChannel;
|
use Friendica\Core\Logger\Capability\LogChannel;
|
||||||
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
|
|
|
@ -99,7 +99,8 @@ HELP;
|
||||||
$this->config->reload();
|
$this->config->reload();
|
||||||
|
|
||||||
if (empty($this->config->get('system', 'pidfile'))) {
|
if (empty($this->config->get('system', 'pidfile'))) {
|
||||||
throw new RuntimeException(<<< TXT
|
throw new RuntimeException(
|
||||||
|
<<< TXT
|
||||||
Please set system.pidfile in config/local.config.php. For example:
|
Please set system.pidfile in config/local.config.php. For example:
|
||||||
|
|
||||||
'system' => [
|
'system' => [
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
// Copyright (C) 2010-2024, the Friendica project
|
// Copyright (C) 2010-2025, the Friendica project
|
||||||
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
||||||
//
|
//
|
||||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
|
@ -69,36 +69,36 @@ HELP;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected $subConsoles = [
|
protected $subConsoles = [
|
||||||
'addon' => Friendica\Console\Addon::class,
|
'addon' => Friendica\Console\Addon::class,
|
||||||
'archivecontact' => Friendica\Console\ArchiveContact::class,
|
'archivecontact' => Friendica\Console\ArchiveContact::class,
|
||||||
'autoinstall' => Friendica\Console\AutomaticInstallation::class,
|
'autoinstall' => Friendica\Console\AutomaticInstallation::class,
|
||||||
'cache' => Friendica\Console\Cache::class,
|
'cache' => Friendica\Console\Cache::class,
|
||||||
'clearavatarcache' => Friendica\Console\ClearAvatarCache::class,
|
'clearavatarcache' => Friendica\Console\ClearAvatarCache::class,
|
||||||
'config' => Friendica\Console\Config::class,
|
'config' => Friendica\Console\Config::class,
|
||||||
'contact' => Friendica\Console\Contact::class,
|
'contact' => Friendica\Console\Contact::class,
|
||||||
'createdoxygen' => Friendica\Console\CreateDoxygen::class,
|
'createdoxygen' => Friendica\Console\CreateDoxygen::class,
|
||||||
'daemon' => Friendica\Console\Daemon::class,
|
'daemon' => Friendica\Console\Daemon::class,
|
||||||
'jetstream' => Friendica\Console\JetstreamDaemon::class,
|
'jetstream' => Friendica\Console\JetstreamDaemon::class,
|
||||||
'docbloxerrorchecker' => Friendica\Console\DocBloxErrorChecker::class,
|
'docbloxerrorchecker' => Friendica\Console\DocBloxErrorChecker::class,
|
||||||
'dbstructure' => Friendica\Console\DatabaseStructure::class,
|
'dbstructure' => Friendica\Console\DatabaseStructure::class,
|
||||||
'extract' => Friendica\Console\Extract::class,
|
'extract' => Friendica\Console\Extract::class,
|
||||||
'fixapdeliveryworkertaskparameters' => Friendica\Console\FixAPDeliveryWorkerTaskParameters::class,
|
'fixapdeliveryworkertaskparameters' => Friendica\Console\FixAPDeliveryWorkerTaskParameters::class,
|
||||||
'globalcommunityblock' => Friendica\Console\GlobalCommunityBlock::class,
|
'globalcommunityblock' => Friendica\Console\GlobalCommunityBlock::class,
|
||||||
'globalcommunitysilence' => Friendica\Console\GlobalCommunitySilence::class,
|
'globalcommunitysilence' => Friendica\Console\GlobalCommunitySilence::class,
|
||||||
'lock' => Friendica\Console\Lock::class,
|
'lock' => Friendica\Console\Lock::class,
|
||||||
'maintenance' => Friendica\Console\Maintenance::class,
|
'maintenance' => Friendica\Console\Maintenance::class,
|
||||||
'mergecontacts' => Friendica\Console\MergeContacts::class,
|
'mergecontacts' => Friendica\Console\MergeContacts::class,
|
||||||
'movetoavatarcache' => Friendica\Console\MoveToAvatarCache::class,
|
'movetoavatarcache' => Friendica\Console\MoveToAvatarCache::class,
|
||||||
'php2po' => Friendica\Console\PhpToPo::class,
|
'php2po' => Friendica\Console\PhpToPo::class,
|
||||||
'postupdate' => Friendica\Console\PostUpdate::class,
|
'postupdate' => Friendica\Console\PostUpdate::class,
|
||||||
'po2php' => Friendica\Console\PoToPhp::class,
|
'po2php' => Friendica\Console\PoToPhp::class,
|
||||||
'relay' => Friendica\Console\Relay::class,
|
'relay' => Friendica\Console\Relay::class,
|
||||||
'relocate' => Friendica\Console\Relocate::class,
|
'relocate' => Friendica\Console\Relocate::class,
|
||||||
'serverblock' => Friendica\Console\ServerBlock::class,
|
'serverblock' => Friendica\Console\ServerBlock::class,
|
||||||
'storage' => Friendica\Console\Storage::class,
|
'storage' => Friendica\Console\Storage::class,
|
||||||
'test' => Friendica\Console\Test::class,
|
'test' => Friendica\Console\Test::class,
|
||||||
'typo' => Friendica\Console\Typo::class,
|
'typo' => Friendica\Console\Typo::class,
|
||||||
'user' => Friendica\Console\User::class,
|
'user' => Friendica\Console\User::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -38,9 +38,9 @@ use stdClass;
|
||||||
*/
|
*/
|
||||||
class Jetstream
|
class Jetstream
|
||||||
{
|
{
|
||||||
private $uids = [];
|
private $uids = [];
|
||||||
private $self = [];
|
private $self = [];
|
||||||
private $capped = false;
|
private $capped = false;
|
||||||
|
|
||||||
/** @var LoggerInterface */
|
/** @var LoggerInterface */
|
||||||
private $logger;
|
private $logger;
|
||||||
|
@ -213,8 +213,8 @@ class Jetstream
|
||||||
|
|
||||||
if (!$this->capped && count($dids) < $did_limit) {
|
if (!$this->capped && count($dids) < $did_limit) {
|
||||||
$condition = ["`uid` = ? AND `network` = ? AND EXISTS(SELECT `author-id` FROM `post-user` WHERE `author-id` = `contact`.`id` AND `post-user`.`uid` != ?)", 0, Protocol::BLUESKY, 0];
|
$condition = ["`uid` = ? AND `network` = ? AND EXISTS(SELECT `author-id` FROM `post-user` WHERE `author-id` = `contact`.`id` AND `post-user`.`uid` != ?)", 0, Protocol::BLUESKY, 0];
|
||||||
$contacts = Contact::selectToArray(['url'], $condition, ['order' => ['last-item' => true], 'limit' => $did_limit]);
|
$contacts = Contact::selectToArray(['url'], $condition, ['order' => ['last-item' => true], 'limit' => $did_limit]);
|
||||||
$dids = $this->addDids($contacts, $uids, $did_limit, $dids);
|
$dids = $this->addDids($contacts, $uids, $did_limit, $dids);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->keyValue->set('jetstream_did_count', count($dids));
|
$this->keyValue->set('jetstream_did_count', count($dids));
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
// Copyright (C) 2010-2025, the Friendica project
|
||||||
|
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
namespace Friendica\System;
|
namespace Friendica\System;
|
||||||
|
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
|
@ -13,7 +18,7 @@ final class Daemon
|
||||||
private LoggerInterface $logger;
|
private LoggerInterface $logger;
|
||||||
private Database $dba;
|
private Database $dba;
|
||||||
private ?string $pidfile = null;
|
private ?string $pidfile = null;
|
||||||
private ?int $pid = null;
|
private ?int $pid = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The PID of the current daemon (null if either not set or not found)
|
* The PID of the current daemon (null if either not set or not found)
|
||||||
|
@ -91,7 +96,7 @@ final class Daemon
|
||||||
if ($this->pid < 0) {
|
if ($this->pid < 0) {
|
||||||
$this->logger->warning('Could not fork daemon');
|
$this->logger->warning('Could not fork daemon');
|
||||||
return false;
|
return false;
|
||||||
} elseif ($this->pid) {
|
} else if ($this->pid) {
|
||||||
// The parent process continues here
|
// The parent process continues here
|
||||||
if (!file_put_contents($this->pidfile, $this->pid)) {
|
if (!file_put_contents($this->pidfile, $this->pid)) {
|
||||||
$this->logger->warning('Could not store pid file', ['pid' => $this->pid, 'pidfile' => $this->pidfile]);
|
$this->logger->warning('Could not store pid file', ['pid' => $this->pid, 'pidfile' => $this->pidfile]);
|
||||||
|
|
Loading…
Reference in a new issue