Merge pull request #14542 from Art4/refactoring-of-app-class

[Refactoring] Extract App methods into AppHelper
This commit is contained in:
Hypolite Petovan 2024-11-18 10:37:24 -05:00 committed by GitHub
commit 17dba36e77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
146 changed files with 1752 additions and 1572 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

@ -16,7 +16,7 @@
* information. * information.
*/ */
use Friendica\App; use Friendica\AppHelper;
use Friendica\Content\Conversation; use Friendica\Content\Conversation;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\Hook; use Friendica\Core\Hook;
@ -284,7 +284,7 @@ function item_process(array $post, array $request, bool $preview, string $return
unset($post['api_source']); unset($post['api_source']);
if (!empty($request['scheduled_at'])) { if (!empty($request['scheduled_at'])) {
$scheduled_at = DateTimeFormat::convert($request['scheduled_at'], 'UTC', DI::app()->getTimeZone()); $scheduled_at = DateTimeFormat::convert($request['scheduled_at'], 'UTC', DI::appHelper()->getTimeZone());
if ($scheduled_at > DateTimeFormat::utcNow()) { if ($scheduled_at > DateTimeFormat::utcNow()) {
unset($post['created']); unset($post['created']);
unset($post['edited']); unset($post['edited']);
@ -330,7 +330,7 @@ function item_post_return($baseurl, $return_path)
System::jsonExit($json); System::jsonExit($json);
} }
function item_content(App $a) function item_content(AppHelper $appHelper)
{ {
if (!DI::userSession()->isAuthenticated()) { if (!DI::userSession()->isAuthenticated()) {
throw new HTTPException\UnauthorizedException(); throw new HTTPException\UnauthorizedException();

View file

@ -7,7 +7,7 @@
* *
*/ */
use Friendica\App; use Friendica\AppHelper;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
@ -15,7 +15,7 @@ use Friendica\Model\User;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings; use Friendica\Util\Strings;
function lostpass_post(App $a) function lostpass_post(AppHelper $a)
{ {
$loginame = trim($_POST['login-name']); $loginame = trim($_POST['login-name']);
if (!$loginame) { if (!$loginame) {
@ -78,7 +78,7 @@ function lostpass_post(App $a)
DI::baseUrl()->redirect(); DI::baseUrl()->redirect();
} }
function lostpass_content(App $a) function lostpass_content(AppHelper $appHelper)
{ {
if (DI::args()->getArgc() > 1) { if (DI::args()->getArgc() > 1) {
$pwdreset_token = DI::args()->getArgv()[1]; $pwdreset_token = DI::args()->getArgv()[1];

View file

@ -7,7 +7,7 @@
* *
*/ */
use Friendica\App; use Friendica\AppHelper;
use Friendica\Content\Conversation; use Friendica\Content\Conversation;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Content\Pager; use Friendica\Content\Pager;
@ -17,7 +17,7 @@ use Friendica\Model\Item;
use Friendica\Model\Post; use Friendica\Model\Post;
use Friendica\Module\BaseProfile; use Friendica\Module\BaseProfile;
function notes_init(App $a) function notes_init(AppHelper $appHelper)
{ {
if (! DI::userSession()->getLocalUserId()) { if (! DI::userSession()->getLocalUserId()) {
return; return;
@ -27,7 +27,7 @@ function notes_init(App $a)
} }
function notes_content(App $a, bool $update = false) function notes_content(AppHelper $appHelper, bool $update = false)
{ {
if (!DI::userSession()->getLocalUserId()) { if (!DI::userSession()->getLocalUserId()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.')); DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
@ -46,11 +46,11 @@ function notes_content(App $a, bool $update = false)
'acl_data' => '', 'acl_data' => '',
]; ];
$o .= DI::conversation()->statusEditor($x, $a->getContactId()); $o .= DI::conversation()->statusEditor($x, $appHelper->getContactId());
} }
$condition = ['uid' => DI::userSession()->getLocalUserId(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT, $condition = ['uid' => DI::userSession()->getLocalUserId(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT,
'contact-id'=> $a->getContactId()]; 'contact-id'=> $appHelper->getContactId()];
if (DI::mode()->isMobile()) { if (DI::mode()->isMobile()) {
$itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network', $itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',

View file

@ -9,14 +9,14 @@
* *
*/ */
use Friendica\App; use Friendica\AppHelper;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Post; use Friendica\Model\Post;
use Friendica\Model\Contact; use Friendica\Model\Contact;
function update_contact_content(App $a) function update_contact_content(AppHelper $appHelper)
{ {
if (!empty(DI::args()->get(1)) && !empty($_GET['force'])) { if (!empty(DI::args()->get(1)) && !empty($_GET['force'])) {
$contact = DBA::selectFirst('account-user-view', ['pid', 'deleted'], ['id' => DI::args()->get(1)]); $contact = DBA::selectFirst('account-user-view', ['pid', 'deleted'], ['id' => DI::args()->get(1)]);

View file

@ -8,13 +8,12 @@
* AJAX synchronisation of notes page * AJAX synchronisation of notes page
*/ */
use Friendica\App; use Friendica\AppHelper;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\DI;
require_once 'mod/notes.php'; require_once 'mod/notes.php';
function update_notes_content(App $a) function update_notes_content(AppHelper $appHelper)
{ {
$profile_uid = intval($_GET['p']); $profile_uid = intval($_GET['p']);
@ -28,7 +27,7 @@ function update_notes_content(App $a)
* *
*/ */
$text = notes_content($a, $profile_uid); $text = notes_content($appHelper, $profile_uid);
System::htmlUpdateExit($text); System::htmlUpdateExit($text);
} }

View file

@ -503,7 +503,7 @@ class App implements AppHelper
} }
if (!$this->mode->isBackend()) { if (!$this->mode->isBackend()) {
$auth->withSession($this); $auth->withSession();
} }
if ($this->session->isUnauthenticated()) { if ($this->session->isUnauthenticated()) {

View file

@ -11,6 +11,7 @@ use ArrayAccess;
use DOMDocument; use DOMDocument;
use DOMXPath; use DOMXPath;
use Friendica\App; use Friendica\App;
use Friendica\AppHelper;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook; use Friendica\Core\Hook;
@ -21,7 +22,6 @@ use Friendica\Core\Renderer;
use Friendica\Core\Session\Model\UserSession; use Friendica\Core\Session\Model\UserSession;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Theme; use Friendica\Core\Theme;
use Friendica\Module\Response;
use Friendica\Network\HTTPException; use Friendica\Network\HTTPException;
use Friendica\Util\Images; use Friendica\Util\Images;
use Friendica\Util\Network; use Friendica\Util\Network;
@ -176,17 +176,22 @@ class Page implements ArrayAccess
* - Infinite scroll data * - Infinite scroll data
* - head.tpl template * - head.tpl template
* *
* @param App $app The Friendica App instance * @param Arguments $args The Friendica App Arguments
* @param Arguments $args The Friendica App Arguments * @param L10n $l10n The l10n language instance
* @param L10n $l10n The l10n language instance * @param IManageConfigValues $config The Friendica configuration
* @param IManageConfigValues $config The Friendica configuration * @param IManagePersonalConfigValues $pConfig The Friendica personal configuration (for user)
* @param IManagePersonalConfigValues $pConfig The Friendica personal configuration (for user) * @param int $localUID The local user id
* @param int $localUID The local user id
* *
* @throws HTTPException\InternalServerErrorException * @throws HTTPException\InternalServerErrorException
*/ */
private function initHead(App $app, Arguments $args, L10n $l10n, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, int $localUID) private function initHead(
{ AppHelper $appHelper,
Arguments $args,
L10n $l10n,
IManageConfigValues $config,
IManagePersonalConfigValues $pConfig,
int $localUID
) {
$interval = ($localUID ? $pConfig->get($localUID, 'system', 'update_interval') : 40000); $interval = ($localUID ? $pConfig->get($localUID, 'system', 'update_interval') : 40000);
// If the update is 'deactivated' set it to the highest integer number (~24 days) // If the update is 'deactivated' set it to the highest integer number (~24 days)
@ -209,7 +214,7 @@ class Page implements ArrayAccess
if (!empty(Renderer::$theme['stylesheet'])) { if (!empty(Renderer::$theme['stylesheet'])) {
$stylesheet = Renderer::$theme['stylesheet']; $stylesheet = Renderer::$theme['stylesheet'];
} else { } else {
$stylesheet = $app->getCurrentThemeStylesheetPath(); $stylesheet = $appHelper->getCurrentThemeStylesheetPath();
} }
$this->registerStylesheet($stylesheet); $this->registerStylesheet($stylesheet);
@ -313,7 +318,6 @@ class Page implements ArrayAccess
* - Registered footer scripts (through App->registerFooterScript()) * - Registered footer scripts (through App->registerFooterScript())
* - footer.tpl template * - footer.tpl template
* *
* @param App $app The Friendica App instance
* @param Mode $mode The Friendica runtime mode * @param Mode $mode The Friendica runtime mode
* @param L10n $l10n The l10n instance * @param L10n $l10n The l10n instance
* *
@ -399,23 +403,34 @@ class Page implements ArrayAccess
/** /**
* Executes the creation of the current page and prints it to the screen * Executes the creation of the current page and prints it to the screen
* *
* @param App $app The Friendica App * @param BaseURL $baseURL The Friendica Base URL
* @param BaseURL $baseURL The Friendica Base URL * @param Arguments $args The Friendica App arguments
* @param Arguments $args The Friendica App arguments * @param Mode $mode The current node mode
* @param Mode $mode The current node mode * @param ResponseInterface $response The Response of the module class, including type, content & headers
* @param ResponseInterface $response The Response of the module class, including type, content & headers * @param L10n $l10n The l10n language class
* @param L10n $l10n The l10n language class
* @param Profiler $profiler * @param Profiler $profiler
* @param IManageConfigValues $config The Configuration of this node * @param IManageConfigValues $config The Configuration of this node
* @param IManagePersonalConfigValues $pconfig The personal/user configuration * @param IManagePersonalConfigValues $pconfig The personal/user configuration
* @param Nav $nav * @param Nav $nav
* @param int $localUID * @param int $localUID
* @throws HTTPException\MethodNotAllowedException * @throws HTTPException\MethodNotAllowedException
* @throws HTTPException\InternalServerErrorException * @throws HTTPException\InternalServerErrorException
* @throws HTTPException\ServiceUnavailableException * @throws HTTPException\ServiceUnavailableException
*/ */
public function run(App $app, UserSession $session, BaseURL $baseURL, Arguments $args, Mode $mode, ResponseInterface $response, L10n $l10n, Profiler $profiler, IManageConfigValues $config, IManagePersonalConfigValues $pconfig, Nav $nav, int $localUID) public function run(
{ AppHelper $appHelper,
UserSession $session,
BaseURL $baseURL,
Arguments $args,
Mode $mode,
ResponseInterface $response,
L10n $l10n,
Profiler $profiler,
IManageConfigValues $config,
IManagePersonalConfigValues $pconfig,
Nav $nav,
int $localUID
) {
$moduleName = $args->getModuleName(); $moduleName = $args->getModuleName();
$this->command = $moduleName; $this->command = $moduleName;
@ -430,7 +445,7 @@ class Page implements ArrayAccess
$this->initContent($response, $mode); $this->initContent($response, $mode);
// Load current theme info after module has been initialized as theme could have been set in module // Load current theme info after module has been initialized as theme could have been set in module
$currentTheme = $app->getCurrentTheme(); $currentTheme = $appHelper->getCurrentTheme();
$theme_info_file = 'view/theme/' . $currentTheme . '/theme.php'; $theme_info_file = 'view/theme/' . $currentTheme . '/theme.php';
if (file_exists($theme_info_file)) { if (file_exists($theme_info_file)) {
require_once $theme_info_file; require_once $theme_info_file;
@ -438,7 +453,7 @@ class Page implements ArrayAccess
if (function_exists(str_replace('-', '_', $currentTheme) . '_init')) { if (function_exists(str_replace('-', '_', $currentTheme) . '_init')) {
$func = str_replace('-', '_', $currentTheme) . '_init'; $func = str_replace('-', '_', $currentTheme) . '_init';
$func($app); $func($appHelper);
} }
/* Create the page head after setting the language /* Create the page head after setting the language
@ -448,7 +463,7 @@ class Page implements ArrayAccess
* all the module functions have executed so that all * all the module functions have executed so that all
* theme choices made by the modules can take effect. * theme choices made by the modules can take effect.
*/ */
$this->initHead($app, $args, $l10n, $config, $pconfig, $localUID); $this->initHead($appHelper, $args, $l10n, $config, $pconfig, $localUID);
/* Build the page ending -- this is stuff that goes right before /* Build the page ending -- this is stuff that goes right before
* the closing </body> tag * the closing </body> tag
@ -534,7 +549,7 @@ class Page implements ArrayAccess
} }
// Theme templates expect $a as an App instance // Theme templates expect $a as an App instance
$a = $app; $a = $appHelper;
// Used as is in view/php/default.php // Used as is in view/php/default.php
$lang = $l10n->getCurrentLang(); $lang = $l10n->getCurrentLang();

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\AppHelper;
/** /**
* When I installed docblox, I had the experience that it does not generate any output at all. * When I installed docblox, I had the experience that it does not generate any output at all.
@ -33,14 +33,14 @@ class DocBloxErrorChecker extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?']; protected $helpOptions = ['h', 'help', '?'];
/** @var App */ /** @var string */
private $app; private $basePath;
public function __construct(App $app, array $argv = null) public function __construct(AppHelper $appHelper, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);
$this->app = $app; $this->basePath = $appHelper->getBasePath();
} }
protected function getHelp() protected function getHelp()
@ -73,7 +73,7 @@ HELP;
throw new \RuntimeException('DocBlox isn\'t available.'); throw new \RuntimeException('DocBlox isn\'t available.');
} }
$dir = $this->app->getBasePath(); $dir = $this->basePath;
//stack for dirs to search //stack for dirs to search
$dirstack = []; $dirstack = [];

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

@ -7,7 +7,8 @@
namespace Friendica\Console; namespace Friendica\Console;
use Friendica\App; use Friendica\AppHelper;
use stdClass;
/** /**
* Read a strings.php file and create messages.po in the same directory * Read a strings.php file and create messages.po in the same directory
@ -20,14 +21,14 @@ class PhpToPo extends \Asika\SimpleConsole\Console
private $normBaseMsgIds = []; private $normBaseMsgIds = [];
const NORM_REGEXP = "|[\\\]|"; const NORM_REGEXP = "|[\\\]|";
/** @var App */ /** @var AppHelper */
private $app; private $appHelper;
public function __construct(App $app, array $argv = null) public function __construct(AppHelper $appHelper, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);
$this->app = $app; $this->appHelper = $appHelper;
} }
protected function getHelp() protected function getHelp()
@ -66,7 +67,8 @@ HELP;
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments'); throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
} }
$a = $this->app; $a = new stdClass();
$a->strings = [];
$phpfile = realpath($this->getArgument(0)); $phpfile = realpath($this->getArgument(0));

View file

@ -7,10 +7,11 @@
namespace Friendica\Console; namespace Friendica\Console;
use Friendica\App; use Friendica\App\Mode;
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs; use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Update; use Friendica\Core\Update;
use Friendica\DI;
/** /**
* Performs database post updates * Performs database post updates
@ -20,7 +21,7 @@ class PostUpdate extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?']; protected $helpOptions = ['h', 'help', '?'];
/** /**
* @var App\Mode * @var Mode
*/ */
private $appMode; private $appMode;
/** /**
@ -31,6 +32,10 @@ class PostUpdate extends \Asika\SimpleConsole\Console
* @var L10n * @var L10n
*/ */
private $l10n; private $l10n;
/**
* @var string
*/
private $basePath;
protected function getHelp() protected function getHelp()
{ {
@ -46,19 +51,18 @@ HELP;
return $help; return $help;
} }
public function __construct(App\Mode $appMode, IManageKeyValuePairs $keyValue, L10n $l10n, array $argv = null) public function __construct(Mode $appMode, IManageKeyValuePairs $keyValue, L10n $l10n, array $argv = null)
{ {
parent::__construct($argv); parent::__construct($argv);
$this->appMode = $appMode; $this->appMode = $appMode;
$this->keyValue = $keyValue; $this->keyValue = $keyValue;
$this->l10n = $l10n; $this->l10n = $l10n;
$this->basePath = DI::appHelper()->getBasePath();
} }
protected function doExecute(): int protected function doExecute(): int
{ {
$a = \Friendica\DI::app();
if ($this->getOption($this->helpOptions)) { if ($this->getOption($this->helpOptions)) {
$this->out($this->getHelp()); $this->out($this->getHelp());
return 0; return 0;
@ -79,7 +83,7 @@ HELP;
} }
echo $this->l10n->t('Check for pending update actions.') . "\n"; echo $this->l10n->t('Check for pending update actions.') . "\n";
Update::run($a->getBasePath(), true, false, true, false); Update::run($this->basePath, true, false, true, false);
echo $this->l10n->t('Done.') . "\n"; echo $this->l10n->t('Done.') . "\n";
echo $this->l10n->t('Execute pending post updates.') . "\n"; echo $this->l10n->t('Execute pending post updates.') . "\n";

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,9 +7,11 @@
namespace Friendica\Content; namespace Friendica\Content;
use Friendica\App;
use Friendica\App\Arguments; use Friendica\App\Arguments;
use Friendica\App\BaseURL; use Friendica\App\BaseURL;
use Friendica\App\Mode;
use Friendica\App\Page;
use Friendica\AppHelper;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\ACL; use Friendica\Core\ACL;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
@ -32,8 +34,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Object\Post as PostObject; use Friendica\Object\Post as PostObject;
use Friendica\Object\Thread; use Friendica\Object\Thread;
use Friendica\Protocol\Activity; use Friendica\Protocol\Activity;
use Friendica\User\Settings\Entity\UserGServer; use Friendica\User\Settings\Repository\UserGServer;
use Friendica\User\Settings\Repository;
use Friendica\Util\Crypto; use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat; use Friendica\Util\DateTimeFormat;
use Friendica\Util\Profiler; use Friendica\Util\Profiler;
@ -64,7 +65,7 @@ class Conversation
private $logger; private $logger;
/** @var Item */ /** @var Item */
private $item; private $item;
/** @var App\Arguments */ /** @var Arguments */
private $args; private $args;
/** @var IManagePersonalConfigValues */ /** @var IManagePersonalConfigValues */
private $pConfig; private $pConfig;
@ -72,18 +73,18 @@ class Conversation
private $baseURL; private $baseURL;
/** @var IManageConfigValues */ /** @var IManageConfigValues */
private $config; private $config;
/** @var App */ /** @var AppHelper */
private $app; private $appHelper;
/** @var App\Page */ /** @var Page */
private $page; private $page;
/** @var App\Mode */ /** @var Mode */
private $mode; private $mode;
/** @var IHandleUserSessions */ /** @var IHandleUserSessions */
private $session; private $session;
/** @var Repository\UserGServer */ /** @var UserGServer */
private $userGServer; private $userGServer;
public function __construct(Repository\UserGServer $userGServer, LoggerInterface $logger, Profiler $profiler, Activity $activity, L10n $l10n, Item $item, Arguments $args, BaseURL $baseURL, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, App\Page $page, App\Mode $mode, App $app, IHandleUserSessions $session) public function __construct(UserGServer $userGServer, LoggerInterface $logger, Profiler $profiler, Activity $activity, L10n $l10n, Item $item, Arguments $args, BaseURL $baseURL, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, Page $page, Mode $mode, AppHelper $appHelper, IHandleUserSessions $session)
{ {
$this->activity = $activity; $this->activity = $activity;
$this->item = $item; $this->item = $item;
@ -96,7 +97,7 @@ class Conversation
$this->args = $args; $this->args = $args;
$this->pConfig = $pConfig; $this->pConfig = $pConfig;
$this->page = $page; $this->page = $page;
$this->app = $app; $this->appHelper = $appHelper;
$this->session = $session; $this->session = $session;
$this->userGServer = $userGServer; $this->userGServer = $userGServer;
} }
@ -1017,7 +1018,7 @@ class Conversation
$emojis[$count['uri-id']][$count['reaction']]['title'] = []; $emojis[$count['uri-id']][$count['reaction']]['title'] = [];
} }
// @todo The following code should be removed, once that we display activity authors on demand // @todo The following code should be removed, once that we display activity authors on demand
$activity_verbs = [ $activity_verbs = [
Activity::LIKE, Activity::LIKE,
Activity::DISLIKE, Activity::DISLIKE,

View file

@ -7,8 +7,8 @@
namespace Friendica\Content; namespace Friendica\Content;
use Friendica\App;
use Friendica\App\BaseURL; use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\BBCode\Video; use Friendica\Content\Text\BBCode\Video;
use Friendica\Content\Text\HTML; use Friendica\Content\Text\HTML;
@ -66,10 +66,10 @@ class Item
private $baseURL; private $baseURL;
/** @var Emailer */ /** @var Emailer */
private $emailer; private $emailer;
/** @var App */ /** @var AppHelper */
private $app; private $appHelper;
public function __construct(Profiler $profiler, Activity $activity, L10n $l10n, IHandleUserSessions $userSession, Video $bbCodeVideo, ACLFormatter $aclFormatter, IManagePersonalConfigValues $pConfig, BaseURL $baseURL, Emailer $emailer, App $app) public function __construct(Profiler $profiler, Activity $activity, L10n $l10n, IHandleUserSessions $userSession, Video $bbCodeVideo, ACLFormatter $aclFormatter, IManagePersonalConfigValues $pConfig, BaseURL $baseURL, Emailer $emailer, AppHelper $appHelper)
{ {
$this->profiler = $profiler; $this->profiler = $profiler;
$this->activity = $activity; $this->activity = $activity;
@ -80,7 +80,7 @@ class Item
$this->baseURL = $baseURL; $this->baseURL = $baseURL;
$this->pConfig = $pConfig; $this->pConfig = $pConfig;
$this->emailer = $emailer; $this->emailer = $emailer;
$this->app = $app; $this->appHelper = $appHelper;
} }
/** /**

View file

@ -48,11 +48,11 @@ class OEmbed
{ {
$embedurl = trim($embedurl, '\'"'); $embedurl = trim($embedurl, '\'"');
$a = DI::app(); $appHelper = DI::appHelper();
$cache_key = 'oembed:' . $a->getThemeInfoValue('videowidth') . ':' . $embedurl; $cache_key = 'oembed:' . $appHelper->getThemeInfoValue('videowidth') . ':' . $embedurl;
$condition = ['url' => Strings::normaliseLink($embedurl), 'maxwidth' => $a->getThemeInfoValue('videowidth')]; $condition = ['url' => Strings::normaliseLink($embedurl), 'maxwidth' => $appHelper->getThemeInfoValue('videowidth')];
$oembed_record = DBA::selectFirst('oembed', ['content'], $condition); $oembed_record = DBA::selectFirst('oembed', ['content'], $condition);
if (DBA::isResult($oembed_record)) { if (DBA::isResult($oembed_record)) {
$json_string = $oembed_record['content']; $json_string = $oembed_record['content'];
@ -88,7 +88,7 @@ class OEmbed
// but their OEmbed endpoint is only accessible by HTTPS ¯\_(ツ)_/¯ // but their OEmbed endpoint is only accessible by HTTPS ¯\_(ツ)_/¯
$href = str_replace(['http://www.youtube.com/', 'http://player.vimeo.com/'], $href = str_replace(['http://www.youtube.com/', 'http://player.vimeo.com/'],
['https://www.youtube.com/', 'https://player.vimeo.com/'], $href); ['https://www.youtube.com/', 'https://player.vimeo.com/'], $href);
$result = DI::httpClient()->get($href . '&maxwidth=' . $a->getThemeInfoValue('videowidth'), HttpClientAccept::DEFAULT, [HttpClientOptions::REQUEST => HttpClientRequest::SITEINFO]); $result = DI::httpClient()->get($href . '&maxwidth=' . $appHelper->getThemeInfoValue('videowidth'), HttpClientAccept::DEFAULT, [HttpClientOptions::REQUEST => HttpClientRequest::SITEINFO]);
if ($result->isSuccess()) { if ($result->isSuccess()) {
$json_string = $result->getBodyString(); $json_string = $result->getBodyString();
break; break;
@ -109,7 +109,7 @@ class OEmbed
if (!empty($oembed->type) && $oembed->type != 'error') { if (!empty($oembed->type) && $oembed->type != 'error') {
DBA::insert('oembed', [ DBA::insert('oembed', [
'url' => Strings::normaliseLink($embedurl), 'url' => Strings::normaliseLink($embedurl),
'maxwidth' => $a->getThemeInfoValue('videowidth'), 'maxwidth' => $appHelper->getThemeInfoValue('videowidth'),
'content' => $json_string, 'content' => $json_string,
'created' => DateTimeFormat::utcNow() 'created' => DateTimeFormat::utcNow()
], Database::INSERT_UPDATE); ], Database::INSERT_UPDATE);

View file

@ -1630,7 +1630,7 @@ class BBCode
private static function convertStylesToHtml(string $text, int $simple_html): string private static function convertStylesToHtml(string $text, int $simple_html): string
{ {
// Markdown is designed to pass through HTML elements that it can't handle itself, // Markdown is designed to pass through HTML elements that it can't handle itself,
// so that the other system would parse the original HTML element. // so that the other system would parse the original HTML element.
// But Diaspora has chosen not to do this and doesn't parse HTML elements. // But Diaspora has chosen not to do this and doesn't parse HTML elements.
// So we need to make some changes here. // So we need to make some changes here.
if ($simple_html == BBCode::DIASPORA) { if ($simple_html == BBCode::DIASPORA) {
@ -1926,19 +1926,20 @@ class BBCode
private static function convertVideoPlatformsToHtml(string $text, bool $try_oembed): string private static function convertVideoPlatformsToHtml(string $text, bool $try_oembed): string
{ {
$a = DI::app(); $appHelper = DI::appHelper();
$text = self::normalizeVideoLinks($text); $text = self::normalizeVideoLinks($text);
// Youtube extensions // Youtube extensions
if ($try_oembed && OEmbed::isAllowedURL('https://www.youtube.com/embed/')) { if ($try_oembed && OEmbed::isAllowedURL('https://www.youtube.com/embed/')) {
$text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '<iframe width="' . $a->getThemeInfoValue('videowidth') . '" height="' . $a->getThemeInfoValue('videoheight') . '" src="https://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $text); $text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '<iframe width="' . $appHelper->getThemeInfoValue('videowidth') . '" height="' . $appHelper->getThemeInfoValue('videoheight') . '" src="https://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $text);
} else { } else {
$text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '[url]https://www.youtube.com/watch?v=$1[/url]', $text); $text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '[url]https://www.youtube.com/watch?v=$1[/url]', $text);
} }
// Vimeo extensions // Vimeo extensions
if ($try_oembed && OEmbed::isAllowedURL('https://player.vimeo.com/video')) { if ($try_oembed && OEmbed::isAllowedURL('https://player.vimeo.com/video')) {
$text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '<iframe width="' . $a->getThemeInfoValue('videowidth') . '" height="' . $a->getThemeInfoValue('videoheight') . '" src="https://player.vimeo.com/video/$1" frameborder="0" ></iframe>', $text); $text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '<iframe width="' . $appHelper->getThemeInfoValue('videowidth') . '" height="' . $appHelper->getThemeInfoValue('videoheight') . '" src="https://player.vimeo.com/video/$1" frameborder="0" ></iframe>', $text);
} else { } else {
$text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '[url]https://vimeo.com/$1[/url]', $text); $text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '[url]https://vimeo.com/$1[/url]', $text);
} }

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;
@ -81,7 +80,7 @@ class Hook
*/ */
public static function register(string $hook, string $file, string $function, int $priority = 0) public static function register(string $hook, string $file, string $function, int $priority = 0)
{ {
$file = str_replace(DI::app()->getBasePath() . DIRECTORY_SEPARATOR, '', $file); $file = str_replace(DI::appHelper()->getBasePath() . DIRECTORY_SEPARATOR, '', $file);
$condition = ['hook' => $hook, 'file' => $file, 'function' => $function]; $condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
if (DBA::exists('hook', $condition)) { if (DBA::exists('hook', $condition)) {
@ -102,7 +101,7 @@ class Hook
*/ */
public static function unregister(string $hook, string $file, string $function): bool public static function unregister(string $hook, string $file, string $function): bool
{ {
$relative_file = str_replace(DI::app()->getBasePath() . DIRECTORY_SEPARATOR, '', $file); $relative_file = str_replace(DI::appHelper()->getBasePath() . DIRECTORY_SEPARATOR, '', $file);
// This here is only needed for fixing a problem that existed on the develop branch // This here is only needed for fixing a problem that existed on the develop branch
$condition = ['hook' => $hook, 'file' => $file, 'function' => $function]; $condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
@ -198,7 +197,7 @@ class Hook
public static function callSingle(string $name, array $hook, &$data = null) public static function callSingle(string $name, array $hook, &$data = null)
{ {
// Don't run a theme's hook if the user isn't using the theme // Don't run a theme's hook if the user isn't using the theme
if (strpos($hook[0], 'view/theme/') !== false && strpos($hook[0], 'view/theme/' . DI::app()->getCurrentTheme()) === false) { if (strpos($hook[0], 'view/theme/') !== false && strpos($hook[0], 'view/theme/' . DI::appHelper()->getCurrentTheme()) === false) {
return; return;
} }

View file

@ -155,9 +155,9 @@ class Renderer
if (isset(self::$template_engine_instance[$template_engine])) { if (isset(self::$template_engine_instance[$template_engine])) {
return self::$template_engine_instance[$template_engine]; return self::$template_engine_instance[$template_engine];
} else { } else {
$a = DI::app(); $appHelper = DI::appHelper();
$class = self::$template_engines[$template_engine]; $class = self::$template_engines[$template_engine];
$obj = new $class($a->getCurrentTheme(), $a->getThemeInfo()); $obj = new $class($appHelper->getCurrentTheme(), $appHelper->getThemeInfo());
self::$template_engine_instance[$template_engine] = $obj; self::$template_engine_instance[$template_engine] = $obj;
return $obj; return $obj;
} }

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

@ -208,11 +208,11 @@ class Theme
*/ */
public static function getPathForFile(string $file): string public static function getPathForFile(string $file): string
{ {
$a = DI::app(); $appHelper = DI::appHelper();
$theme = $a->getCurrentTheme(); $theme = $appHelper->getCurrentTheme();
$parent = Strings::sanitizeFilePathItem($a->getThemeInfoValue('extends', $theme)); $parent = Strings::sanitizeFilePathItem($appHelper->getThemeInfoValue('extends', $theme));
$paths = [ $paths = [
"view/theme/$theme/$file", "view/theme/$theme/$file",
@ -245,11 +245,11 @@ class Theme
return 'view/theme/' . $theme . '/style.css'; return 'view/theme/' . $theme . '/style.css';
} }
$a = DI::app(); $appHelper = DI::appHelper();
$query_params = []; $query_params = [];
$puid = Profile::getThemeUid($a); $puid = Profile::getThemeUid($appHelper);
if ($puid) { if ($puid) {
$query_params['puid'] = $puid; $query_params['puid'] = $puid;
} }
@ -267,8 +267,8 @@ class Theme
{ {
$theme = Strings::sanitizeFilePathItem($theme); $theme = Strings::sanitizeFilePathItem($theme);
$a = DI::app(); $appHelper = DI::appHelper();
$base_theme = $a->getThemeInfoValue('extends') ?? ''; $base_theme = $appHelper->getThemeInfoValue('extends') ?? '';
if (file_exists("view/theme/$theme/config.php")) { if (file_exists("view/theme/$theme/config.php")) {
return "view/theme/$theme/config.php"; return "view/theme/$theme/config.php";

View file

@ -67,7 +67,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

@ -533,7 +533,7 @@ class Worker
*/ */
private static function execFunction(array $queue, string $funcname, array $argv, bool $method_call) private static function execFunction(array $queue, string $funcname, array $argv, bool $method_call)
{ {
$a = DI::app(); $appHelper = DI::appHelper();
self::coolDown(); self::coolDown();
@ -547,7 +547,7 @@ class Worker
// For this reason the variables have to be initialized. // For this reason the variables have to be initialized.
DI::profiler()->reset(); DI::profiler()->reset();
$a->setQueue($queue); $appHelper->setQueue($queue);
$up_duration = microtime(true) - self::$up_start; $up_duration = microtime(true) - self::$up_start;
@ -571,7 +571,7 @@ class Worker
Logger::disableWorker(); Logger::disableWorker();
$a->setQueue([]); $appHelper->setQueue([]);
$duration = (microtime(true) - $stamp); $duration = (microtime(true) - $stamp);
@ -830,7 +830,7 @@ class Worker
return false; return false;
} elseif ($max_idletime > 0) { } elseif ($max_idletime > 0) {
Logger::debug('Maximum idletime not reached.', ['last' => $last_check, 'last-check' => $last_date, 'seconds' => $max_idletime, 'load' => $load, 'max_load' => $maxsysload, 'active_worker' => $active, 'max_worker' => $maxqueues]); Logger::debug('Maximum idletime not reached.', ['last' => $last_check, 'last-check' => $last_date, 'seconds' => $max_idletime, 'load' => $load, 'max_load' => $maxsysload, 'active_worker' => $active, 'max_worker' => $maxqueues]);
} }
} }
} }
@ -1371,20 +1371,20 @@ class Worker
*/ */
public static function getRetrial(): int public static function getRetrial(): int
{ {
$queue = DI::app()->getQueue(); $queue = DI::appHelper()->getQueue();
return $queue['retrial'] ?? 0; return $queue['retrial'] ?? 0;
} }
/** /**
* Defers the current worker entry * Defers the current worker entry
* *
* @param int $worker_defer_limit Maximum defer limit * @param int $worker_defer_limit Maximum defer limit
* @return boolean had the entry been deferred? * @return boolean had the entry been deferred?
* @throws \Exception * @throws \Exception
*/ */
public static function defer(int $worker_defer_limit = 0): bool public static function defer(int $worker_defer_limit = 0): bool
{ {
$queue = DI::app()->getQueue(); $queue = DI::appHelper()->getQueue();
if (empty($queue)) { if (empty($queue)) {
return false; return false;

View file

@ -3348,7 +3348,7 @@ class Item
*/ */
public static function prepareBody(array &$item, bool $attach = false, bool $is_preview = false, bool $only_cache = false): string public static function prepareBody(array &$item, bool $attach = false, bool $is_preview = false, bool $only_cache = false): string
{ {
$a = DI::app(); $appHelper = DI::appHelper();
$uid = DI::userSession()->getLocalUserId(); $uid = DI::userSession()->getLocalUserId();
Hook::callAll('prepare_body_init', $item); Hook::callAll('prepare_body_init', $item);
@ -3522,8 +3522,8 @@ class Item
} }
// Replace friendica image url size with theme preference. // Replace friendica image url size with theme preference.
if (!empty($a->getThemeInfoValue('item_image_size'))) { if (!empty($appHelper->getThemeInfoValue('item_image_size'))) {
$ps = $a->getThemeInfoValue('item_image_size'); $ps = $appHelper->getThemeInfoValue('item_image_size');
$s = preg_replace('|(<img[^>]+src="[^"]+/photo/[0-9a-f]+)-[0-9]|', "$1-" . $ps, $s); $s = preg_replace('|(<img[^>]+src="[^"]+/photo/[0-9a-f]+)-[0-9]|', "$1-" . $ps, $s);
} }

View file

@ -7,8 +7,8 @@
namespace Friendica\Model; namespace Friendica\Model;
use Friendica\App;
use Friendica\App\Mode; use Friendica\App\Mode;
use Friendica\AppHelper;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Content\Widget\ContactBlock; use Friendica\Content\Widget\ContactBlock;
use Friendica\Core\Cache\Enum\Duration; use Friendica\Core\Cache\Enum\Duration;
@ -190,7 +190,6 @@ class Profile
* the theme is chosen before the _init() function of a theme is run, which will usually * the theme is chosen before the _init() function of a theme is run, which will usually
* load a lot of theme-specific content * load a lot of theme-specific content
* *
* @param App $a
* @param string $nickname string * @param string $nickname string
* @param bool $show_contacts * @param bool $show_contacts
* *
@ -199,7 +198,7 @@ class Profile
* @throws HTTPException\InternalServerErrorException * @throws HTTPException\InternalServerErrorException
* @throws \ImagickException * @throws \ImagickException
*/ */
public static function load(App $a, string $nickname, bool $show_contacts = true): array public static function load(AppHelper $appHelper, string $nickname, bool $show_contacts = true): array
{ {
$profile = User::getOwnerDataByNick($nickname); $profile = User::getOwnerDataByNick($nickname);
if (!isset($profile['account_removed']) || $profile['account_removed']) { if (!isset($profile['account_removed']) || $profile['account_removed']) {
@ -213,13 +212,13 @@ class Profile
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.')); throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
} }
$a->setProfileOwner($profile['uid']); $appHelper->setProfileOwner($profile['uid']);
DI::page()['title'] = $profile['name'] . ' @ ' . DI::config()->get('config', 'sitename'); DI::page()['title'] = $profile['name'] . ' @ ' . DI::config()->get('config', 'sitename');
if (!DI::userSession()->getLocalUserId()) { if (!DI::userSession()->getLocalUserId()) {
$a->setCurrentTheme($profile['theme']); $appHelper->setCurrentTheme($profile['theme']);
$a->setCurrentMobileTheme(DI::pConfig()->get($a->getProfileOwner(), 'system', 'mobile_theme') ?? ''); $appHelper->setCurrentMobileTheme(DI::pConfig()->get($appHelper->getProfileOwner(), 'system', 'mobile_theme') ?? '');
} }
/* /*
@ -228,7 +227,7 @@ class Profile
Renderer::setActiveTemplateEngine(); // reset the template engine to the default in case the user's theme doesn't specify one Renderer::setActiveTemplateEngine(); // reset the template engine to the default in case the user's theme doesn't specify one
$theme_info_file = 'view/theme/' . $a->getCurrentTheme() . '/theme.php'; $theme_info_file = 'view/theme/' . $appHelper->getCurrentTheme() . '/theme.php';
if (file_exists($theme_info_file)) { if (file_exists($theme_info_file)) {
require_once $theme_info_file; require_once $theme_info_file;
} }
@ -687,15 +686,13 @@ class Profile
* settings take precedence; unless a local user is logged in which means they don't * settings take precedence; unless a local user is logged in which means they don't
* want to see anybody else's theme settings except their own while on this site. * want to see anybody else's theme settings except their own while on this site.
* *
* @param App $a
*
* @return int user ID * @return int user ID
* *
* @note Returns local_user instead of user ID if "always_my_theme" is set to true * @note Returns local_user instead of user ID if "always_my_theme" is set to true
*/ */
public static function getThemeUid(App $a): int public static function getThemeUid(AppHelper $appHelper): int
{ {
return DI::userSession()->getLocalUserId() ?: $a->getProfileOwner(); return DI::userSession()->getLocalUserId() ?: $appHelper->getProfileOwner();
} }
/** /**

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

@ -29,7 +29,7 @@ class Summary extends BaseAdmin
{ {
parent::content(); parent::content();
$a = DI::app(); $basePath = DI::appHelper()->getBasePath();
// are there MyISAM tables in the DB? If so, trigger a warning message // are there MyISAM tables in the DB? If so, trigger a warning message
$warningtext = []; $warningtext = [];
@ -116,7 +116,7 @@ class Summary extends BaseAdmin
} }
// check legacy basepath settings // check legacy basepath settings
$configLoader = (new Config())->createConfigFileManager($a->getBasePath(), $_SERVER); $configLoader = (new Config())->createConfigFileManager($basePath, $_SERVER);
$configCache = new Cache(); $configCache = new Cache();
$configLoader->setupCache($configCache); $configLoader->setupCache($configCache);
$confBasepath = $configCache->get('system', 'basepath'); $confBasepath = $configCache->get('system', 'basepath');

View file

@ -7,7 +7,10 @@
namespace Friendica\Module\Admin\Themes; namespace Friendica\Module\Admin\Themes;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Mode;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\DI; use Friendica\DI;
@ -19,21 +22,21 @@ use Psr\Log\LoggerInterface;
class Embed extends BaseAdmin class Embed extends BaseAdmin
{ {
/** @var App */ /** @var AppHelper */
protected $app; protected $appHelper;
/** @var App\Mode */ /** @var Mode */
protected $mode; protected $mode;
public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, App\Mode $mode, array $server, array $parameters = []) public function __construct(AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Mode $mode, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->app = $app; $this->appHelper = $appHelper;
$this->mode = $mode; $this->mode = $mode;
$theme = Strings::sanitizeFilePathItem($this->parameters['theme']); $theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
if (is_file("view/theme/$theme/config.php")) { if (is_file("view/theme/$theme/config.php")) {
$this->app->setCurrentTheme($theme); $this->appHelper->setCurrentTheme($theme);
} }
} }
@ -46,7 +49,7 @@ class Embed extends BaseAdmin
require_once "view/theme/$theme/config.php"; require_once "view/theme/$theme/config.php";
if (function_exists('theme_admin_post')) { if (function_exists('theme_admin_post')) {
self::checkFormSecurityTokenRedirectOnError('/admin/themes/' . $theme . '/embed?mode=minimal', 'admin_theme_settings'); self::checkFormSecurityTokenRedirectOnError('/admin/themes/' . $theme . '/embed?mode=minimal', 'admin_theme_settings');
theme_admin_post($this->app); theme_admin_post($this->appHelper);
} }
} }
@ -72,7 +75,7 @@ class Embed extends BaseAdmin
require_once "view/theme/$theme/config.php"; require_once "view/theme/$theme/config.php";
if (function_exists('theme_admin')) { if (function_exists('theme_admin')) {
$admin_form = theme_admin($this->app); $admin_form = theme_admin($this->appHelper);
} }
} }

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Friendica\DirectMessages; namespace Friendica\Module\Api\Friendica\DirectMessages;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Database\DBA; use Friendica\Database\DBA;
@ -30,9 +32,9 @@ class Search extends BaseApi
/** @var DirectMessage */ /** @var DirectMessage */
private $directMessage; private $directMessage;
public function __construct(DirectMessage $directMessage, Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(DirectMessage $directMessage, Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->dba = $dba; $this->dba = $dba;
$this->directMessage = $directMessage; $this->directMessage = $directMessage;

View file

@ -59,11 +59,11 @@ class Create extends BaseApi
$finish = DBA::NULL_DATETIME; $finish = DBA::NULL_DATETIME;
$nofinish = true; $nofinish = true;
} else { } else {
$finish = DateTimeFormat::convert($request['end_time'], 'UTC', DI::app()->getTimeZone()); $finish = DateTimeFormat::convert($request['end_time'], 'UTC', DI::appHelper()->getTimeZone());
$nofinish = false; $nofinish = false;
} }
$start = DateTimeFormat::convert($request['start_time'], 'UTC', DI::app()->getTimeZone()); $start = DateTimeFormat::convert($request['start_time'], 'UTC', DI::appHelper()->getTimeZone());
// create event // create event
$event = []; $event = [];

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Friendica; namespace Friendica\Module\Api\Friendica;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto; use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
use Friendica\Module\BaseApi; use Friendica\Module\BaseApi;
@ -23,9 +25,9 @@ class Photo extends BaseApi
private $friendicaPhoto; private $friendicaPhoto;
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->friendicaPhoto = $friendicaPhoto; $this->friendicaPhoto = $friendicaPhoto;
} }

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Friendica\Photo; namespace Friendica\Module\Api\Friendica\Photo;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\ACL; use Friendica\Core\ACL;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto; use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
@ -27,9 +29,9 @@ class Create extends BaseApi
private $friendicaPhoto; private $friendicaPhoto;
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->friendicaPhoto = $friendicaPhoto; $this->friendicaPhoto = $friendicaPhoto;
} }

View file

@ -7,9 +7,11 @@
namespace Friendica\Module\Api\Friendica\Photo; namespace Friendica\Module\Api\Friendica\Photo;
use Friendica\Database\DBA; use Friendica\App\Arguments;
use Friendica\App; use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Database\DBA;
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto; use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
use Friendica\Module\BaseApi; use Friendica\Module\BaseApi;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -29,9 +31,9 @@ class Lists extends BaseApi
private $friendicaPhoto; private $friendicaPhoto;
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->friendicaPhoto = $friendicaPhoto; $this->friendicaPhoto = $friendicaPhoto;
} }

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Friendica\Photo; namespace Friendica\Module\Api\Friendica\Photo;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\ACL; use Friendica\Core\ACL;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto; use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
@ -27,9 +29,9 @@ class Update extends BaseApi
private $friendicaPhoto; private $friendicaPhoto;
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->friendicaPhoto = $friendicaPhoto; $this->friendicaPhoto = $friendicaPhoto;
} }

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Friendica\Photoalbum; namespace Friendica\Module\Api\Friendica\Photoalbum;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto; use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -29,9 +31,9 @@ class Show extends BaseApi
private $friendicaPhoto; private $friendicaPhoto;
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->friendicaPhoto = $friendicaPhoto; $this->friendicaPhoto = $friendicaPhoto;
} }

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Mastodon; namespace Friendica\Module\Api\Mastodon;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
@ -37,9 +39,9 @@ class Instance extends BaseApi
/** @var AccountFactory */ /** @var AccountFactory */
private $accountFactory; private $accountFactory;
public function __construct(AccountFactory $accountFactory, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, Database $database, IManageConfigValues $config, array $server, array $parameters = []) public function __construct(AccountFactory $accountFactory, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, Database $database, IManageConfigValues $config, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->database = $database; $this->database = $database;
$this->config = $config; $this->config = $config;

View file

@ -8,7 +8,9 @@
namespace Friendica\Module\Api\Mastodon\Instance; namespace Friendica\Module\Api\Mastodon\Instance;
use DateTime; use DateTime;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Model\User; use Friendica\Model\User;
@ -26,9 +28,9 @@ class ExtendedDescription extends BaseApi
{ {
private IManageConfigValues $config; private IManageConfigValues $config;
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, IManageConfigValues $config, array $server, array $parameters = []) public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, IManageConfigValues $config, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->config = $config; $this->config = $config;
} }

View file

@ -9,6 +9,9 @@ namespace Friendica\Module\Api\Mastodon;
use Exception; use Exception;
use Friendica\App; use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Contact\Header; use Friendica\Contact\Header;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n; use Friendica\Core\L10n;
@ -41,10 +44,10 @@ class InstanceV2 extends BaseApi
public function __construct( public function __construct(
\Friendica\Factory\Api\Mastodon\Error $errorFactory, \Friendica\Factory\Api\Mastodon\Error $errorFactory,
App $app, AppHelper $appHelper,
L10n $l10n, L10n $l10n,
App\BaseURL $baseUrl, BaseURL $baseUrl,
App\Arguments $args, Arguments $args,
LoggerInterface $logger, LoggerInterface $logger,
Profiler $profiler, Profiler $profiler,
ApiResponse $response, ApiResponse $response,
@ -53,7 +56,7 @@ class InstanceV2 extends BaseApi
array $server, array $server,
array $parameters = [] array $parameters = []
) { ) {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->database = $database; $this->database = $database;
$this->config = $config; $this->config = $config;

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Mastodon; namespace Friendica\Module\Api\Mastodon;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\DI; use Friendica\DI;
use Friendica\Content\Conversation\Factory\Channel as ChannelFactory; use Friendica\Content\Conversation\Factory\Channel as ChannelFactory;
@ -29,9 +31,9 @@ class Lists extends BaseApi
/** @var Repository\UserDefinedChannel */ /** @var Repository\UserDefinedChannel */
protected $userDefinedChannel; protected $userDefinedChannel;
public function __construct(Repository\UserDefinedChannel $userDefinedChannel, ChannelFactory $channel, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(Repository\UserDefinedChannel $userDefinedChannel, ChannelFactory $channel, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->channel = $channel; $this->channel = $channel;
$this->userDefinedChannel = $userDefinedChannel; $this->userDefinedChannel = $userDefinedChannel;

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Mastodon; namespace Friendica\Module\Api\Mastodon;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Factory\Api\Mastodon\Error; use Friendica\Factory\Api\Mastodon\Error;
use Friendica\Factory\Api\Mastodon\Subscription as SubscriptionFactory; use Friendica\Factory\Api\Mastodon\Subscription as SubscriptionFactory;
@ -26,9 +28,9 @@ class PushSubscription extends BaseApi
/** @var SubscriptionFactory */ /** @var SubscriptionFactory */
protected $subscriptionFac; protected $subscriptionFac;
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, SubscriptionFactory $subscriptionFac, array $server, array $parameters = []) public function __construct(Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, SubscriptionFactory $subscriptionFac, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->subscriptionFac = $subscriptionFac; $this->subscriptionFac = $subscriptionFac;
} }

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Mastodon; namespace Friendica\Module\Api\Mastodon;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -27,9 +29,9 @@ class Reports extends BaseApi
/** @var \Friendica\Moderation\Repository\Report */ /** @var \Friendica\Moderation\Repository\Report */
private $reportRepo; private $reportRepo;
public function __construct(\Friendica\Moderation\Repository\Report $reportRepo, \Friendica\Moderation\Factory\Report $reportFactory, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(\Friendica\Moderation\Repository\Report $reportRepo, \Friendica\Moderation\Factory\Report $reportFactory, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->reportFactory = $reportFactory; $this->reportFactory = $reportFactory;
$this->reportRepo = $reportRepo; $this->reportRepo = $reportRepo;

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Mastodon\Timelines; namespace Friendica\Module\Api\Mastodon\Timelines;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Database\DBA; use Friendica\Database\DBA;
@ -34,9 +36,9 @@ class ListTimeline extends BaseApi
/** @var Timeline */ /** @var Timeline */
protected $timeline; protected $timeline;
public function __construct(Timeline $timeline, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(Timeline $timeline, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->timeline = $timeline; $this->timeline = $timeline;
} }

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Mastodon\Timelines; namespace Friendica\Module\Api\Mastodon\Timelines;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
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;
@ -34,9 +36,9 @@ class PublicTimeline extends BaseApi
*/ */
private $config; private $config;
public function __construct(IManageConfigValues $config, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(IManageConfigValues $config, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->config = $config; $this->config = $config;
} }
/** /**

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Mastodon\Trends; namespace Friendica\Module\Api\Mastodon\Trends;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
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;
@ -32,9 +34,9 @@ class Statuses extends BaseApi
*/ */
private $config; private $config;
public function __construct(IManageConfigValues $config, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(IManageConfigValues $config, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->config = $config; $this->config = $config;
} }

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Twitter; namespace Friendica\Module\Api\Twitter;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\User; use Friendica\Model\User;
@ -24,9 +26,9 @@ abstract class ContactEndpoint extends BaseApi
const DEFAULT_COUNT = 20; const DEFAULT_COUNT = 20;
const MAX_COUNT = 200; const MAX_COUNT = 200;
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->checkAllowedScope(self::SCOPE_READ); $this->checkAllowedScope(self::SCOPE_READ);
} }

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Twitter\DirectMessages; namespace Friendica\Module\Api\Twitter\DirectMessages;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Database\DBA; use Friendica\Database\DBA;
@ -27,9 +29,9 @@ class Destroy extends BaseApi
/** @var Database */ /** @var Database */
private $dba; private $dba;
public function __construct(Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->dba = $dba; $this->dba = $dba;
} }

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Twitter\DirectMessages; namespace Friendica\Module\Api\Twitter\DirectMessages;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Factory\Api\Twitter\DirectMessage; use Friendica\Factory\Api\Twitter\DirectMessage;
@ -32,9 +34,9 @@ class NewDM extends BaseApi
/** @var DirectMessage */ /** @var DirectMessage */
private $directMessage; private $directMessage;
public function __construct(DirectMessage $directMessage, Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(DirectMessage $directMessage, Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->dba = $dba; $this->dba = $dba;
$this->directMessage = $directMessage; $this->directMessage = $directMessage;

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Twitter; namespace Friendica\Module\Api\Twitter;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Database\DBA; use Friendica\Database\DBA;
@ -26,9 +28,9 @@ abstract class DirectMessagesEndpoint extends BaseApi
/** @var DirectMessage */ /** @var DirectMessage */
private $directMessage; private $directMessage;
public function __construct(DirectMessage $directMessage, Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(DirectMessage $directMessage, Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->dba = $dba; $this->dba = $dba;
$this->directMessage = $directMessage; $this->directMessage = $directMessage;

View file

@ -8,7 +8,9 @@
namespace Friendica\Module\Api\Twitter\Friendships; namespace Friendica\Module\Api\Twitter\Friendships;
use Exception; use Exception;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Factory\Api\Twitter\User as TwitterUser; use Friendica\Factory\Api\Twitter\User as TwitterUser;
@ -31,9 +33,9 @@ class Destroy extends ContactEndpoint
/** @var TwitterUser */ /** @var TwitterUser */
private $twitterUser; private $twitterUser;
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, TwitterUser $twitterUser, array $server, array $parameters = []) public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, TwitterUser $twitterUser, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->twitterUser = $twitterUser; $this->twitterUser = $twitterUser;
} }

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Twitter\Lists; namespace Friendica\Module\Api\Twitter\Lists;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle; use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle;
@ -32,9 +34,9 @@ class Create extends BaseApi
/** @var Database */ /** @var Database */
private $dba; private $dba;
public function __construct(Database $dba, FriendicaCircle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(Database $dba, FriendicaCircle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->dba = $dba; $this->dba = $dba;
$this->friendicaCircle = $friendicaCircle; $this->friendicaCircle = $friendicaCircle;

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Twitter\Lists; namespace Friendica\Module\Api\Twitter\Lists;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Factory\Api\Friendica\Circle as FriendicaCirle; use Friendica\Factory\Api\Friendica\Circle as FriendicaCirle;
@ -32,9 +34,9 @@ class Destroy extends BaseApi
/** @var Database */ /** @var Database */
private $dba; private $dba;
public function __construct(Database $dba, FriendicaCirle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(Database $dba, FriendicaCirle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->dba = $dba; $this->dba = $dba;
$this->friendicaCircle = $friendicaCircle; $this->friendicaCircle = $friendicaCircle;

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Twitter\Lists; namespace Friendica\Module\Api\Twitter\Lists;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle; use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle;
@ -30,9 +32,9 @@ class Ownership extends BaseApi
/** @var Database */ /** @var Database */
private $dba; private $dba;
public function __construct(Database $dba, FriendicaCircle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(Database $dba, FriendicaCircle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->dba = $dba; $this->dba = $dba;
$this->friendicaCircle = $friendicaCircle; $this->friendicaCircle = $friendicaCircle;

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Twitter\Lists; namespace Friendica\Module\Api\Twitter\Lists;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Database\DBA; use Friendica\Database\DBA;
@ -34,9 +36,9 @@ class Statuses extends BaseApi
/** @var Database */ /** @var Database */
private $dba; private $dba;
public function __construct(Database $dba, TwitterStatus $twitterStatus, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(Database $dba, TwitterStatus $twitterStatus, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->dba = $dba; $this->dba = $dba;
$this->twitterStatus = $twitterStatus; $this->twitterStatus = $twitterStatus;

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Api\Twitter\Lists; namespace Friendica\Module\Api\Twitter\Lists;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle; use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle;
@ -32,9 +34,9 @@ class Update extends BaseApi
/** @var Database */ /** @var Database */
private $dba; private $dba;
public function __construct(Database $dba, FriendicaCircle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(Database $dba, FriendicaCircle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
{ {
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->dba = $dba; $this->dba = $dba;
$this->friendicaCircle = $friendicaCircle; $this->friendicaCircle = $friendicaCircle;

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,8 +8,10 @@
namespace Friendica\Module; namespace Friendica\Module;
use DateTime; use DateTime;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Router; use Friendica\App\Router;
use Friendica\AppHelper;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Logger; use Friendica\Core\Logger;
@ -51,8 +53,8 @@ class BaseApi extends BaseModule
*/ */
protected static $request = []; protected static $request = [];
/** @var App */ /** @var AppHelper */
protected $app; protected $appHelper;
/** @var ApiResponse */ /** @var ApiResponse */
protected $response; protected $response;
@ -60,11 +62,11 @@ class BaseApi extends BaseModule
/** @var \Friendica\Factory\Api\Mastodon\Error */ /** @var \Friendica\Factory\Api\Mastodon\Error */
protected $errorFactory; protected $errorFactory;
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = []) public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $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);
$this->app = $app; $this->appHelper = $appHelper;
$this->errorFactory = $errorFactory; $this->errorFactory = $errorFactory;
} }

View file

@ -7,7 +7,10 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\AppHelper;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
@ -33,18 +36,18 @@ abstract class BaseModeration extends BaseModule
protected $session; protected $session;
/** @var SystemMessages */ /** @var SystemMessages */
protected $systemMessages; protected $systemMessages;
/** @var App */ /** @var AppHelper */
protected $app; protected $appHelper;
/** @var App\Page */ /** @var Page */
protected $page; protected $page;
public function __construct(App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, 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);
$this->session = $session; $this->session = $session;
$this->systemMessages = $systemMessages; $this->systemMessages = $systemMessages;
$this->app = $app; $this->appHelper = $appHelper;
$this->page = $page; $this->page = $page;
} }

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,12 +7,13 @@
namespace Friendica\Module\Calendar\Event; namespace Friendica\Module\Calendar\Event;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Session\Capability\IHandleUserSessions; use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Model\Contact; use Friendica\Model\Contact;
@ -61,14 +62,14 @@ class API extends BaseModule
/** @var string */ /** @var string */
protected $timezone; protected $timezone;
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, ACLFormatter $aclFormatter, App $app, array $server, array $parameters = []) public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, ACLFormatter $aclFormatter, AppHelper $appHelper, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->session = $session; $this->session = $session;
$this->sysMessages = $sysMessages; $this->sysMessages = $sysMessages;
$this->aclFormatter = $aclFormatter; $this->aclFormatter = $aclFormatter;
$this->timezone = $app->getTimeZone(); $this->timezone = $appHelper->getTimeZone();
if (!$this->session->getLocalUserId()) { if (!$this->session->getLocalUserId()) {
throw new UnauthorizedException($this->t('Permission denied.')); throw new UnauthorizedException($this->t('Permission denied.'));

View file

@ -7,15 +7,14 @@
namespace Friendica\Module\Calendar\Event; namespace Friendica\Module\Calendar\Event;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Feature;
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\Model\Event; use Friendica\Model\Event;
use Friendica\Model\User;
use Friendica\Module\Response; use Friendica\Module\Response;
use Friendica\Network\HTTPException; use Friendica\Network\HTTPException;
use Friendica\Util\Profiler; use Friendica\Util\Profiler;
@ -28,15 +27,15 @@ class Show extends BaseModule
{ {
/** @var IHandleUserSessions */ /** @var IHandleUserSessions */
protected $session; protected $session;
/** @var App */ /** @var AppHelper */
private $app; protected $appHelper;
public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, array $server, array $parameters = []) public function __construct(AppHelper $appHelper, 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);
$this->session = $session; $this->session = $session;
$this->app = $app; $this->appHelper = $appHelper;
} }
protected function rawContent(array $request = []) protected function rawContent(array $request = [])

View file

@ -7,16 +7,16 @@
namespace Friendica\Module\Calendar; namespace Friendica\Module\Calendar;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Session\Capability\IHandleUserSessions; use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Model\Event; use Friendica\Model\Event;
use Friendica\Model\Profile; use Friendica\Model\Profile;
use Friendica\Model\User;
use Friendica\Module\Response; use Friendica\Module\Response;
use Friendica\Module\Security\Login;
use Friendica\Navigation\SystemMessages; use Friendica\Navigation\SystemMessages;
use Friendica\Network\HTTPException; use Friendica\Network\HTTPException;
use Friendica\Util\Profiler; use Friendica\Util\Profiler;
@ -36,16 +36,16 @@ class Export extends BaseModule
protected $session; protected $session;
/** @var SystemMessages */ /** @var SystemMessages */
protected $sysMessages; protected $sysMessages;
/** @var App */ /** @var AppHelper */
protected $app; protected $appHelper;
public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, array $server, array $parameters = []) public function __construct(AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->session = $session; $this->session = $session;
$this->sysMessages = $sysMessages; $this->sysMessages = $sysMessages;
$this->app = $app; $this->appHelper = $appHelper;
} }
protected function rawContent(array $request = []) protected function rawContent(array $request = [])
@ -55,7 +55,7 @@ class Export extends BaseModule
throw new HTTPException\BadRequestException(); throw new HTTPException\BadRequestException();
} }
$owner = Profile::load($this->app, $nickname, false); $owner = Profile::load($this->appHelper, $nickname, false);
if (!$owner || $owner['account_expired'] || $owner['account_removed']) { if (!$owner || $owner['account_expired'] || $owner['account_removed']) {
throw new HTTPException\NotFoundException($this->t('User not found.')); throw new HTTPException\NotFoundException($this->t('User not found.'));
} }

View file

@ -7,7 +7,10 @@
namespace Friendica\Module\Calendar; namespace Friendica\Module\Calendar;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\AppHelper;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Content\Nav; use Friendica\Content\Nav;
@ -33,19 +36,19 @@ class Show extends BaseModule
protected $session; protected $session;
/** @var SystemMessages */ /** @var SystemMessages */
protected $sysMessages; protected $sysMessages;
/** @var App\Page */ /** @var Page */
protected $page; protected $page;
/** @var App */ /** @var AppHelper */
protected $app; protected $appHelper;
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, App\Page $page, App $app, array $server, array $parameters = []) public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, Page $page, AppHelper $appHelper, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->session = $session; $this->session = $session;
$this->sysMessages = $sysMessages; $this->sysMessages = $sysMessages;
$this->page = $page; $this->page = $page;
$this->app = $app; $this->appHelper = $appHelper;
} }
protected function content(array $request = []): string protected function content(array $request = []): string
@ -55,7 +58,7 @@ class Show extends BaseModule
throw new HTTPException\UnauthorizedException(); throw new HTTPException\UnauthorizedException();
} }
$owner = Profile::load($this->app, $nickname, false); $owner = Profile::load($this->appHelper, $nickname, false);
if (!$owner || $owner['account_expired'] || $owner['account_removed']) { if (!$owner || $owner['account_expired'] || $owner['account_removed']) {
throw new HTTPException\NotFoundException($this->t('User not found.')); throw new HTTPException\NotFoundException($this->t('User not found.'));
} }

View file

@ -7,8 +7,10 @@
namespace Friendica\Module\Contact; namespace Friendica\Module\Contact;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\App;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Session\Capability\IHandleUserSessions; use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\Worker; use Friendica\Core\Worker;
@ -27,16 +29,16 @@ class Redir extends \Friendica\BaseModule
private $session; private $session;
/** @var Database */ /** @var Database */
private $database; private $database;
/** @var App */ /** @var AppHelper */
private $app; private $appHelper;
public function __construct(App $app, Database $database, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(AppHelper $appHelper, Database $database, IHandleUserSessions $session, 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);
$this->session = $session; $this->session = $session;
$this->database = $database; $this->database = $database;
$this->app = $app; $this->appHelper = $appHelper;
} }
protected function rawContent(array $request = []) protected function rawContent(array $request = [])
@ -100,14 +102,14 @@ class Redir extends \Friendica\BaseModule
// We don't use magic auth when there is no visitor, we are on the same system, or we visit our own stuff // We don't use magic auth when there is no visitor, we are on the same system, or we visit our own stuff
if (empty($visitor) || Strings::compareLink($basepath, $this->baseUrl) || Strings::compareLink($contact_url, $visitor)) { if (empty($visitor) || Strings::compareLink($basepath, $this->baseUrl) || Strings::compareLink($contact_url, $visitor)) {
$this->logger->info('Redirecting without magic', ['target' => $target_url, 'visitor' => $visitor, 'contact' => $contact_url]); $this->logger->info('Redirecting without magic', ['target' => $target_url, 'visitor' => $visitor, 'contact' => $contact_url]);
$this->app->redirect($target_url); $this->appHelper->redirect($target_url);
} }
$separator = strpos($target_url, '?') ? '&' : '?'; $separator = strpos($target_url, '?') ? '&' : '?';
$target_url .= $separator . 'zrl=' . urlencode($visitor) . '&addr=' . urlencode($contact_url); $target_url .= $separator . 'zrl=' . urlencode($visitor) . '&addr=' . urlencode($contact_url);
$this->logger->info('Redirecting with magic', ['target' => $target_url, 'visitor' => $visitor, 'contact' => $contact_url]); $this->logger->info('Redirecting with magic', ['target' => $target_url, 'visitor' => $visitor, 'contact' => $contact_url]);
$this->app->redirect($target_url); $this->appHelper->redirect($target_url);
} }
/** /**
@ -135,9 +137,9 @@ class Redir extends \Friendica\BaseModule
$this->checkUrl($contact_url, $url); $this->checkUrl($contact_url, $url);
$target_url = $url ?: $contact_url; $target_url = $url ?: $contact_url;
if (!empty($this->app->getContactId()) && $this->app->getContactId() == $cid) { if (!empty($this->appHelper->getContactId()) && $this->appHelper->getContactId() == $cid) {
// Local user is already authenticated. // Local user is already authenticated.
$this->app->redirect($target_url); $this->appHelper->redirect($target_url);
} }
if ($contact['uid'] == 0 && $this->session->getLocalUserId()) { if ($contact['uid'] == 0 && $this->session->getLocalUserId()) {
@ -148,10 +150,10 @@ class Redir extends \Friendica\BaseModule
$cid = $contact['id']; $cid = $contact['id'];
} }
if (!empty($this->app->getContactId()) && $this->app->getContactId() == $cid) { if (!empty($this->appHelper->getContactId()) && $this->appHelper->getContactId() == $cid) {
// Local user is already authenticated. // Local user is already authenticated.
$this->logger->info('Contact already authenticated. Redirecting to target url', ['url' => $contact['url'], 'name' => $contact['name'], 'target_url' => $target_url]); $this->logger->info('Contact already authenticated. Redirecting to target url', ['url' => $contact['url'], 'name' => $contact['name'], 'target_url' => $target_url]);
$this->app->redirect($target_url); $this->appHelper->redirect($target_url);
} }
} }
@ -166,7 +168,7 @@ class Redir extends \Friendica\BaseModule
if (($host == $remotehost) && ($this->session->getRemoteContactID($this->session->get('visitor_visiting')) == $this->session->get('visitor_id'))) { if (($host == $remotehost) && ($this->session->getRemoteContactID($this->session->get('visitor_visiting')) == $this->session->get('visitor_id'))) {
// Remote user is already authenticated. // Remote user is already authenticated.
$this->logger->info('Contact already authenticated. Redirecting to target url', ['url' => $contact['url'], 'name' => $contact['name'], 'target_url' => $target_url]); $this->logger->info('Contact already authenticated. Redirecting to target url', ['url' => $contact['url'], 'name' => $contact['name'], 'target_url' => $target_url]);
$this->app->redirect($target_url); $this->appHelper->redirect($target_url);
} }
} }
@ -181,7 +183,7 @@ class Redir extends \Friendica\BaseModule
} }
$this->logger->info('redirecting to ' . $target_url); $this->logger->info('redirecting to ' . $target_url);
$this->app->redirect($target_url); $this->appHelper->redirect($target_url);
} }

View file

@ -7,8 +7,11 @@
namespace Friendica\Module\Conversation; namespace Friendica\Module\Conversation;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Mode; use Friendica\App\Mode;
use Friendica\App\Page;
use Friendica\AppHelper;
use Friendica\Content\BoundariesPager; use Friendica\Content\BoundariesPager;
use Friendica\Content\Conversation; use Friendica\Content\Conversation;
use Friendica\Content\Conversation\Entity\Channel; use Friendica\Content\Conversation\Entity\Channel;
@ -61,15 +64,15 @@ class Network extends Timeline
/** @var int */ /** @var int */
protected $mention; protected $mention;
/** @var App */ /** @var AppHelper */
protected $app; protected $appHelper;
/** @var ICanCache */ /** @var ICanCache */
protected $cache; protected $cache;
/** @var IManageConfigValues The config */ /** @var IManageConfigValues The config */
protected $config; protected $config;
/** @var SystemMessages */ /** @var SystemMessages */
protected $systemMessages; protected $systemMessages;
/** @var App\Page */ /** @var Page */
protected $page; protected $page;
/** @var Conversation */ /** @var Conversation */
protected $conversation; protected $conversation;
@ -88,11 +91,11 @@ class Network extends Timeline
/** @var NetworkFactory */ /** @var NetworkFactory */
protected $networkFactory; protected $networkFactory;
public function __construct(UserDefinedChannelFactory $userDefinedChannel, NetworkFactory $network, CommunityFactory $community, ChannelFactory $channelFactory, UserDefinedChannel $channel, App $app, TimelineFactory $timeline, SystemMessages $systemMessages, Mode $mode, Conversation $conversation, App\Page $page, IHandleUserSessions $session, Database $database, IManagePersonalConfigValues $pConfig, IManageConfigValues $config, ICanCache $cache, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(UserDefinedChannelFactory $userDefinedChannel, NetworkFactory $network, CommunityFactory $community, ChannelFactory $channelFactory, UserDefinedChannel $channel, AppHelper $appHelper, TimelineFactory $timeline, SystemMessages $systemMessages, Mode $mode, Conversation $conversation, Page $page, IHandleUserSessions $session, Database $database, IManagePersonalConfigValues $pConfig, IManageConfigValues $config, ICanCache $cache, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{ {
parent::__construct($channel, $mode, $session, $database, $pConfig, $config, $cache, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($channel, $mode, $session, $database, $pConfig, $config, $cache, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->app = $app; $this->appHelper = $appHelper;
$this->timeline = $timeline; $this->timeline = $timeline;
$this->systemMessages = $systemMessages; $this->systemMessages = $systemMessages;
$this->conversation = $conversation; $this->conversation = $conversation;
@ -393,10 +396,10 @@ class Network extends Timeline
} }
if ($this->dateFrom) { if ($this->dateFrom) {
$conditionStrings = DBA::mergeConditions($conditionStrings, ["`received` <= ? ", DateTimeFormat::convert($this->dateFrom, 'UTC', $this->app->getTimeZone())]); $conditionStrings = DBA::mergeConditions($conditionStrings, ["`received` <= ? ", DateTimeFormat::convert($this->dateFrom, 'UTC', $this->appHelper->getTimeZone())]);
} }
if ($this->dateTo) { if ($this->dateTo) {
$conditionStrings = DBA::mergeConditions($conditionStrings, ["`received` >= ? ", DateTimeFormat::convert($this->dateTo, 'UTC', $this->app->getTimeZone())]); $conditionStrings = DBA::mergeConditions($conditionStrings, ["`received` >= ? ", DateTimeFormat::convert($this->dateTo, 'UTC', $this->appHelper->getTimeZone())]);
} }
if ($this->circleId) { if ($this->circleId) {

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

@ -32,7 +32,7 @@ class Home extends BaseModule
protected function content(array $request = []): string protected function content(array $request = []): string
{ {
$app = DI::app(); $basePath = DI::appHelper()->getBasePath();
$config = DI::config(); $config = DI::config();
// currently no returned data is used // currently no returned data is used
@ -51,8 +51,8 @@ class Home extends BaseModule
$customHome = ''; $customHome = '';
$defaultHeader = ($config->get('config', 'sitename') ? DI::l10n()->t('Welcome to %s', $config->get('config', 'sitename')) : ''); $defaultHeader = ($config->get('config', 'sitename') ? DI::l10n()->t('Welcome to %s', $config->get('config', 'sitename')) : '');
$homeFilePath = $app->getBasePath() . '/home.html'; $homeFilePath = $basePath . '/home.html';
$cssFilePath = $app->getBasePath() . '/home.css'; $cssFilePath = $basePath . '/home.css';
if (file_exists($homeFilePath)) { if (file_exists($homeFilePath)) {
$customHome = $homeFilePath; $customHome = $homeFilePath;

View file

@ -7,10 +7,14 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Mode;
use Friendica\AppHelper;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core; use Friendica\Core;
use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Installer;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\Theme; use Friendica\Core\Theme;
@ -51,22 +55,22 @@ class Install extends BaseModule
private $currentWizardStep; private $currentWizardStep;
/** /**
* @var Core\Installer The installer * @var Installer The installer
*/ */
private $installer; private $installer;
/** @var App */ /** @var Cache */
protected $app; protected $configCache;
/** @var App\Mode */ /** @var Mode */
protected $mode; protected $mode;
public function __construct(App $app, BasePath $basePath, App\Mode $mode, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Core\Installer $installer, array $server, array $parameters = []) public function __construct(AppHelper $appHelper, BasePath $basePath, Mode $mode, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Installer $installer, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->app = $app; $this->configCache = $appHelper->getConfigCache();
$this->mode = $mode; $this->mode = $mode;
$this->installer = $installer; $this->installer = $installer;
if (!$this->mode->isInstall()) { if (!$this->mode->isInstall()) {
throw new HTTPException\ForbiddenException(); throw new HTTPException\ForbiddenException();
@ -80,8 +84,7 @@ class Install extends BaseModule
} }
// get basic installation information and save them to the config cache // get basic installation information and save them to the config cache
$configCache = $this->app->getConfigCache(); $this->installer->setUpCache($this->configCache, $basePath->getPath());
$this->installer->setUpCache($configCache, $basePath->getPath());
// We overwrite current theme css, because during install we may not have a working mod_rewrite // We overwrite current theme css, because during install we may not have a working mod_rewrite
// so we may not have a css at all. Here we set a static css file for the install procedure pages // so we may not have a css at all. Here we set a static css file for the install procedure pages
@ -92,31 +95,29 @@ class Install extends BaseModule
protected function post(array $request = []) protected function post(array $request = [])
{ {
$configCache = $this->app->getConfigCache();
switch ($this->currentWizardStep) { switch ($this->currentWizardStep) {
case self::SYSTEM_CHECK: case self::SYSTEM_CHECK:
case self::BASE_CONFIG: case self::BASE_CONFIG:
$this->checkSetting($configCache, $_POST, 'config', 'php_path'); $this->checkSetting($this->configCache, $_POST, 'config', 'php_path');
break; break;
case self::DATABASE_CONFIG: case self::DATABASE_CONFIG:
$this->checkSetting($configCache, $_POST, 'config', 'php_path'); $this->checkSetting($this->configCache, $_POST, 'config', 'php_path');
$this->checkSetting($configCache, $_POST, 'system', 'basepath'); $this->checkSetting($this->configCache, $_POST, 'system', 'basepath');
$this->checkSetting($configCache, $_POST, 'system', 'url'); $this->checkSetting($this->configCache, $_POST, 'system', 'url');
break; break;
case self::SITE_SETTINGS: case self::SITE_SETTINGS:
$this->checkSetting($configCache, $_POST, 'config', 'php_path'); $this->checkSetting($this->configCache, $_POST, 'config', 'php_path');
$this->checkSetting($configCache, $_POST, 'system', 'basepath'); $this->checkSetting($this->configCache, $_POST, 'system', 'basepath');
$this->checkSetting($configCache, $_POST, 'system', 'url'); $this->checkSetting($this->configCache, $_POST, 'system', 'url');
$this->checkSetting($configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST); $this->checkSetting($this->configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST);
$this->checkSetting($configCache, $_POST, 'database', 'username', ''); $this->checkSetting($this->configCache, $_POST, 'database', 'username', '');
$this->checkSetting($configCache, $_POST, 'database', 'password', ''); $this->checkSetting($this->configCache, $_POST, 'database', 'password', '');
$this->checkSetting($configCache, $_POST, 'database', 'database', ''); $this->checkSetting($this->configCache, $_POST, 'database', 'database', '');
// If we cannot connect to the database, return to the previous step // If we cannot connect to the database, return to the previous step
if (!$this->installer->checkDB(DI::dba())) { if (!$this->installer->checkDB(DI::dba())) {
@ -126,19 +127,19 @@ class Install extends BaseModule
break; break;
case self::FINISHED: case self::FINISHED:
$this->checkSetting($configCache, $_POST, 'config', 'php_path'); $this->checkSetting($this->configCache, $_POST, 'config', 'php_path');
$this->checkSetting($configCache, $_POST, 'system', 'basepath'); $this->checkSetting($this->configCache, $_POST, 'system', 'basepath');
$this->checkSetting($configCache, $_POST, 'system', 'url'); $this->checkSetting($this->configCache, $_POST, 'system', 'url');
$this->checkSetting($configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST); $this->checkSetting($this->configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST);
$this->checkSetting($configCache, $_POST, 'database', 'username', ''); $this->checkSetting($this->configCache, $_POST, 'database', 'username', '');
$this->checkSetting($configCache, $_POST, 'database', 'password', ''); $this->checkSetting($this->configCache, $_POST, 'database', 'password', '');
$this->checkSetting($configCache, $_POST, 'database', 'database', ''); $this->checkSetting($this->configCache, $_POST, 'database', 'database', '');
$this->checkSetting($configCache, $_POST, 'system', 'default_timezone', Core\Installer::DEFAULT_TZ); $this->checkSetting($this->configCache, $_POST, 'system', 'default_timezone', Core\Installer::DEFAULT_TZ);
$this->checkSetting($configCache, $_POST, 'system', 'language', Core\Installer::DEFAULT_LANG); $this->checkSetting($this->configCache, $_POST, 'system', 'language', Core\Installer::DEFAULT_LANG);
$this->checkSetting($configCache, $_POST, 'config', 'admin_email', ''); $this->checkSetting($this->configCache, $_POST, 'config', 'admin_email', '');
// If we cannot connect to the database, return to the Database config wizard // If we cannot connect to the database, return to the Database config wizard
if (!$this->installer->checkDB(DI::dba())) { if (!$this->installer->checkDB(DI::dba())) {
@ -146,7 +147,7 @@ class Install extends BaseModule
return; return;
} }
if (!$this->installer->createConfig($configCache)) { if (!$this->installer->createConfig($this->configCache)) {
return; return;
} }
@ -169,15 +170,13 @@ class Install extends BaseModule
protected function content(array $request = []): string protected function content(array $request = []): string
{ {
$configCache = $this->app->getConfigCache();
$output = ''; $output = '';
$install_title = $this->t('Friendica Communications Server - Setup'); $install_title = $this->t('Friendica Communications Server - Setup');
switch ($this->currentWizardStep) { switch ($this->currentWizardStep) {
case self::SYSTEM_CHECK: case self::SYSTEM_CHECK:
$php_path = $configCache->get('config', 'php_path'); $php_path = $this->configCache->get('config', 'php_path');
$status = $this->installer->checkEnvironment($this->baseUrl, $php_path); $status = $this->installer->checkEnvironment($this->baseUrl, $php_path);
@ -199,8 +198,8 @@ class Install extends BaseModule
break; break;
case self::BASE_CONFIG: case self::BASE_CONFIG:
$baseUrl = $configCache->get('system', 'url') ? $baseUrl = $this->configCache->get('system', 'url') ?
new Uri($configCache->get('system', 'url')) : new Uri($this->configCache->get('system', 'url')) :
$this->baseUrl; $this->baseUrl;
$tpl = Renderer::getMarkupTemplate('install/02_base_config.tpl'); $tpl = Renderer::getMarkupTemplate('install/02_base_config.tpl');
@ -209,7 +208,7 @@ class Install extends BaseModule
'$pass' => $this->t('Base settings'), '$pass' => $this->t('Base settings'),
'$basepath' => ['system-basepath', '$basepath' => ['system-basepath',
$this->t("Base path to installation"), $this->t("Base path to installation"),
$configCache->get('system', 'basepath'), $this->configCache->get('system', 'basepath'),
$this->t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."), $this->t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."),
$this->t('Required')], $this->t('Required')],
'$system_url' => ['system-url', '$system_url' => ['system-url',
@ -217,7 +216,7 @@ class Install extends BaseModule
(string)$baseUrl, (string)$baseUrl,
$this->t("Overwrite this field in case the system URL determination isn't right, otherwise leave it as is."), $this->t("Overwrite this field in case the system URL determination isn't right, otherwise leave it as is."),
$this->t('Required')], $this->t('Required')],
'$php_path' => $configCache->get('config', 'php_path'), '$php_path' => $this->configCache->get('config', 'php_path'),
'$submit' => $this->t('Submit'), '$submit' => $this->t('Submit'),
]); ]);
break; break;
@ -233,31 +232,31 @@ class Install extends BaseModule
'$required' => $this->t('Required'), '$required' => $this->t('Required'),
'$requirement_not_satisfied' => $this->t('Requirement not satisfied'), '$requirement_not_satisfied' => $this->t('Requirement not satisfied'),
'$checks' => $this->installer->getChecks(), '$checks' => $this->installer->getChecks(),
'$basepath' => $configCache->get('system', 'basepath'), '$basepath' => $this->configCache->get('system', 'basepath'),
'$system_url' => $configCache->get('system', 'url'), '$system_url' => $this->configCache->get('system', 'url'),
'$dbhost' => ['database-hostname', '$dbhost' => ['database-hostname',
$this->t('Database Server Name'), $this->t('Database Server Name'),
$configCache->get('database', 'hostname'), $this->configCache->get('database', 'hostname'),
'', '',
$this->t('Required')], $this->t('Required')],
'$dbuser' => ['database-username', '$dbuser' => ['database-username',
$this->t('Database Login Name'), $this->t('Database Login Name'),
$configCache->get('database', 'username'), $this->configCache->get('database', 'username'),
'', '',
$this->t('Required'), $this->t('Required'),
'autofocus'], 'autofocus'],
'$dbpass' => ['database-password', '$dbpass' => ['database-password',
$this->t('Database Login Password'), $this->t('Database Login Password'),
$configCache->get('database', 'password'), $this->configCache->get('database', 'password'),
$this->t("For security reasons the password must not be empty"), $this->t("For security reasons the password must not be empty"),
$this->t('Required')], $this->t('Required')],
'$dbdata' => ['database-database', '$dbdata' => ['database-database',
$this->t('Database Name'), $this->t('Database Name'),
$configCache->get('database', 'database'), $this->configCache->get('database', 'database'),
'', '',
$this->t('Required')], $this->t('Required')],
'$lbl_10' => $this->t('Please select a default timezone for your website'), '$lbl_10' => $this->t('Please select a default timezone for your website'),
'$php_path' => $configCache->get('config', 'php_path'), '$php_path' => $this->configCache->get('config', 'php_path'),
'$submit' => $this->t('Submit') '$submit' => $this->t('Submit')
]); ]);
break; break;
@ -272,27 +271,27 @@ class Install extends BaseModule
'$required' => $this->t('Required'), '$required' => $this->t('Required'),
'$checks' => $this->installer->getChecks(), '$checks' => $this->installer->getChecks(),
'$pass' => $this->t('Site settings'), '$pass' => $this->t('Site settings'),
'$basepath' => $configCache->get('system', 'basepath'), '$basepath' => $this->configCache->get('system', 'basepath'),
'$system_url' => $configCache->get('system', 'url'), '$system_url' => $this->configCache->get('system', 'url'),
'$dbhost' => $configCache->get('database', 'hostname'), '$dbhost' => $this->configCache->get('database', 'hostname'),
'$dbuser' => $configCache->get('database', 'username'), '$dbuser' => $this->configCache->get('database', 'username'),
'$dbpass' => $configCache->get('database', 'password'), '$dbpass' => $this->configCache->get('database', 'password'),
'$dbdata' => $configCache->get('database', 'database'), '$dbdata' => $this->configCache->get('database', 'database'),
'$adminmail' => ['config-admin_email', '$adminmail' => ['config-admin_email',
$this->t('Site administrator email address'), $this->t('Site administrator email address'),
$configCache->get('config', 'admin_email'), $this->configCache->get('config', 'admin_email'),
$this->t('Your account email address must match this in order to use the web admin panel.'), $this->t('Your account email address must match this in order to use the web admin panel.'),
$this->t('Required'), 'autofocus', 'email'], $this->t('Required'), 'autofocus', 'email'],
'$timezone' => Temporal::getTimezoneField('system-default_timezone', '$timezone' => Temporal::getTimezoneField('system-default_timezone',
$this->t('Please select a default timezone for your website'), $this->t('Please select a default timezone for your website'),
$configCache->get('system', 'default_timezone'), $this->configCache->get('system', 'default_timezone'),
''), ''),
'$language' => ['system-language', '$language' => ['system-language',
$this->t('System Language:'), $this->t('System Language:'),
$configCache->get('system', 'language'), $this->configCache->get('system', 'language'),
$this->t('Set the default language for your Friendica installation interface and to send emails.'), $this->t('Set the default language for your Friendica installation interface and to send emails.'),
$lang_choices], $lang_choices],
'$php_path' => $configCache->get('config', 'php_path'), '$php_path' => $this->configCache->get('config', 'php_path'),
'$submit' => $this->t('Submit') '$submit' => $this->t('Submit')
]); ]);
break; break;

View file

@ -8,7 +8,10 @@
namespace Friendica\Module\Item; namespace Friendica\Module\Item;
use DateTime; use DateTime;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\AppHelper;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Core\ACL; use Friendica\Core\ACL;
@ -41,7 +44,7 @@ class Compose extends BaseModule
/** @var ACLFormatter */ /** @var ACLFormatter */
private $ACLFormatter; private $ACLFormatter;
/** @var App\Page */ /** @var Page */
private $page; private $page;
/** @var IManagePersonalConfigValues */ /** @var IManagePersonalConfigValues */
@ -53,11 +56,11 @@ class Compose extends BaseModule
/** @var UserSession */ /** @var UserSession */
private $session; private $session;
/** @var App */ /** @var AppHelper */
private $app; private $appHelper;
public function __construct(App $app, UserSession $session, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, App\Page $page, ACLFormatter $ACLFormatter, SystemMessages $systemMessages, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(AppHelper $appHelper, UserSession $session, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, Page $page, ACLFormatter $ACLFormatter, SystemMessages $systemMessages, 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);
@ -67,7 +70,7 @@ class Compose extends BaseModule
$this->pConfig = $pConfig; $this->pConfig = $pConfig;
$this->config = $config; $this->config = $config;
$this->session = $session; $this->session = $session;
$this->app = $app; $this->appHelper = $appHelper;
} }
protected function post(array $request = []) protected function post(array $request = [])
@ -87,7 +90,7 @@ class Compose extends BaseModule
return Login::form('compose'); return Login::form('compose');
} }
if ($this->app->getCurrentTheme() !== 'frio') { if ($this->appHelper->getCurrentTheme() !== 'frio') {
throw new NotImplementedException($this->l10n->t('This feature is only available with the frio theme.')); throw new NotImplementedException($this->l10n->t('This feature is only available with the frio theme.'));
} }
@ -115,7 +118,7 @@ class Compose extends BaseModule
$compose_title = $this->l10n->t('Compose new personal note'); $compose_title = $this->l10n->t('Compose new personal note');
$type = 'note'; $type = 'note';
$doesFederate = false; $doesFederate = false;
$contact_allow_list = [$this->app->getContactId()]; $contact_allow_list = [$this->appHelper->getContactId()];
$circle_allow_list = []; $circle_allow_list = [];
$contact_deny_list = []; $contact_deny_list = [];
$circle_deny_list = []; $circle_deny_list = [];
@ -158,12 +161,12 @@ class Compose extends BaseModule
$this->page->registerFooterScript(Theme::getPathForFile('js/linkPreview.js')); $this->page->registerFooterScript(Theme::getPathForFile('js/linkPreview.js'));
$this->page->registerFooterScript(Theme::getPathForFile('js/compose.js')); $this->page->registerFooterScript(Theme::getPathForFile('js/compose.js'));
$contact = Contact::getById($this->app->getContactId()); $contact = Contact::getById($this->appHelper->getContactId());
if ($this->pConfig->get($this->session->getLocalUserId(), 'system', 'set_creation_date')) { if ($this->pConfig->get($this->session->getLocalUserId(), 'system', 'set_creation_date')) {
$created_at = Temporal::getDateTimeField( $created_at = Temporal::getDateTimeField(
new \DateTime(DBA::NULL_DATETIME), new DateTime(DBA::NULL_DATETIME),
new \DateTime('now'), new DateTime('now'),
null, null,
$this->l10n->t('Created at'), $this->l10n->t('Created at'),
'created_at' 'created_at'

View file

@ -8,6 +8,7 @@
namespace Friendica\Module\Item; namespace Friendica\Module\Item;
use Friendica\App; use Friendica\App;
use Friendica\AppHelper;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Content\Conversation; use Friendica\Content\Conversation;
use Friendica\Content\Item as ContentItem; use Friendica\Content\Item as ContentItem;
@ -46,8 +47,8 @@ class Display extends BaseModule
protected $pConfig; protected $pConfig;
/** @var IHandleUserSessions */ /** @var IHandleUserSessions */
protected $session; protected $session;
/** @var App */ /** @var AppHelper */
protected $app; protected $appHelper;
/** @var ContentItem */ /** @var ContentItem */
protected $contentItem; protected $contentItem;
/** @var Conversation */ /** @var Conversation */
@ -57,7 +58,7 @@ class Display extends BaseModule
/** @var Notify */ /** @var Notify */
protected $notify; protected $notify;
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, IHandleUserSessions $session, App $app, App\Page $page, ContentItem $contentItem, Conversation $conversation, Notification $notification, Notify $notify, array $server, array $parameters = []) public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, IHandleUserSessions $session, AppHelper $appHelper, App\Page $page, ContentItem $contentItem, Conversation $conversation, Notification $notification, Notify $notify, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
@ -65,7 +66,7 @@ class Display extends BaseModule
$this->config = $config; $this->config = $config;
$this->pConfig = $pConfig; $this->pConfig = $pConfig;
$this->session = $session; $this->session = $session;
$this->app = $app; $this->appHelper = $appHelper;
$this->contentItem = $contentItem; $this->contentItem = $contentItem;
$this->conversation = $conversation; $this->conversation = $conversation;
$this->notification = $notification; $this->notification = $notification;
@ -175,12 +176,12 @@ class Display extends BaseModule
} }
if ($this->baseUrl->isLocalUrl($author['url'])) { if ($this->baseUrl->isLocalUrl($author['url'])) {
Profile::load($this->app, $author['nick'], false); Profile::load($this->appHelper, $author['nick'], false);
} else { } else {
$this->page['aside'] = Widget\VCard::getHTML($author); $this->page['aside'] = Widget\VCard::getHTML($author);
} }
$this->app->setProfileOwner($item['uid']); $this->appHelper->setProfileOwner($item['uid']);
} }
protected function getDisplayData(array $item, bool $update = false, int $updateUid = 0, bool $force = false): string protected function getDisplayData(array $item, bool $update = false, int $updateUid = 0, bool $force = false): string

View file

@ -8,7 +8,9 @@
namespace Friendica\Module; namespace Friendica\Module;
use Exception; use Exception;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
@ -35,8 +37,8 @@ use Psr\Log\LoggerInterface;
*/ */
class Magic extends BaseModule class Magic extends BaseModule
{ {
/** @var App */ /** @var AppHelper */
protected $app; protected $appHelper;
/** @var Database */ /** @var Database */
protected $dba; protected $dba;
/** @var ICanSendHttpRequests */ /** @var ICanSendHttpRequests */
@ -44,11 +46,11 @@ class Magic extends BaseModule
/** @var IHandleUserSessions */ /** @var IHandleUserSessions */
protected $userSession; protected $userSession;
public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Database $dba, ICanSendHttpRequests $httpClient, IHandleUserSessions $userSession, $server, array $parameters = []) public function __construct(AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Database $dba, ICanSendHttpRequests $httpClient, 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);
$this->app = $app; $this->appHelper = $appHelper;
$this->dba = $dba; $this->dba = $dba;
$this->httpClient = $httpClient; $this->httpClient = $httpClient;
$this->userSession = $userSession; $this->userSession = $userSession;
@ -85,11 +87,11 @@ class Magic extends BaseModule
if (empty($contact)) { if (empty($contact)) {
if (!$owa) { if (!$owa) {
$this->logger->info('No contact record found, no oWA, redirecting to destination.', ['request' => $request, 'server' => $_SERVER, 'dest' => $dest]); $this->logger->info('No contact record found, no oWA, redirecting to destination.', ['request' => $request, 'server' => $_SERVER, 'dest' => $dest]);
$this->app->redirect($dest); $this->appHelper->redirect($dest);
} }
} else { } else {
// Redirect if the contact is already authenticated on this site. // Redirect if the contact is already authenticated on this site.
if ($this->app->getContactId() && strpos($contact['nurl'], Strings::normaliseLink($this->baseUrl)) !== false) { if ($this->appHelper->getContactId() && strpos($contact['nurl'], Strings::normaliseLink($this->baseUrl)) !== false) {
$this->logger->info('Contact is already authenticated, redirecting to destination.', ['dest' => $dest]); $this->logger->info('Contact is already authenticated, redirecting to destination.', ['dest' => $dest]);
System::externalRedirect($dest); System::externalRedirect($dest);
} }
@ -99,12 +101,12 @@ class Magic extends BaseModule
if (!$this->userSession->getLocalUserId() || !$owa) { if (!$this->userSession->getLocalUserId() || !$owa) {
$this->logger->notice('Not logged in or not OWA, redirecting to destination.', ['uid' => $this->userSession->getLocalUserId(), 'owa' => $owa, 'dest' => $dest]); $this->logger->notice('Not logged in or not OWA, redirecting to destination.', ['uid' => $this->userSession->getLocalUserId(), 'owa' => $owa, 'dest' => $dest]);
$this->app->redirect($dest); $this->appHelper->redirect($dest);
} }
$dest = Network::removeUrlParameter($dest, 'zid'); $dest = Network::removeUrlParameter($dest, 'zid');
$dest = Network::removeUrlParameter($dest, 'f'); $dest = Network::removeUrlParameter($dest, 'f');
// OpenWebAuth // OpenWebAuth
$owner = User::getOwnerDataById($this->userSession->getLocalUserId()); $owner = User::getOwnerDataById($this->userSession->getLocalUserId());
@ -169,7 +171,7 @@ class Magic extends BaseModule
$j = json_decode($curlResult->getBodyString(), true); $j = json_decode($curlResult->getBodyString(), true);
if (empty($j) || !$j['success']) { if (empty($j) || !$j['success']) {
$this->logger->notice('Invalid JSON, redirecting to destination.', ['json' => $j, 'dest' => $dest]); $this->logger->notice('Invalid JSON, redirecting to destination.', ['json' => $j, 'dest' => $dest]);
$this->app->redirect($dest); $this->appHelper->redirect($dest);
} }
if ($j['encrypted_token']) { if ($j['encrypted_token']) {

View file

@ -7,12 +7,13 @@
namespace Friendica\Module\Media\Attachment; namespace Friendica\Module\Media\Attachment;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\BaseModule; use Friendica\BaseModule;
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\Model\Attach; use Friendica\Model\Attach;
use Friendica\Module\Response; use Friendica\Module\Response;
use Friendica\Network\HTTPException\UnauthorizedException; use Friendica\Network\HTTPException\UnauthorizedException;
@ -27,15 +28,15 @@ class Browser extends BaseModule
{ {
/** @var IHandleUserSessions */ /** @var IHandleUserSessions */
protected $session; protected $session;
/** @var App */ /** @var AppHelper */
protected $app; protected $appHelper;
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, App $app, array $server, array $parameters = []) public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, AppHelper $appHelper, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->session = $session; $this->session = $session;
$this->app = $app; $this->appHelper = $appHelper;
} }
protected function content(array $request = []): string protected function content(array $request = []): string
@ -47,7 +48,7 @@ class Browser extends BaseModule
// Needed to match the correct template in a module that uses a different theme than the user/site/default // Needed to match the correct template in a module that uses a different theme than the user/site/default
$theme = Strings::sanitizeFilePathItem($request['theme'] ?? ''); $theme = Strings::sanitizeFilePathItem($request['theme'] ?? '');
if ($theme && is_file("view/theme/$theme/config.php")) { if ($theme && is_file("view/theme/$theme/config.php")) {
$this->app->setCurrentTheme($theme); $this->appHelper->setCurrentTheme($theme);
} }
$files = Attach::selectToArray(['id', 'filename', 'filetype'], ['uid' => $this->session->getLocalUserId()]); $files = Attach::selectToArray(['id', 'filename', 'filetype'], ['uid' => $this->session->getLocalUserId()]);

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Media\Photo; namespace Friendica\Module\Media\Photo;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
@ -28,15 +30,15 @@ class Browser extends BaseModule
{ {
/** @var IHandleUserSessions */ /** @var IHandleUserSessions */
protected $session; protected $session;
/** @var App */ /** @var AppHelper */
protected $app; protected $appHelper;
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, App $app, array $server, array $parameters = []) public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, AppHelper $appHelper, array $server, array $parameters = [])
{ {
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->session = $session; $this->session = $session;
$this->app = $app; $this->appHelper = $appHelper;
} }
protected function content(array $request = []): string protected function content(array $request = []): string
@ -48,7 +50,7 @@ class Browser extends BaseModule
// Needed to match the correct template in a module that uses a different theme than the user/site/default // Needed to match the correct template in a module that uses a different theme than the user/site/default
$theme = Strings::sanitizeFilePathItem($request['theme'] ?? ''); $theme = Strings::sanitizeFilePathItem($request['theme'] ?? '');
if ($theme && is_file("view/theme/$theme/config.php")) { if ($theme && is_file("view/theme/$theme/config.php")) {
$this->app->setCurrentTheme($theme); $this->appHelper->setCurrentTheme($theme);
} }
$album = $this->parameters['album'] ?? null; $album = $this->parameters['album'] ?? null;

View file

@ -7,13 +7,15 @@
namespace Friendica\Module\Moderation; namespace Friendica\Module\Moderation;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\AppHelper;
use Friendica\Core\Hook; use Friendica\Core\Hook;
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\Database\Database; use Friendica\Database\Database;
use Friendica\DI;
use Friendica\Model\Register; use Friendica\Model\Register;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Module\BaseModeration; use Friendica\Module\BaseModeration;
@ -29,9 +31,9 @@ abstract class BaseUsers extends BaseModeration
/** @var Database */ /** @var Database */
protected $database; protected $database;
public function __construct(Database $database, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(Database $database, Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{ {
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->database = $database; $this->database = $database;
} }

View file

@ -7,7 +7,10 @@
namespace Friendica\Module\Moderation\Blocklist; namespace Friendica\Module\Moderation\Blocklist;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\AppHelper;
use Friendica\Content\Pager; use Friendica\Content\Pager;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
@ -18,7 +21,6 @@ use Friendica\Model;
use Friendica\Module\BaseModeration; use Friendica\Module\BaseModeration;
use Friendica\Module\Response; use Friendica\Module\Response;
use Friendica\Navigation\SystemMessages; use Friendica\Navigation\SystemMessages;
use Friendica\Util\Network;
use Friendica\Util\Profiler; use Friendica\Util\Profiler;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
@ -27,9 +29,9 @@ class Contact extends BaseModeration
/** @var Database */ /** @var Database */
private $database; private $database;
public function __construct(Database $database, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(Database $database, Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{ {
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->database = $database; $this->database = $database;
} }

View file

@ -7,7 +7,10 @@
namespace Friendica\Module\Moderation\Blocklist\Server; namespace Friendica\Module\Moderation\Blocklist\Server;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\AppHelper;
use Friendica\Content\ContactSelector; use Friendica\Content\ContactSelector;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
@ -29,7 +32,7 @@ class Add extends BaseModeration
/** @var DomainPatternBlocklist */ /** @var DomainPatternBlocklist */
private $blocklist; private $blocklist;
public function __construct(DomainPatternBlocklist $blocklist, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(DomainPatternBlocklist $blocklist, Page $page, AppHelper $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{ {
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);

View file

@ -7,7 +7,10 @@
namespace Friendica\Module\Moderation\Blocklist\Server; namespace Friendica\Module\Moderation\Blocklist\Server;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\AppHelper;
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;
@ -27,9 +30,9 @@ class Import extends \Friendica\Module\BaseModeration
/** @var array of blocked server domain patterns */ /** @var array of blocked server domain patterns */
private $blocklist = []; private $blocklist = [];
public function __construct(DomainPatternBlocklist $localBlocklist, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(DomainPatternBlocklist $localBlocklist, Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{ {
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->localBlocklist = $localBlocklist; $this->localBlocklist = $localBlocklist;
} }

View file

@ -7,7 +7,10 @@
namespace Friendica\Module\Moderation\Blocklist\Server; namespace Friendica\Module\Moderation\Blocklist\Server;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\AppHelper;
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;
@ -24,9 +27,9 @@ class Index extends BaseModeration
/** @var DomainPatternBlocklist */ /** @var DomainPatternBlocklist */
private $blocklist; private $blocklist;
public function __construct(DomainPatternBlocklist $blocklist, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(DomainPatternBlocklist $blocklist, Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{ {
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->blocklist = $blocklist; $this->blocklist = $blocklist;
} }

View file

@ -7,7 +7,10 @@
namespace Friendica\Module\Moderation\Item; namespace Friendica\Module\Moderation\Item;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\AppHelper;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n; use Friendica\Core\L10n;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
@ -24,9 +27,9 @@ class Source extends BaseModeration
/** @var IManageConfigValues */ /** @var IManageConfigValues */
private $config; private $config;
public function __construct(IManageConfigValues $config, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(IManageConfigValues $config, Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{ {
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->config = $config; $this->config = $config;
} }

View file

@ -7,7 +7,10 @@
namespace Friendica\Module\Moderation; namespace Friendica\Module\Moderation;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\AppHelper;
use Friendica\Content\Pager; use Friendica\Content\Pager;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\L10n; use Friendica\Core\L10n;
@ -27,9 +30,9 @@ class Reports extends BaseModeration
/** @var Database */ /** @var Database */
private $database; private $database;
public function __construct(Database $database, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(Database $database, Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{ {
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->database = $database; $this->database = $database;
} }

View file

@ -7,7 +7,10 @@
namespace Friendica\Module\Moderation; namespace Friendica\Module\Moderation;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\AppHelper;
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;
@ -24,9 +27,9 @@ class Summary extends BaseModeration
/** @var Database */ /** @var Database */
private $database; private $database;
public function __construct(Database $database, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(Database $database, Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
{ {
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->database = $database; $this->database = $database;
} }
@ -34,7 +37,7 @@ class Summary extends BaseModeration
protected function content(array $request = []): string protected function content(array $request = []): string
{ {
parent::content(); parent::content();
$accounts = [ $accounts = [
[$this->t('Personal Page'), 0], [$this->t('Personal Page'), 0],
[$this->t('Organisation Page'), 0], [$this->t('Organisation Page'), 0],

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,7 +7,9 @@
namespace Friendica\Module\Notifications; namespace Friendica\Module\Notifications;
use Friendica\App; use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Contact\Introduction\Repository\Introduction; use Friendica\Contact\Introduction\Repository\Introduction;
use Friendica\Content\GroupManager; use Friendica\Content\GroupManager;
@ -60,10 +62,10 @@ class Ping extends BaseModule
private $cache; private $cache;
/** @var Repository\Notify */ /** @var Repository\Notify */
private $notify; private $notify;
/** @var App */ /** @var AppHelper */
private $app; private $appHelper;
public function __construct(App $app, Repository\Notify $notify, ICanCache $cache, Database $database, IManagePersonalConfigValues $pconfig, IManageConfigValues $config, IHandleUserSessions $session, SystemMessages $systemMessages, Repository\Notification $notificationRepo, Introduction $introductionRepo, Factory\FormattedNavNotification $formattedNavNotification, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) public function __construct(AppHelper $appHelper, Repository\Notify $notify, ICanCache $cache, Database $database, IManagePersonalConfigValues $pconfig, IManageConfigValues $config, IHandleUserSessions $session, SystemMessages $systemMessages, Repository\Notification $notificationRepo, Introduction $introductionRepo, Factory\FormattedNavNotification $formattedNavNotification, 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);
@ -77,7 +79,7 @@ class Ping extends BaseModule
$this->database = $database; $this->database = $database;
$this->cache = $cache; $this->cache = $cache;
$this->notify = $notify; $this->notify = $notify;
$this->app = $app; $this->appHelper = $appHelper;
} }
protected function rawContent(array $request = []) protected function rawContent(array $request = [])

View file

@ -26,7 +26,7 @@ class Acknowledge extends BaseApi
protected function post(array $request = []) protected function post(array $request = [])
{ {
DI::session()->set('oauth_acknowledge', true); DI::session()->set('oauth_acknowledge', true);
DI::app()->redirect(DI::session()->get('return_path')); DI::appHelper()->redirect(DI::session()->get('return_path'));
} }
protected function content(array $request = []): string protected function content(array $request = []): string

View file

@ -60,14 +60,14 @@ class Authorize extends BaseApi
$uid = DI::userSession()->getLocalUserId(); $uid = DI::userSession()->getLocalUserId();
if (empty($uid)) { if (empty($uid)) {
Logger::info('Redirect to login'); Logger::info('Redirect to login');
DI::app()->redirect('login?' . http_build_query(['return_authorize' => $redirect])); DI::appHelper()->redirect('login?' . http_build_query(['return_authorize' => $redirect]));
} else { } else {
Logger::info('Already logged in user', ['uid' => $uid]); Logger::info('Already logged in user', ['uid' => $uid]);
} }
if (!OAuth::existsTokenForUser($application, $uid) && !DI::session()->get('oauth_acknowledge')) { if (!OAuth::existsTokenForUser($application, $uid) && !DI::session()->get('oauth_acknowledge')) {
Logger::info('Redirect to acknowledge'); Logger::info('Redirect to acknowledge');
DI::app()->redirect('oauth/acknowledge?' . http_build_query(['return_authorize' => $redirect, 'application' => $application['name']])); DI::appHelper()->redirect('oauth/acknowledge?' . http_build_query(['return_authorize' => $redirect, 'application' => $application['name']]));
} }
DI::session()->remove('oauth_acknowledge'); DI::session()->remove('oauth_acknowledge');
@ -78,7 +78,7 @@ class Authorize extends BaseApi
} }
if ($application['redirect_uri'] != 'urn:ietf:wg:oauth:2.0:oob') { if ($application['redirect_uri'] != 'urn:ietf:wg:oauth:2.0:oob') {
DI::app()->redirect($request['redirect_uri'] . (strpos($request['redirect_uri'], '?') ? '&' : '?') . http_build_query(['code' => $token['code'], 'state' => $request['state']])); DI::appHelper()->redirect($request['redirect_uri'] . (strpos($request['redirect_uri'], '?') ? '&' : '?') . http_build_query(['code' => $token['code'], 'state' => $request['state']]));
} }
self::$oauth_code = $token['code']; self::$oauth_code = $token['code'];

Some files were not shown because too many files have changed in this diff Show more