Merge pull request #12966 from MrPetovan/bug/fatal-errors

Fix a couple of namespace issues
This commit is contained in:
Philipp 2023-04-01 16:34:57 +02:00 committed by GitHub
commit 5123e67f8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 11 deletions

View file

@ -24,6 +24,7 @@
"ext-libxml": "*", "ext-libxml": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-openssl": "*", "ext-openssl": "*",
"ext-posix": "*",
"ext-simplexml": "*", "ext-simplexml": "*",
"ext-xml": "*", "ext-xml": "*",
"asika/simple-console": "^1.0", "asika/simple-console": "^1.0",
@ -34,6 +35,7 @@
"friendica/json-ld": "^1.0", "friendica/json-ld": "^1.0",
"geekwright/po": "^2.0", "geekwright/po": "^2.0",
"guzzlehttp/guzzle": "^6.5", "guzzlehttp/guzzle": "^6.5",
"kornrunner/blurhash": "^1.2",
"league/html-to-markdown": "^4.8", "league/html-to-markdown": "^4.8",
"level-2/dice": "^4", "level-2/dice": "^4",
"lightopenid/lightopenid": "dev-master", "lightopenid/lightopenid": "dev-master",
@ -49,6 +51,7 @@
"phpseclib/phpseclib": "^3.0", "phpseclib/phpseclib": "^3.0",
"pragmarx/google2fa": "^5.0", "pragmarx/google2fa": "^5.0",
"pragmarx/recovery": "^0.2", "pragmarx/recovery": "^0.2",
"psr/clock": "^1.0",
"psr/container": "^1.0", "psr/container": "^1.0",
"psr/log": "^1.1", "psr/log": "^1.1",
"seld/cli-prompt": "^1.0", "seld/cli-prompt": "^1.0",
@ -71,9 +74,7 @@
"npm-asset/moment": "^2.24", "npm-asset/moment": "^2.24",
"npm-asset/perfect-scrollbar": "0.6.16", "npm-asset/perfect-scrollbar": "0.6.16",
"npm-asset/textcomplete": "^0.18.2", "npm-asset/textcomplete": "^0.18.2",
"npm-asset/typeahead.js": "^0.11.1", "npm-asset/typeahead.js": "^0.11.1"
"kornrunner/blurhash": "^1.2",
"psr/clock": "^1.0"
}, },
"repositories": [ "repositories": [
{ {

3
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "c9e005c79c8556215c30a66c470659eb", "content-hash": "456d14e3ad9be265c5c9e6172a0d18d8",
"packages": [ "packages": [
{ {
"name": "asika/simple-console", "name": "asika/simple-console",
@ -6474,6 +6474,7 @@
"ext-libxml": "*", "ext-libxml": "*",
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-openssl": "*", "ext-openssl": "*",
"ext-posix": "*",
"ext-simplexml": "*", "ext-simplexml": "*",
"ext-xml": "*" "ext-xml": "*"
}, },

View file

@ -112,7 +112,7 @@ class Process extends BaseRepository
try { try {
$processes = $this->db->select(static::$table_name, ['pid'], ['hostname' => $this->currentHost]); $processes = $this->db->select(static::$table_name, ['pid'], ['hostname' => $this->currentHost]);
while ($process = $this->db->fetch($processes)) { while ($process = $this->db->fetch($processes)) {
if (!posix_kill($process['pid'], 0)) { if (!\posix_kill($process['pid'], 0)) {
$this->db->delete(static::$table_name, ['pid' => $process['pid']]); $this->db->delete(static::$table_name, ['pid' => $process['pid']]);
} }
} }

View file

@ -35,7 +35,7 @@ use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\Register; use Friendica\Module;
use Friendica\Network\HTTPClient\Client\HttpClientAccept; use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Security\TwoFactor\Model\AppSpecificPassword; use Friendica\Security\TwoFactor\Model\AppSpecificPassword;
use Friendica\Network\HTTPException; use Friendica\Network\HTTPException;
@ -1890,17 +1890,17 @@ class User
} }
$register_policy = DI::config()->get('config', 'register_policy'); $register_policy = DI::config()->get('config', 'register_policy');
if (!in_array($register_policy, [Register::OPEN, Register::CLOSED])) { if (!in_array($register_policy, [Module\Register::OPEN, Module\Register::CLOSED])) {
Logger::debug('Unsupported register policy.', ['policy' => $register_policy]); Logger::debug('Unsupported register policy.', ['policy' => $register_policy]);
return; return;
} }
$users = DBA::count('user', ['blocked' => false, 'account_removed' => false, 'account_expired' => false]); $users = DBA::count('user', ['blocked' => false, 'account_removed' => false, 'account_expired' => false]);
if (($users >= $max_registered_users) && ($register_policy == Register::OPEN)) { if (($users >= $max_registered_users) && ($register_policy == Module\Register::OPEN)) {
DI::config()->set('config', 'register_policy', Register::CLOSED); DI::config()->set('config', 'register_policy', Module\Register::CLOSED);
Logger::notice('Max users reached, registration is closed.', ['users' => $users, 'max' => $max_registered_users]); Logger::notice('Max users reached, registration is closed.', ['users' => $users, 'max' => $max_registered_users]);
} elseif (($users < $max_registered_users) && ($register_policy == Register::CLOSED)) { } elseif (($users < $max_registered_users) && ($register_policy == Module\Register::CLOSED)) {
DI::config()->set('config', 'register_policy', Register::OPEN); DI::config()->set('config', 'register_policy', Module\Register::OPEN);
Logger::notice('Below maximum users, registration is opened.', ['users' => $users, 'max' => $max_registered_users]); Logger::notice('Below maximum users, registration is opened.', ['users' => $users, 'max' => $max_registered_users]);
} else { } else {
Logger::debug('Unchanged register policy', ['policy' => $register_policy, 'users' => $users, 'max' => $max_registered_users]); Logger::debug('Unchanged register policy', ['policy' => $register_policy, 'users' => $users, 'max' => $max_registered_users]);