refactor usage of Friendica\App namespace

This commit is contained in:
Art4 2024-11-11 00:30:58 +00:00
parent 629c4af3c8
commit 20f5a96fe0
29 changed files with 93 additions and 82 deletions

View file

@ -15,7 +15,6 @@ if (php_sapi_name() !== 'cli') {
} }
use Dice\Dice; use Dice\Dice;
use Friendica\App;
use Friendica\App\Mode; use Friendica\App\Mode;
use Friendica\Core\Logger\Capability\LogChannel; use Friendica\Core\Logger\Capability\LogChannel;
use Friendica\Core\Update; use Friendica\Core\Update;
@ -57,7 +56,7 @@ DI::mode()->setExecutor(Mode::WORKER);
Update::check(DI::basePath(), true); Update::check(DI::basePath(), true);
// Quit when in maintenance // Quit when in maintenance
if (!DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) { if (!DI::mode()->has(Mode::MAINTENANCEDISABLED)) {
return; return;
} }

View file

@ -8,8 +8,7 @@
namespace Friendica\Console; namespace Friendica\Console;
use Console_Table; use Console_Table;
use Friendica\App; use Friendica\App\Mode;
use Friendica\Content\Pager;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Addon as AddonCore; use Friendica\Core\Addon as AddonCore;
use Friendica\Database\Database; use Friendica\Database\Database;
@ -24,7 +23,7 @@ class Addon extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?']; protected $helpOptions = ['h', 'help', '?'];
/** /**
* @var App\Mode * @var Mode
*/ */
private $appMode; private $appMode;
/** /**
@ -57,7 +56,7 @@ HELP;
return $help; return $help;
} }
public function __construct(App\Mode $appMode, L10n $l10n, Database $dba, array $argv = null) public function __construct(Mode $appMode, L10n $l10n, Database $dba, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);

View file

@ -7,7 +7,7 @@
namespace Friendica\Console; namespace Friendica\Console;
use Friendica\App; use Friendica\App\Mode;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -28,7 +28,7 @@ class ArchiveContact extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?']; protected $helpOptions = ['h', 'help', '?'];
/** /**
* @var App\Mode * @var Mode
*/ */
private $appMode; private $appMode;
/** /**
@ -57,7 +57,7 @@ HELP;
return $help; return $help;
} }
public function __construct(App\Mode $appMode, Database $dba, \Friendica\Core\L10n $l10n, array $argv = null) public function __construct(Mode $appMode, Database $dba, \Friendica\Core\L10n $l10n, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);

View file

@ -9,8 +9,7 @@ namespace Friendica\Console;
use Asika\SimpleConsole\Console; use Asika\SimpleConsole\Console;
use Exception; use Exception;
use Friendica\App; use Friendica\App\Mode;
use Friendica\App\BaseURL;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Installer; use Friendica\Core\Installer;
@ -21,7 +20,7 @@ use RuntimeException;
class AutomaticInstallation extends Console class AutomaticInstallation extends Console
{ {
/** @var App\Mode */ /** @var Mode */
private $appMode; private $appMode;
/** @var \Friendica\Core\Config\ValueObject\Cache */ /** @var \Friendica\Core\Config\ValueObject\Cache */
private $configCache; private $configCache;
@ -87,7 +86,7 @@ Examples
HELP; HELP;
} }
public function __construct(App\Mode $appMode, Cache $configCache, IManageConfigValues $config, Database $dba, array $argv = null) public function __construct(Mode $appMode, Cache $configCache, IManageConfigValues $config, Database $dba, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);

View file

@ -8,7 +8,7 @@
namespace Friendica\Console; namespace Friendica\Console;
use Asika\SimpleConsole\CommandArgsException; use Asika\SimpleConsole\CommandArgsException;
use Friendica\App; use Friendica\App\Mode;
use Friendica\Core\Cache\Enum\Duration; use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Cache\Capability\ICanCache; use Friendica\Core\Cache\Capability\ICanCache;
use RuntimeException; use RuntimeException;
@ -25,7 +25,7 @@ class Cache extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?']; protected $helpOptions = ['h', 'help', '?'];
/** /**
* @var App\Mode * @var Mode
*/ */
private $appMode; private $appMode;
@ -68,7 +68,7 @@ HELP;
return $help; return $help;
} }
public function __construct(App\Mode $appMode, ICanCache $cache, array $argv = null) public function __construct(Mode $appMode, ICanCache $cache, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);
@ -85,7 +85,7 @@ HELP;
$this->out('Options: ' . var_export($this->options, true)); $this->out('Options: ' . var_export($this->options, true));
} }
if (!$this->appMode->has(App\Mode::DBAVAILABLE)) { if (!$this->appMode->has(Mode::DBAVAILABLE)) {
$this->out('Database isn\'t ready or populated yet, database cache won\'t be available'); $this->out('Database isn\'t ready or populated yet, database cache won\'t be available');
} }

View file

@ -8,7 +8,7 @@
namespace Friendica\Console; namespace Friendica\Console;
use Asika\SimpleConsole\CommandArgsException; use Asika\SimpleConsole\CommandArgsException;
use Friendica\App; use Friendica\App\Mode;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use RuntimeException; use RuntimeException;
@ -38,7 +38,7 @@ class Config extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?']; protected $helpOptions = ['h', 'help', '?'];
/** /**
* @var App\Mode * @var Mode
*/ */
private $appMode; private $appMode;
/** /**
@ -80,7 +80,7 @@ HELP;
return $help; return $help;
} }
public function __construct(App\Mode $appMode, IManageConfigValues $config, array $argv = null) public function __construct(Mode $appMode, IManageConfigValues $config, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);

View file

@ -8,7 +8,7 @@
namespace Friendica\Console; namespace Friendica\Console;
use Console_Table; use Console_Table;
use Friendica\App; use Friendica\App\Mode;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Contact as ContactModel; use Friendica\Model\Contact as ContactModel;
use Friendica\Model\User as UserModel; use Friendica\Model\User as UserModel;
@ -25,7 +25,7 @@ class Contact extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?']; protected $helpOptions = ['h', 'help', '?'];
/** /**
* @var App\Mode * @var Mode
*/ */
private $appMode; private $appMode;
/** /**
@ -55,7 +55,7 @@ HELP;
return $help; return $help;
} }
public function __construct(App\Mode $appMode, array $argv = null) public function __construct(Mode $appMode, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);

View file

@ -7,7 +7,7 @@
namespace Friendica\Console; namespace Friendica\Console;
use Friendica\App; use Friendica\App\Mode;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -22,7 +22,7 @@ class GlobalCommunityBlock extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?']; protected $helpOptions = ['h', 'help', '?'];
/** /**
* @var App\Mode * @var Mode
*/ */
private $appMode; private $appMode;
/** /**
@ -48,7 +48,7 @@ HELP;
return $help; return $help;
} }
public function __construct(App\Mode $appMode, L10n $l10n, $argv = null) public function __construct(Mode $appMode, L10n $l10n, $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);

View file

@ -8,7 +8,7 @@
namespace Friendica\Console; namespace Friendica\Console;
use Asika\SimpleConsole\CommandArgsException; use Asika\SimpleConsole\CommandArgsException;
use Friendica\App; use Friendica\App\Mode;
use Friendica\Core\Lock\Capability\ICanLock; use Friendica\Core\Lock\Capability\ICanLock;
use RuntimeException; use RuntimeException;
@ -23,7 +23,7 @@ class Lock extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?']; protected $helpOptions = ['h', 'help', '?'];
/** /**
* @var App\Mode * @var Mode
*/ */
private $appMode; private $appMode;
@ -62,7 +62,7 @@ HELP;
return $help; return $help;
} }
public function __construct(App\Mode $appMode, ICanLock $lock, array $argv = null) public function __construct(Mode $appMode, ICanLock $lock, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);
@ -79,7 +79,7 @@ HELP;
$this->out('Options: ' . var_export($this->options, true)); $this->out('Options: ' . var_export($this->options, true));
} }
if (!$this->appMode->has(App\Mode::DBAVAILABLE)) { if (!$this->appMode->has(Mode::DBAVAILABLE)) {
$this->out('Database isn\'t ready or populated yet, database cache won\'t be available'); $this->out('Database isn\'t ready or populated yet, database cache won\'t be available');
} }

View file

@ -7,7 +7,7 @@
namespace Friendica\Console; namespace Friendica\Console;
use Friendica\App; use Friendica\App\Mode;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
/** /**
@ -18,7 +18,7 @@ class Maintenance extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?']; protected $helpOptions = ['h', 'help', '?'];
/** /**
* @var App\Mode * @var Mode
*/ */
private $appMode; private $appMode;
/** /**
@ -55,7 +55,7 @@ HELP;
return $help; return $help;
} }
public function __construct(App\Mode $appMode, IManageConfigValues $config, $argv = null) public function __construct(Mode $appMode, IManageConfigValues $config, $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);

View file

@ -8,7 +8,7 @@
namespace Friendica\Console; namespace Friendica\Console;
use Console_Table; use Console_Table;
use Friendica\App; use Friendica\App\Mode;
use Friendica\Content\Pager; use Friendica\Content\Pager;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
@ -26,7 +26,7 @@ class User extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?']; protected $helpOptions = ['h', 'help', '?'];
/** /**
* @var App\Mode * @var Mode
*/ */
private $appMode; private $appMode;
/** /**
@ -74,7 +74,7 @@ HELP;
return $help; return $help;
} }
public function __construct(App\Mode $appMode, L10n $l10n, IManagePersonalConfigValues $pConfig, array $argv = null) public function __construct(Mode $appMode, L10n $l10n, IManagePersonalConfigValues $pConfig, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);

View file

@ -7,7 +7,6 @@
namespace Friendica\Core; namespace Friendica\Core;
use Friendica\App;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Util\Strings; use Friendica\Util\Strings;

View file

@ -7,7 +7,8 @@
namespace Friendica\Core\Session\Factory; namespace Friendica\Core\Session\Factory;
use Friendica\App; use Friendica\App\BaseURL;
use Friendica\App\Mode;
use Friendica\Core\Cache\Factory\Cache; use Friendica\Core\Cache\Factory\Cache;
use Friendica\Core\Cache\Type\DatabaseCache; use Friendica\Core\Cache\Type\DatabaseCache;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
@ -33,8 +34,8 @@ class Session
const HANDLER_DEFAULT = self::HANDLER_DATABASE; const HANDLER_DEFAULT = self::HANDLER_DATABASE;
/** /**
* @param App\Mode $mode * @param Mode $mode
* @param App\BaseURL $baseURL * @param BaseURL $baseURL
* @param IManageConfigValues $config * @param IManageConfigValues $config
* @param Database $dba * @param Database $dba
* @param Cache $cacheFactory * @param Cache $cacheFactory
@ -43,7 +44,7 @@ class Session
* @param array $server * @param array $server
* @return IHandleSessions * @return IHandleSessions
*/ */
public function create(App\Mode $mode, App\BaseURL $baseURL, IManageConfigValues $config, Database $dba, Cache $cacheFactory, LoggerInterface $logger, Profiler $profiler, array $server = []): IHandleSessions public function create(Mode $mode, BaseURL $baseURL, IManageConfigValues $config, Database $dba, Cache $cacheFactory, LoggerInterface $logger, Profiler $profiler, array $server = []): IHandleSessions
{ {
$profiler->startRecording('session'); $profiler->startRecording('session');
$session_handler = $config->get('system', 'session_handler', self::HANDLER_DEFAULT); $session_handler = $config->get('system', 'session_handler', self::HANDLER_DEFAULT);

View file

@ -7,7 +7,7 @@
namespace Friendica\Core\Session\Type; namespace Friendica\Core\Session\Type;
use Friendica\App; use Friendica\App\BaseURL;
use Friendica\Core\Session\Capability\IHandleSessions; use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\Model\User\Cookie; use Friendica\Model\User\Cookie;
use SessionHandlerInterface; use SessionHandlerInterface;
@ -17,7 +17,7 @@ use SessionHandlerInterface;
*/ */
class Native extends AbstractSession implements IHandleSessions class Native extends AbstractSession implements IHandleSessions
{ {
public function __construct(App\BaseURL $baseURL, SessionHandlerInterface $handler = null) public function __construct(BaseURL $baseURL, SessionHandlerInterface $handler = null)
{ {
ini_set('session.gc_probability', 50); ini_set('session.gc_probability', 50);
ini_set('session.use_only_cookies', 1); ini_set('session.use_only_cookies', 1);

View file

@ -7,7 +7,6 @@
namespace Friendica\Core; namespace Friendica\Core;
use Friendica\App;
use Friendica\App\Mode; use Friendica\App\Mode;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Database\DBStructure; use Friendica\Database\DBStructure;
@ -29,7 +28,6 @@ class Update
* *
* @param string $basePath The base path of this application * @param string $basePath The base path of this application
* @param boolean $via_worker Is the check run via the worker? * @param boolean $via_worker Is the check run via the worker?
* @param App\Mode $mode The current app mode
* @return void * @return void
* @throws \Friendica\Network\HTTPException\InternalServerErrorException * @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/ */

View file

@ -7,7 +7,8 @@
namespace Friendica\Model\User; namespace Friendica\Model\User;
use Friendica\App; use Friendica\App\BaseURL;
use Friendica\App\Request;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
/** /**
@ -38,12 +39,12 @@ class Cookie
private $data; private $data;
/** /**
* @param App\Request $request The current http request * @param Request $request The current http request
* @param IManageConfigValues $config * @param IManageConfigValues $config
* @param App\BaseURL $baseURL * @param BaseURL $baseURL
* @param array $COOKIE The $_COOKIE array * @param array $COOKIE The $_COOKIE array
*/ */
public function __construct(App\Request $request, IManageConfigValues $config, App\BaseURL $baseURL, array $COOKIE = []) public function __construct(Request $request, IManageConfigValues $config, BaseURL $baseURL, array $COOKIE = [])
{ {
$this->sslEnabled = $baseURL->getScheme() === 'https'; $this->sslEnabled = $baseURL->getScheme() === 'https';
$this->sitePrivateKey = $config->get('system', 'site_prvkey'); $this->sitePrivateKey = $config->get('system', 'site_prvkey');

View file

@ -7,7 +7,8 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
@ -28,7 +29,7 @@ class Apps extends BaseModule
/** @var SystemMessages */ /** @var SystemMessages */
protected $systemMessages; protected $systemMessages;
public function __construct(SystemMessages $systemMessages, Nav $nav, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) public function __construct(SystemMessages $systemMessages, Nav $nav, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);

View file

@ -8,14 +8,13 @@
namespace Friendica\Module; namespace Friendica\Module;
use Exception; use Exception;
use Friendica\App;
use Friendica\App\Arguments; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Pager; use Friendica\Content\Pager;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions; use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Navigation\Notifications\ValueObject\FormattedNotify; use Friendica\Navigation\Notifications\ValueObject\FormattedNotify;
use Friendica\Network\HTTPException\ForbiddenException; use Friendica\Network\HTTPException\ForbiddenException;
use Friendica\Util\Profiler; use Friendica\Util\Profiler;
@ -76,7 +75,7 @@ abstract class BaseNotifications extends BaseModule
*/ */
abstract public function getNotifications(); abstract public function getNotifications();
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, array $server, array $parameters = []) public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);

View file

@ -7,7 +7,6 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Core\Hook; use Friendica\Core\Hook;

View file

@ -7,7 +7,9 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Content\Nav; use Friendica\Content\Nav;
@ -20,12 +22,12 @@ use Psr\Log\LoggerInterface;
class BaseSettings extends BaseModule class BaseSettings extends BaseModule
{ {
/** @var App\Page */ /** @var Page */
protected $page; protected $page;
/** @var IHandleUserSessions */ /** @var IHandleUserSessions */
protected $session; protected $session;
public function __construct(IHandleUserSessions $session, App\Page $page, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(IHandleUserSessions $session, Page $page, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);

View file

@ -7,7 +7,8 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
@ -35,7 +36,7 @@ class FriendSuggest extends BaseModule
/** @var \Friendica\Contact\FriendSuggest\Factory\FriendSuggest */ /** @var \Friendica\Contact\FriendSuggest\Factory\FriendSuggest */
protected $friendSuggestFac; protected $friendSuggestFac;
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Database $dba, \Friendica\Contact\FriendSuggest\Repository\FriendSuggest $friendSuggestRepo, \Friendica\Contact\FriendSuggest\Factory\FriendSuggest $friendSuggestFac, array $server, array $parameters = []) public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Database $dba, \Friendica\Contact\FriendSuggest\Repository\FriendSuggest $friendSuggestRepo, \Friendica\Contact\FriendSuggest\Factory\FriendSuggest $friendSuggestFac, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
@ -97,14 +98,14 @@ class FriendSuggest extends BaseModule
} }
$suggestableContacts = ContactModel::selectToArray(['id', 'name'], [ $suggestableContacts = ContactModel::selectToArray(['id', 'name'], [
'`uid` = ? '`uid` = ?
AND `id` != ? AND `id` != ?
AND `network` = ? AND `network` = ?
AND NOT `self` AND NOT `self`
AND NOT `blocked` AND NOT `blocked`
AND NOT `pending` AND NOT `pending`
AND NOT `archive` AND NOT `archive`
AND NOT `deleted` AND NOT `deleted`
AND `notify` != ""', AND `notify` != ""',
DI::userSession()->getLocalUserId(), DI::userSession()->getLocalUserId(),
$cid, $cid,

View file

@ -8,6 +8,8 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App; use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
@ -36,7 +38,7 @@ class Friendica extends BaseModule
/** @var IHandleUserSessions */ /** @var IHandleUserSessions */
private $session; private $session;
public function __construct(IHandleUserSessions $session, IManageKeyValuePairs $keyValue, IManageConfigValues $config, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(IHandleUserSessions $session, IManageKeyValuePairs $keyValue, IManageConfigValues $config, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);

View file

@ -8,6 +8,8 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App; use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
@ -25,7 +27,7 @@ class NodeInfo110 extends BaseModule
/** @var IManageConfigValues */ /** @var IManageConfigValues */
protected $config; protected $config;
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);

View file

@ -8,6 +8,8 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App; use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
@ -25,7 +27,7 @@ class NodeInfo120 extends BaseModule
/** @var IManageConfigValues */ /** @var IManageConfigValues */
protected $config; protected $config;
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);

View file

@ -8,6 +8,8 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App; use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
@ -25,7 +27,7 @@ class NodeInfo121 extends BaseModule
/** @var IManageConfigValues */ /** @var IManageConfigValues */
protected $config; protected $config;
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);

View file

@ -8,6 +8,8 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App; use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
@ -25,7 +27,7 @@ class NodeInfo122 extends BaseModule
/** @var IManageConfigValues */ /** @var IManageConfigValues */
protected $config; protected $config;
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);

View file

@ -8,6 +8,8 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App; use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
@ -25,7 +27,7 @@ class NodeInfo210 extends BaseModule
/** @var IManageConfigValues */ /** @var IManageConfigValues */
protected $config; protected $config;
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);

View file

@ -7,13 +7,13 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Session\Capability\IHandleUserSessions; use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Network\HTTPException\BadRequestException; use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Util; use Friendica\Util;
use Friendica\Util\Profiler; use Friendica\Util\Profiler;
@ -24,7 +24,7 @@ class ParseUrl extends BaseModule
/** @var IHandleUserSessions */ /** @var IHandleUserSessions */
protected $userSession; protected $userSession;
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $userSession, $server, array $parameters = []) public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $userSession, $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);

View file

@ -7,7 +7,8 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
@ -41,7 +42,7 @@ class Register extends BaseModule
/** @var IHandleUserSessions */ /** @var IHandleUserSessions */
private $session; private $session;
public function __construct(IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) public function __construct(IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
@ -277,7 +278,7 @@ class Register extends BaseModule
$regdata = ['email' => $arr['email'], 'nickname' => $arr['nickname'], 'username' => $arr['username']]; $regdata = ['email' => $arr['email'], 'nickname' => $arr['nickname'], 'username' => $arr['username']];
DI::baseUrl()->redirect('register?' . http_build_query($regdata)); DI::baseUrl()->redirect('register?' . http_build_query($regdata));
} }
//Check if nickname contains only US-ASCII and do not start with a digit //Check if nickname contains only US-ASCII and do not start with a digit
if (!preg_match('/^[a-zA-Z][a-zA-Z0-9]*$/', $arr['nickname'])) { if (!preg_match('/^[a-zA-Z][a-zA-Z0-9]*$/', $arr['nickname'])) {
if (is_numeric(substr($arr['nickname'], 0, 1))) { if (is_numeric(substr($arr['nickname'], 0, 1))) {
@ -289,7 +290,7 @@ class Register extends BaseModule
DI::baseUrl()->redirect('register?' . http_build_query($regdata)); DI::baseUrl()->redirect('register?' . http_build_query($regdata));
return; return;
} }
$arr['blocked'] = $blocked; $arr['blocked'] = $blocked;
$arr['verified'] = $verified; $arr['verified'] = $verified;
$arr['language'] = L10n::detectLanguage($_SERVER, $_GET, DI::config()->get('system', 'language')); $arr['language'] = L10n::detectLanguage($_SERVER, $_GET, DI::config()->get('system', 'language'));
@ -433,6 +434,6 @@ class Register extends BaseModule
return intval(DI::config()->get('config', 'register_policy')); return intval(DI::config()->get('config', 'register_policy'));
} }
} }
return self::CLOSED; return self::CLOSED;
} }
} }