Merge branch 'develop' into phpstan-level-1

This commit is contained in:
Art4 2024-11-18 21:45:42 +00:00
commit c79f3cde22
150 changed files with 2429 additions and 1781 deletions

View file

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

View file

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

View file

@ -7,7 +7,7 @@
*
*/
use Friendica\App;
use Friendica\AppHelper;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
@ -15,7 +15,7 @@ use Friendica\Model\User;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
function lostpass_post(App $a)
function lostpass_post(AppHelper $a)
{
$loginame = trim($_POST['login-name']);
if (!$loginame) {
@ -78,7 +78,7 @@ function lostpass_post(App $a)
DI::baseUrl()->redirect();
}
function lostpass_content(App $a)
function lostpass_content(AppHelper $appHelper)
{
if (DI::args()->getArgc() > 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\Nav;
use Friendica\Content\Pager;
@ -17,7 +17,7 @@ use Friendica\Model\Item;
use Friendica\Model\Post;
use Friendica\Module\BaseProfile;
function notes_init(App $a)
function notes_init(AppHelper $appHelper)
{
if (! DI::userSession()->getLocalUserId()) {
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()) {
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
@ -46,11 +46,11 @@ function notes_content(App $a, bool $update = false)
'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,
'contact-id'=> $a->getContactId()];
'contact-id'=> $appHelper->getContactId()];
if (DI::mode()->isMobile()) {
$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\Database\DBA;
use Friendica\DI;
use Friendica\Model\Post;
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'])) {
$contact = DBA::selectFirst('account-user-view', ['pid', 'deleted'], ['id' => DI::args()->get(1)]);

View file

@ -8,13 +8,12 @@
* AJAX synchronisation of notes page
*/
use Friendica\App;
use Friendica\AppHelper;
use Friendica\Core\System;
use Friendica\DI;
require_once 'mod/notes.php';
function update_notes_content(App $a)
function update_notes_content(AppHelper $appHelper)
{
$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);
}

View file

@ -10,7 +10,10 @@ namespace Friendica;
use Exception;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Mode;
use Friendica\App\Page;
use Friendica\App\Request;
use Friendica\App\Router;
use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Content\Nav;
use Friendica\Core\Config\Factory\Config;
@ -18,14 +21,13 @@ use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Database\Definition\DbaDefinition;
use Friendica\Database\Definition\ViewDefinition;
use Friendica\Module\Maintenance;
use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Security\Authentication;
use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\L10n;
use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Database\Database;
use Friendica\Module\Special\HTTPException as ModuleHTTPException;
use Friendica\Network\HTTPException;
use Friendica\Protocol\ATProtocol\DID;
@ -34,7 +36,6 @@ use Friendica\Util\DateTimeFormat;
use Friendica\Util\HTTPInputData;
use Friendica\Util\HTTPSignature;
use Friendica\Util\Profiler;
use Friendica\Util\Strings;
use Psr\Log\LoggerInterface;
/**
@ -47,26 +48,14 @@ use Psr\Log\LoggerInterface;
* before we spit the page out.
*
*/
class App
class App implements AppHelper
{
const PLATFORM = 'Friendica';
const CODENAME = 'Yellow Archangel';
const VERSION = '2024.12-dev';
// Allow themes to control internal parameters
// by changing App values in theme.php
private $theme_info = [
'videowidth' => 425,
'videoheight' => 350,
];
private $timezone = '';
private $profile_owner = 0;
private $contact_id = 0;
private $queue = [];
/**
* @var App\Mode The Mode of the Application
* @var Mode The Mode of the Application
*/
private $mode;
@ -75,11 +64,6 @@ class App
*/
private $baseURL;
/** @var string The name of the current theme */
private $currentTheme;
/** @var string The name of the current mobile theme */
private $currentMobileTheme;
/** @var string */
private $requestId;
@ -101,11 +85,6 @@ class App
*/
private $profiler;
/**
* @var Database The Friendica database connection
*/
private $database;
/**
* @var L10n The translator
*/
@ -116,166 +95,32 @@ class App
*/
private $args;
/**
* @var IManagePersonalConfigValues
*/
private $pConfig;
/**
* @var IHandleUserSessions
*/
private $session;
/**
* Set the profile owner ID
*
* @param int $owner_id
* @return void
* @var AppHelper $appHelper
*/
public function setProfileOwner(int $owner_id)
{
$this->profile_owner = $owner_id;
}
private $appHelper;
/**
* Get the profile owner ID
*
* @return int
*/
public function getProfileOwner(): int
{
return $this->profile_owner;
}
/**
* Set the contact ID
*
* @param int $contact_id
* @return void
*/
public function setContactId(int $contact_id)
{
$this->contact_id = $contact_id;
}
/**
* Get the contact ID
*
* @return int
*/
public function getContactId(): int
{
return $this->contact_id;
}
/**
* Set the timezone
*
* @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
* @return void
*/
public function setTimeZone(string $timezone)
{
$this->timezone = (new \DateTimeZone($timezone))->getName();
DateTimeFormat::setLocalTimeZone($this->timezone);
}
/**
* Get the timezone
*
* @return int
*/
public function getTimeZone(): string
{
return $this->timezone;
}
/**
* Set workerqueue information
*
* @param array $queue
* @return void
*/
public function setQueue(array $queue)
{
$this->queue = $queue;
}
/**
* Fetch workerqueue information
*
* @return array Worker queue
*/
public function getQueue(): array
{
return $this->queue ?? [];
}
/**
* Fetch a specific workerqueue field
*
* @param string $index Work queue record to fetch
* @return mixed Work queue item or NULL if not found
*/
public function getQueueValue(string $index)
{
return $this->queue[$index] ?? null;
}
public function setThemeInfoValue(string $index, $value)
{
$this->theme_info[$index] = $value;
}
public function getThemeInfo()
{
return $this->theme_info;
}
public function getThemeInfoValue(string $index, $default = null)
{
return $this->theme_info[$index] ?? $default;
}
/**
* Returns the current config cache of this node
*
* @return Cache
*/
public function getConfigCache()
{
return $this->config->getCache();
}
/**
* The basepath of this app
*
* @return string Base path from configuration
*/
public function getBasePath(): string
{
return $this->config->get('system', 'basepath');
}
/**
* @param Database $database The Friendica Database
* @param IManageConfigValues $config The Configuration
* @param App\Mode $mode The mode of this Friendica app
* @param BaseURL $baseURL The full base URL of this Friendica app
* @param LoggerInterface $logger The current app logger
* @param Profiler $profiler The profiler of this application
* @param L10n $l10n The translator instance
* @param App\Arguments $args The Friendica Arguments of the call
* @param IManagePersonalConfigValues $pConfig Personal configuration
* @param IHandleUserSessions $session The (User)Session handler
* @param DbaDefinition $dbaDefinition
* @param ViewDefinition $viewDefinition
*/
public function __construct(Request $request, Authentication $auth, Database $database, IManageConfigValues $config, App\Mode $mode, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, IManagePersonalConfigValues $pConfig, IHandleUserSessions $session, DbaDefinition $dbaDefinition, ViewDefinition $viewDefinition)
{
public function __construct(
Request $request,
Authentication $auth,
IManageConfigValues $config,
Mode $mode,
BaseURL $baseURL,
LoggerInterface $logger,
Profiler $profiler,
L10n $l10n,
Arguments $args,
IHandleUserSessions $session,
DbaDefinition $dbaDefinition,
ViewDefinition $viewDefinition
) {
$this->requestId = $request->getRequestId();
$this->auth = $auth;
$this->database = $database;
$this->config = $config;
$this->mode = $mode;
$this->baseURL = $baseURL;
@ -283,12 +128,171 @@ class App
$this->logger = $logger;
$this->l10n = $l10n;
$this->args = $args;
$this->pConfig = $pConfig;
$this->session = $session;
$this->appHelper = DI::appHelper();
$this->load($dbaDefinition, $viewDefinition);
}
/**
* Set the profile owner ID
*
* @deprecated 2024.12 Use AppHelper::setProfileOwner() instead
*
* @param int $owner_id
* @return void
*/
public function setProfileOwner(int $owner_id)
{
$this->appHelper->setProfileOwner($owner_id);
}
/**
* Get the profile owner ID
*
* @deprecated 2024.12 Use AppHelper::getProfileOwner() instead
*
* @return int
*/
public function getProfileOwner(): int
{
return $this->appHelper->getProfileOwner();
}
/**
* Set the contact ID
*
* @deprecated 2024.12 Use AppHelper::setContactId() instead
*
* @param int $contact_id
* @return void
*/
public function setContactId(int $contact_id)
{
$this->appHelper->setContactId($contact_id);
}
/**
* Get the contact ID
*
* @deprecated 2024.12 Use AppHelper::getContactId() instead
*
* @return int
*/
public function getContactId(): int
{
return $this->appHelper->getContactId();
}
/**
* Set the timezone
*
* @deprecated 2024.12 Use AppHelper::setTimeZone() instead
*
* @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
* @return void
*/
public function setTimeZone(string $timezone)
{
$this->appHelper->setTimeZone($timezone);
}
/**
* Get the timezone
*
* @deprecated 2024.12 Use AppHelper::getTimeZone() instead
*/
public function getTimeZone(): string
{
return $this->appHelper->getTimeZone();
}
/**
* Set workerqueue information
*
* @deprecated 2024.12 Use AppHelper::setQueue() instead
*
* @param array $queue
* @return void
*/
public function setQueue(array $queue)
{
$this->appHelper->setQueue($queue);
}
/**
* Fetch workerqueue information
*
* @deprecated 2024.12 Use AppHelper::getQueue() instead
*
* @return array Worker queue
*/
public function getQueue(): array
{
return $this->appHelper->getQueue();
}
/**
* Fetch a specific workerqueue field
*
* @deprecated 2024.12 Use AppHelper::getQueueValue() instead
*
* @param string $index Work queue record to fetch
* @return mixed Work queue item or NULL if not found
*/
public function getQueueValue(string $index)
{
return $this->appHelper->getQueueValue($index);
}
/**
* @deprecated 2024.12 Use AppHelper::setThemeInfoValue() instead
*/
public function setThemeInfoValue(string $index, $value)
{
$this->appHelper->setThemeInfoValue($index, $value);
}
/**
* @deprecated 2024.12 Use AppHelper::getThemeInfo() instead
*/
public function getThemeInfo()
{
return $this->appHelper->getThemeInfo();
}
/**
* @deprecated 2024.12 Use AppHelper::getThemeInfoValue() instead
*/
public function getThemeInfoValue(string $index, $default = null)
{
return $this->appHelper->getThemeInfoValue($index, $default);
}
/**
* Returns the current config cache of this node
*
* @deprecated 2024.12 Use AppHelper::getConfigCache() instead
*
* @return Cache
*/
public function getConfigCache()
{
return $this->appHelper->getConfigCache();
}
/**
* The basepath of this app
*
* @deprecated 2024.12 Use AppHelper::getBasePath() instead
*
* @return string Base path from configuration
*/
public function getBasePath(): string
{
return $this->appHelper->getBasePath();
}
/**
* Load the whole app instance
*/
@ -310,17 +314,11 @@ class App
// Ensure that all "strtotime" operations do run timezone independent
date_default_timezone_set('UTC');
set_include_path(
get_include_path() . PATH_SEPARATOR
. $this->getBasePath() . DIRECTORY_SEPARATOR . 'include' . PATH_SEPARATOR
. $this->getBasePath() . DIRECTORY_SEPARATOR . 'library' . PATH_SEPARATOR
. $this->getBasePath());
$this->profiler->reset();
if ($this->mode->has(App\Mode::DBAVAILABLE)) {
if ($this->mode->has(Mode::DBAVAILABLE)) {
Core\Hook::loadHooks();
$loader = (new Config())->createConfigFileManager($this->getBasePath(), $_SERVER);
$loader = (new Config())->createConfigFileManager($this->appHelper->getBasePath(), $_SERVER);
Core\Hook::callAll('load_config', $loader);
// Hooks are now working, reload the whole definitions with hook enabled
@ -349,157 +347,70 @@ class App
$timezone = $default_timezone ?? '' ?: 'UTC';
}
$this->setTimeZone($timezone);
$this->appHelper->setTimeZone($timezone);
}
/**
* Returns the current theme name. May be overridden by the mobile theme name.
*
* @deprecated 2024.12 Use AppHelper::getCurrentTheme() instead
*
* @return string Current theme name or empty string in installation phase
* @throws Exception
*/
public function getCurrentTheme(): string
{
if ($this->mode->isInstall()) {
return '';
}
// Specific mobile theme override
if (($this->mode->isMobile() || $this->mode->isTablet()) && $this->session->get('show-mobile', true)) {
$user_mobile_theme = $this->getCurrentMobileTheme();
// --- means same mobile theme as desktop
if (!empty($user_mobile_theme) && $user_mobile_theme !== '---') {
return $user_mobile_theme;
}
}
if (!$this->currentTheme) {
$this->computeCurrentTheme();
}
return $this->currentTheme;
return $this->appHelper->getCurrentTheme();
}
/**
* Returns the current mobile theme name.
*
* @deprecated 2024.12 Use AppHelper::getCurrentMobileTheme() instead
*
* @return string Mobile theme name or empty string if installer
* @throws Exception
*/
public function getCurrentMobileTheme(): string
{
if ($this->mode->isInstall()) {
return '';
}
if (is_null($this->currentMobileTheme)) {
$this->computeCurrentMobileTheme();
}
return $this->currentMobileTheme;
return $this->appHelper->getCurrentMobileTheme();
}
/**
* Setter for current theme name
*
* @deprecated 2024.12 Use AppHelper::setCurrentTheme() instead
*
* @param string $theme Name of current theme
*/
public function setCurrentTheme(string $theme)
{
$this->currentTheme = $theme;
$this->appHelper->setCurrentTheme($theme);
}
/**
* Setter for current mobile theme name
*
* @deprecated 2024.12 Use AppHelper::setCurrentMobileTheme() instead
*
* @param string $theme Name of current mobile theme
*/
public function setCurrentMobileTheme(string $theme)
{
$this->currentMobileTheme = $theme;
}
/**
* Computes the current theme name based on the node settings, the page owner settings and the user settings
*
* @throws Exception
*/
private function computeCurrentTheme()
{
$system_theme = $this->config->get('system', 'theme');
if (!$system_theme) {
throw new Exception($this->l10n->t('No system theme config value set.'));
}
// Sane default
$this->setCurrentTheme($system_theme);
$page_theme = null;
// Find the theme that belongs to the user whose stuff we are looking at
if (!empty($this->profile_owner) && ($this->profile_owner != $this->session->getLocalUserId())) {
// Allow folks to override user themes and always use their own on their own site.
// This works only if the user is on the same server
$user = $this->database->selectFirst('user', ['theme'], ['uid' => $this->profile_owner]);
if ($this->database->isResult($user) && !$this->session->getLocalUserId()) {
$page_theme = $user['theme'];
}
}
$theme_name = $page_theme ?: $this->session->get('theme', $system_theme);
$theme_name = Strings::sanitizeFilePathItem($theme_name);
if ($theme_name
&& in_array($theme_name, Theme::getAllowedList())
&& (file_exists('view/theme/' . $theme_name . '/style.css')
|| file_exists('view/theme/' . $theme_name . '/style.php'))
) {
$this->setCurrentTheme($theme_name);
}
}
/**
* Computes the current mobile theme name based on the node settings, the page owner settings and the user settings
*/
private function computeCurrentMobileTheme()
{
$system_mobile_theme = $this->config->get('system', 'mobile-theme', '');
// Sane default
$this->setCurrentMobileTheme($system_mobile_theme);
$page_mobile_theme = null;
// Find the theme that belongs to the user whose stuff we are looking at
if (!empty($this->profile_owner) && ($this->profile_owner != $this->session->getLocalUserId())) {
// Allow folks to override user themes and always use their own on their own site.
// This works only if the user is on the same server
if (!$this->session->getLocalUserId()) {
$page_mobile_theme = $this->pConfig->get($this->profile_owner, 'system', 'mobile-theme');
}
}
$mobile_theme_name = $page_mobile_theme ?: $this->session->get('mobile-theme', $system_mobile_theme);
$mobile_theme_name = Strings::sanitizeFilePathItem($mobile_theme_name);
if ($mobile_theme_name == '---'
||
in_array($mobile_theme_name, Theme::getAllowedList())
&& (file_exists('view/theme/' . $mobile_theme_name . '/style.css')
|| file_exists('view/theme/' . $mobile_theme_name . '/style.php'))
) {
$this->setCurrentMobileTheme($mobile_theme_name);
}
$this->appHelper->setCurrentMobileTheme($theme);
}
/**
* Provide a sane default if nothing is chosen or the specified theme does not exist.
*
* @deprecated 2024.12 Use AppHelper::getCurrentThemeStylesheetPath() instead
*
* @return string Current theme's stylesheet path
* @throws Exception
*/
public function getCurrentThemeStylesheetPath(): string
{
return Core\Theme::getStylesheetPath($this->getCurrentTheme());
return $this->appHelper->getCurrentThemeStylesheetPath();
}
/**
@ -510,10 +421,10 @@ class App
*
* This probably should change to limit the size of this monster method.
*
* @param App\Router $router
* @param Router $router
* @param IManagePersonalConfigValues $pconfig
* @param Authentication $auth The Authentication backend of the node
* @param App\Page $page The Friendica page printing container
* @param Page $page The Friendica page printing container
* @param ModuleHTTPException $httpException The possible HTTP Exception container
* @param HTTPInputData $httpInput A library for processing PHP input streams
* @param float $start_time The start time of the overall script execution
@ -522,8 +433,17 @@ class App
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public function runFrontend(App\Router $router, IManagePersonalConfigValues $pconfig, Authentication $auth, App\Page $page, Nav $nav, ModuleHTTPException $httpException, HTTPInputData $httpInput, float $start_time, array $server)
{
public function runFrontend(
Router $router,
IManagePersonalConfigValues $pconfig,
Authentication $auth,
Page $page,
Nav $nav,
ModuleHTTPException $httpException,
HTTPInputData $httpInput,
float $start_time,
array $server
) {
$requeststring = ($server['REQUEST_METHOD'] ?? '') . ' ' . ($server['REQUEST_URI'] ?? '') . ' ' . ($server['SERVER_PROTOCOL'] ?? '');
$this->logger->debug('Request received', ['address' => $server['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $server['HTTP_REFERER'] ?? '', 'user-agent' => $server['HTTP_USER_AGENT'] ?? '']);
$request_start = microtime(true);
@ -536,7 +456,7 @@ class App
try {
// Missing DB connection: ERROR
if ($this->mode->has(App\Mode::LOCALCONFIGPRESENT) && !$this->mode->has(App\Mode::DBAVAILABLE)) {
if ($this->mode->has(Mode::LOCALCONFIGPRESENT) && !$this->mode->has(Mode::DBAVAILABLE)) {
throw new HTTPException\InternalServerErrorException($this->l10n->t('Apologies but the website is unavailable at the moment.'));
}
@ -583,7 +503,7 @@ class App
}
if (!$this->mode->isBackend()) {
$auth->withSession($this);
$auth->withSession();
}
if ($this->session->isUnauthenticated()) {
@ -601,7 +521,7 @@ class App
if ($this->mode->isInstall() && $moduleName !== 'install') {
$this->baseURL->redirect('install');
} else {
Core\Update::check($this->getBasePath(), false);
Core\Update::check($this->appHelper->getBasePath(), false);
Core\Addon::loadAddons();
Core\Hook::loadHooks();
}
@ -648,7 +568,7 @@ class App
$page['page_title'] = $moduleName;
// The "view" module is required to show the theme CSS
if (!$this->mode->isInstall() && !$this->mode->has(App\Mode::MAINTENANCEDISABLED) && $moduleName !== 'view') {
if (!$this->mode->isInstall() && !$this->mode->has(Mode::MAINTENANCEDISABLED) && $moduleName !== 'view') {
$module = $router->getModule(Maintenance::class);
} else {
// determine the module class and save it to the module instance
@ -688,17 +608,15 @@ class App
* Automatically redirects to relative or absolute URL
* Should only be used if it isn't clear if the URL is either internal or external
*
* @deprecated 2024.12 Use AppHelper::redirect() instead
*
* @param string $toUrl The target URL
*
* @throws HTTPException\InternalServerErrorException
* @throws InternalServerErrorException
*/
public function redirect(string $toUrl)
{
if (!empty(parse_url($toUrl, PHP_URL_SCHEME))) {
Core\System::externalRedirect($toUrl);
} else {
$this->baseURL->redirect($toUrl);
}
$this->appHelper->redirect($toUrl);
}
/**

View file

@ -11,6 +11,7 @@ use ArrayAccess;
use DOMDocument;
use DOMXPath;
use Friendica\App;
use Friendica\AppHelper;
use Friendica\Content\Nav;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Hook;
@ -21,7 +22,6 @@ use Friendica\Core\Renderer;
use Friendica\Core\Session\Model\UserSession;
use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Module\Response;
use Friendica\Network\HTTPException;
use Friendica\Util\Images;
use Friendica\Util\Network;
@ -176,7 +176,6 @@ class Page implements ArrayAccess
* - Infinite scroll data
* - head.tpl template
*
* @param App $app The Friendica App instance
* @param Arguments $args The Friendica App Arguments
* @param L10n $l10n The l10n language instance
* @param IManageConfigValues $config The Friendica configuration
@ -185,8 +184,14 @@ class Page implements ArrayAccess
*
* @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);
// 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'])) {
$stylesheet = Renderer::$theme['stylesheet'];
} else {
$stylesheet = $app->getCurrentThemeStylesheetPath();
$stylesheet = $appHelper->getCurrentThemeStylesheetPath();
}
$this->registerStylesheet($stylesheet);
@ -313,7 +318,6 @@ class Page implements ArrayAccess
* - Registered footer scripts (through App->registerFooterScript())
* - footer.tpl template
*
* @param App $app The Friendica App instance
* @param Mode $mode The Friendica runtime mode
* @param L10n $l10n The l10n instance
*
@ -399,7 +403,6 @@ class Page implements ArrayAccess
/**
* 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 Arguments $args The Friendica App arguments
* @param Mode $mode The current node mode
@ -414,8 +417,20 @@ class Page implements ArrayAccess
* @throws HTTPException\InternalServerErrorException
* @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();
$this->command = $moduleName;
@ -430,7 +445,7 @@ class Page implements ArrayAccess
$this->initContent($response, $mode);
// 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';
if (file_exists($theme_info_file)) {
require_once $theme_info_file;
@ -438,7 +453,7 @@ class Page implements ArrayAccess
if (function_exists(str_replace('-', '_', $currentTheme) . '_init')) {
$func = str_replace('-', '_', $currentTheme) . '_init';
$func($app);
$func($appHelper);
}
/* 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
* 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
* the closing </body> tag
@ -534,7 +549,7 @@ class Page implements ArrayAccess
}
// Theme templates expect $a as an App instance
$a = $app;
$a = $appHelper;
// Used as is in view/php/default.php
$lang = $l10n->getCurrentLang();

139
src/AppHelper.php Normal file
View file

@ -0,0 +1,139 @@
<?php
// Copyright (C) 2010-2024, the Friendica project
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica;
use Exception;
use Friendica\Core\Config\ValueObject\Cache;
/**
* Helper for our main application structure for the life of this page.
*
* Primarily deals with the URL that got us here
* and tries to make some sense of it, and
* stores our page contents and config storage
* and anything else that might need to be passed around
* before we spit the page out.
*
*/
interface AppHelper
{
/**
* Set the profile owner ID
*/
public function setProfileOwner(int $owner_id);
/**
* Get the profile owner ID
*/
public function getProfileOwner(): int;
/**
* Set the timezone
*
* @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
*/
public function setTimeZone(string $timezone);
/**
* Get the timezone name
*/
public function getTimeZone(): string;
/**
* Set the contact ID
*/
public function setContactId(int $contact_id);
/**
* Get the contact ID
*/
public function getContactId(): int;
/**
* Set workerqueue information
*
* @param array<string,mixed> $queue
*/
public function setQueue(array $queue);
/**
* Fetch workerqueue information
*
* @return array<string,mixed> Worker queue
*/
public function getQueue();
/**
* Fetch a specific workerqueue field
*
* @param string $index Work queue record to fetch
*
* @return mixed|null Work queue item or NULL if not found
*/
public function getQueueValue(string $index);
/**
* Returns the current theme name. May be overridden by the mobile theme name.
*
* @return string Current theme name or empty string in installation phase
* @throws Exception
*/
public function getCurrentTheme(): string;
/**
* Returns the current mobile theme name.
*
* @return string Mobile theme name or empty string if installer
* @throws Exception
*/
public function getCurrentMobileTheme(): string;
/**
* Setter for current theme name
*
* @param string $theme Name of current theme
*/
public function setCurrentTheme(string $theme);
/**
* Setter for current mobile theme name
*
* @param string $theme Name of current mobile theme
*/
public function setCurrentMobileTheme(string $theme);
public function setThemeInfoValue(string $index, $value);
public function getThemeInfo();
public function getThemeInfoValue(string $index, $default = null);
/**
* Provide a sane default if nothing is chosen or the specified theme does not exist.
*
* @return string Current theme's stylesheet path
* @throws Exception
*/
public function getCurrentThemeStylesheetPath(): string;
/**
* Returns the current config cache of this node
*
* @return Cache
*/
public function getConfigCache();
/**
* The basepath of this app
*
* @return string Base path from configuration
*/
public function getBasePath(): string;
public function redirect(string $toUrl);
}

399
src/AppLegacy.php Normal file
View file

@ -0,0 +1,399 @@
<?php
// Copyright (C) 2010-2024, the Friendica project
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
//
// SPDX-License-Identifier: AGPL-3.0-or-later
namespace Friendica;
use DateTimeZone;
use Exception;
use Friendica\App\BaseURL;
use Friendica\App\Mode;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Core\Theme;
use Friendica\Database\Database;
use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Strings;
/**
* Helper for our main application structure for the life of this page.
*
* Primarily deals with the URL that got us here
* and tries to make some sense of it, and
* stores our page contents and config storage
* and anything else that might need to be passed around
* before we spit the page out.
*
*/
final class AppLegacy implements AppHelper
{
private $profile_owner = 0;
private $timezone = '';
private $contact_id = 0;
private $queue = [];
/** @var string The name of the current theme */
private $currentTheme;
/** @var string The name of the current mobile theme */
private $currentMobileTheme;
// Allow themes to control internal parameters
// by changing App values in theme.php
private $theme_info = [
'videowidth' => 425,
'videoheight' => 350,
];
/**
* @var Database The Friendica database connection
*/
private $database;
/**
* @var IManageConfigValues The config
*/
private $config;
/**
* @var Mode The Mode of the Application
*/
private $mode;
/**
* @var BaseURL
*/
private $baseURL;
/**
* @var L10n The translator
*/
private $l10n;
/**
* @var IManagePersonalConfigValues
*/
private $pConfig;
/**
* @var IHandleUserSessions
*/
private $session;
public function __construct(
Database $database,
IManageConfigValues $config,
Mode $mode,
BaseURL $baseURL,
L10n $l10n,
IManagePersonalConfigValues $pConfig,
IHandleUserSessions $session
) {
$this->database = $database;
$this->config = $config;
$this->mode = $mode;
$this->l10n = $l10n;
$this->baseURL = $baseURL;
$this->pConfig = $pConfig;
$this->session = $session;
}
/**
* Set the profile owner ID
*/
public function setProfileOwner(int $owner_id): void
{
$this->profile_owner = $owner_id;
}
/**
* Get the profile owner ID
*/
public function getProfileOwner(): int
{
return $this->profile_owner;
}
/**
* Set the timezone
*
* @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
*/
public function setTimeZone(string $timezone): void
{
$this->timezone = (new DateTimeZone($timezone))->getName();
DateTimeFormat::setLocalTimeZone($this->timezone);
}
/**
* Get the timezone name
*/
public function getTimeZone(): string
{
return $this->timezone;
}
/**
* Set the contact ID
*/
public function setContactId(int $contact_id): void
{
$this->contact_id = $contact_id;
}
/**
* Get the contact ID
*/
public function getContactId(): int
{
return $this->contact_id;
}
/**
* Set workerqueue information
*
* @param array<string,mixed> $queue
*/
public function setQueue(array $queue): void
{
$this->queue = $queue;
}
/**
* Fetch workerqueue information
*
* @return array<string,mixed> Worker queue
*/
public function getQueue(): array
{
return $this->queue;
}
/**
* Fetch a specific workerqueue field
*
* @param string $index Work queue record to fetch
*
* @return mixed|null Work queue item or NULL if not found
*/
public function getQueueValue(string $index)
{
return $this->queue[$index] ?? null;
}
/**
* Returns the current theme name. May be overridden by the mobile theme name.
*
* @return string Current theme name or empty string in installation phase
* @throws Exception
*/
public function getCurrentTheme(): string
{
if ($this->mode->isInstall()) {
return '';
}
// Specific mobile theme override
if (($this->mode->isMobile() || $this->mode->isTablet()) && $this->session->get('show-mobile', true)) {
$user_mobile_theme = $this->getCurrentMobileTheme();
// --- means same mobile theme as desktop
if (!empty($user_mobile_theme) && $user_mobile_theme !== '---') {
return $user_mobile_theme;
}
}
if (!$this->currentTheme) {
$this->computeCurrentTheme();
}
return $this->currentTheme;
}
/**
* Returns the current mobile theme name.
*
* @return string Mobile theme name or empty string if installer
* @throws Exception
*/
public function getCurrentMobileTheme(): string
{
if ($this->mode->isInstall()) {
return '';
}
if (is_null($this->currentMobileTheme)) {
$this->computeCurrentMobileTheme();
}
return $this->currentMobileTheme;
}
/**
* Setter for current theme name
*
* @param string $theme Name of current theme
*/
public function setCurrentTheme(string $theme): void
{
$this->currentTheme = $theme;
}
/**
* Setter for current mobile theme name
*
* @param string $theme Name of current mobile theme
*/
public function setCurrentMobileTheme(string $theme): void
{
$this->currentMobileTheme = $theme;
}
public function setThemeInfoValue(string $index, $value): void
{
$this->theme_info[$index] = $value;
}
public function getThemeInfo(): array
{
return $this->theme_info;
}
public function getThemeInfoValue(string $index, $default = null)
{
return $this->theme_info[$index] ?? $default;
}
/**
* Provide a sane default if nothing is chosen or the specified theme does not exist.
*
* @return string Current theme's stylesheet path
* @throws Exception
*/
public function getCurrentThemeStylesheetPath(): string
{
return Theme::getStylesheetPath($this->getCurrentTheme());
}
/**
* Returns the current config cache of this node
*/
public function getConfigCache(): Cache
{
return $this->config->getCache();
}
/**
* The basepath of this app
*
* @return string Base path from configuration
*/
public function getBasePath(): string
{
return $this->config->get('system', 'basepath');
}
/**
* Computes the current theme name based on the node settings, the page owner settings and the user settings
*
* @throws Exception
*/
private function computeCurrentTheme()
{
$system_theme = $this->config->get('system', 'theme');
if (!$system_theme) {
throw new Exception($this->l10n->t('No system theme config value set.'));
}
// Sane default
$this->setCurrentTheme($system_theme);
$page_theme = null;
$profile_owner = $this->getProfileOwner();
// Find the theme that belongs to the user whose stuff we are looking at
if (!empty($profile_owner) && ($profile_owner != $this->session->getLocalUserId())) {
// Allow folks to override user themes and always use their own on their own site.
// This works only if the user is on the same server
$user = $this->database->selectFirst('user', ['theme'], ['uid' => $profile_owner]);
if ($this->database->isResult($user) && !$this->session->getLocalUserId()) {
$page_theme = $user['theme'];
}
}
$theme_name = $page_theme ?: $this->session->get('theme', $system_theme);
$theme_name = Strings::sanitizeFilePathItem($theme_name);
if ($theme_name
&& in_array($theme_name, Theme::getAllowedList())
&& (file_exists('view/theme/' . $theme_name . '/style.css')
|| file_exists('view/theme/' . $theme_name . '/style.php'))
) {
$this->setCurrentTheme($theme_name);
}
}
/**
* Computes the current mobile theme name based on the node settings, the page owner settings and the user settings
*/
private function computeCurrentMobileTheme()
{
$system_mobile_theme = $this->config->get('system', 'mobile-theme', '');
// Sane default
$this->setCurrentMobileTheme($system_mobile_theme);
$page_mobile_theme = null;
$profile_owner = $this->getProfileOwner();
// Find the theme that belongs to the user whose stuff we are looking at
if (!empty($profile_owner) && ($profile_owner != $this->session->getLocalUserId())) {
// Allow folks to override user themes and always use their own on their own site.
// This works only if the user is on the same server
if (!$this->session->getLocalUserId()) {
$page_mobile_theme = $this->pConfig->get($profile_owner, 'system', 'mobile-theme');
}
}
$mobile_theme_name = $page_mobile_theme ?: $this->session->get('mobile-theme', $system_mobile_theme);
$mobile_theme_name = Strings::sanitizeFilePathItem($mobile_theme_name);
if ($mobile_theme_name == '---'
||
in_array($mobile_theme_name, Theme::getAllowedList())
&& (file_exists('view/theme/' . $mobile_theme_name . '/style.css')
|| file_exists('view/theme/' . $mobile_theme_name . '/style.php'))
) {
$this->setCurrentMobileTheme($mobile_theme_name);
}
}
/**
* Automatically redirects to relative or absolute URL
* Should only be used if it isn't clear if the URL is either internal or external
*
* @param string $toUrl The target URL
*
* @throws InternalServerErrorException
*/
public function redirect(string $toUrl)
{
if (!empty(parse_url($toUrl, PHP_URL_SCHEME))) {
System::externalRedirect($toUrl);
} else {
$this->baseURL->redirect($toUrl);
}
}
}

View file

@ -8,8 +8,7 @@
namespace Friendica\Console;
use Console_Table;
use Friendica\App;
use Friendica\Content\Pager;
use Friendica\App\Mode;
use Friendica\Core\L10n;
use Friendica\Core\Addon as AddonCore;
use Friendica\Database\Database;
@ -24,7 +23,7 @@ class Addon extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
@ -57,7 +56,7 @@ 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);

View file

@ -7,7 +7,7 @@
namespace Friendica\Console;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Database\Database;
use Friendica\DI;
use Friendica\Model\Contact;
@ -28,7 +28,7 @@ class ArchiveContact extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
@ -57,7 +57,7 @@ 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);

View file

@ -9,8 +9,7 @@ namespace Friendica\Console;
use Asika\SimpleConsole\Console;
use Exception;
use Friendica\App;
use Friendica\App\BaseURL;
use Friendica\App\Mode;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Installer;
@ -21,7 +20,7 @@ use RuntimeException;
class AutomaticInstallation extends Console
{
/** @var App\Mode */
/** @var Mode */
private $appMode;
/** @var \Friendica\Core\Config\ValueObject\Cache */
private $configCache;
@ -87,7 +86,7 @@ Examples
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);

View file

@ -8,7 +8,7 @@
namespace Friendica\Console;
use Asika\SimpleConsole\CommandArgsException;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Core\Cache\Enum\Duration;
use Friendica\Core\Cache\Capability\ICanCache;
use RuntimeException;
@ -25,7 +25,7 @@ class Cache extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
@ -68,7 +68,7 @@ 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);
@ -85,7 +85,7 @@ HELP;
$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');
}

View file

@ -8,7 +8,7 @@
namespace Friendica\Console;
use Asika\SimpleConsole\CommandArgsException;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Core\Config\Capability\IManageConfigValues;
use RuntimeException;
@ -38,7 +38,7 @@ class Config extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
@ -80,7 +80,7 @@ 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);

View file

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

View file

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

View file

@ -7,7 +7,7 @@
namespace Friendica\Console;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Core\L10n;
use Friendica\Model\Contact;
@ -22,7 +22,7 @@ class GlobalCommunityBlock extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
@ -48,7 +48,7 @@ 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);

View file

@ -8,7 +8,7 @@
namespace Friendica\Console;
use Asika\SimpleConsole\CommandArgsException;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Core\Lock\Capability\ICanLock;
use RuntimeException;
@ -23,7 +23,7 @@ class Lock extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
@ -62,7 +62,7 @@ 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);
@ -79,7 +79,7 @@ HELP;
$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');
}

View file

@ -7,7 +7,7 @@
namespace Friendica\Console;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Core\Config\Capability\IManageConfigValues;
/**
@ -18,7 +18,7 @@ class Maintenance extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
@ -55,7 +55,7 @@ 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);

View file

@ -7,7 +7,8 @@
namespace Friendica\Console;
use Friendica\App;
use Friendica\AppHelper;
use stdClass;
/**
* 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 = [];
const NORM_REGEXP = "|[\\\]|";
/** @var App */
private $app;
/** @var AppHelper */
private $appHelper;
public function __construct(App $app, array $argv = null)
public function __construct(AppHelper $appHelper, array $argv = null)
{
parent::__construct($argv);
$this->app = $app;
$this->appHelper = $appHelper;
}
protected function getHelp()
@ -66,7 +67,8 @@ HELP;
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
}
$a = $this->app;
$a = new stdClass();
$a->strings = [];
$phpfile = realpath($this->getArgument(0));

View file

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

View file

@ -8,7 +8,7 @@
namespace Friendica\Console;
use Console_Table;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\Content\Pager;
use Friendica\Core\L10n;
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
@ -26,7 +26,7 @@ class User extends \Asika\SimpleConsole\Console
protected $helpOptions = ['h', 'help', '?'];
/**
* @var App\Mode
* @var Mode
*/
private $appMode;
/**
@ -74,7 +74,7 @@ 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);

View file

@ -7,9 +7,11 @@
namespace Friendica\Content;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Mode;
use Friendica\App\Page;
use Friendica\AppHelper;
use Friendica\BaseModule;
use Friendica\Core\ACL;
use Friendica\Core\Config\Capability\IManageConfigValues;
@ -32,8 +34,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Object\Post as PostObject;
use Friendica\Object\Thread;
use Friendica\Protocol\Activity;
use Friendica\User\Settings\Entity\UserGServer;
use Friendica\User\Settings\Repository;
use Friendica\User\Settings\Repository\UserGServer;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Profiler;
@ -64,7 +65,7 @@ class Conversation
private $logger;
/** @var Item */
private $item;
/** @var App\Arguments */
/** @var Arguments */
private $args;
/** @var IManagePersonalConfigValues */
private $pConfig;
@ -72,18 +73,18 @@ class Conversation
private $baseURL;
/** @var IManageConfigValues */
private $config;
/** @var App */
private $app;
/** @var App\Page */
/** @var AppHelper */
private $appHelper;
/** @var Page */
private $page;
/** @var App\Mode */
/** @var Mode */
private $mode;
/** @var IHandleUserSessions */
private $session;
/** @var Repository\UserGServer */
/** @var 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->item = $item;
@ -96,7 +97,7 @@ class Conversation
$this->args = $args;
$this->pConfig = $pConfig;
$this->page = $page;
$this->app = $app;
$this->appHelper = $appHelper;
$this->session = $session;
$this->userGServer = $userGServer;
}

View file

@ -7,8 +7,8 @@
namespace Friendica\Content;
use Friendica\App;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\BBCode\Video;
use Friendica\Content\Text\HTML;
@ -66,10 +66,10 @@ class Item
private $baseURL;
/** @var Emailer */
private $emailer;
/** @var App */
private $app;
/** @var AppHelper */
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->activity = $activity;
@ -80,7 +80,7 @@ class Item
$this->baseURL = $baseURL;
$this->pConfig = $pConfig;
$this->emailer = $emailer;
$this->app = $app;
$this->appHelper = $appHelper;
}
/**

View file

@ -48,11 +48,11 @@ class OEmbed
{
$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);
if (DBA::isResult($oembed_record)) {
$json_string = $oembed_record['content'];
@ -88,7 +88,7 @@ class OEmbed
// but their OEmbed endpoint is only accessible by HTTPS ¯\_(ツ)_/¯
$href = str_replace(['http://www.youtube.com/', 'http://player.vimeo.com/'],
['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()) {
$json_string = $result->getBodyString();
break;
@ -109,7 +109,7 @@ class OEmbed
if (!empty($oembed->type) && $oembed->type != 'error') {
DBA::insert('oembed', [
'url' => Strings::normaliseLink($embedurl),
'maxwidth' => $a->getThemeInfoValue('videowidth'),
'maxwidth' => $appHelper->getThemeInfoValue('videowidth'),
'content' => $json_string,
'created' => DateTimeFormat::utcNow()
], Database::INSERT_UPDATE);

View file

@ -1926,19 +1926,20 @@ class BBCode
private static function convertVideoPlatformsToHtml(string $text, bool $try_oembed): string
{
$a = DI::app();
$appHelper = DI::appHelper();
$text = self::normalizeVideoLinks($text);
// Youtube extensions
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 {
$text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '[url]https://www.youtube.com/watch?v=$1[/url]', $text);
}
// Vimeo extensions
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 {
$text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '[url]https://vimeo.com/$1[/url]', $text);
}

View file

@ -7,7 +7,6 @@
namespace Friendica\Core;
use Friendica\App;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Util\Strings;
@ -81,7 +80,7 @@ class Hook
*/
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];
if (DBA::exists('hook', $condition)) {
@ -102,7 +101,7 @@ class Hook
*/
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
$condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
@ -198,7 +197,7 @@ class Hook
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
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;
}

View file

@ -155,9 +155,9 @@ class Renderer
if (isset(self::$template_engine_instance[$template_engine])) {
return self::$template_engine_instance[$template_engine];
} else {
$a = DI::app();
$appHelper = DI::appHelper();
$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;
return $obj;
}

View file

@ -7,7 +7,8 @@
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\Type\DatabaseCache;
use Friendica\Core\Config\Capability\IManageConfigValues;
@ -33,8 +34,8 @@ class Session
const HANDLER_DEFAULT = self::HANDLER_DATABASE;
/**
* @param App\Mode $mode
* @param App\BaseURL $baseURL
* @param Mode $mode
* @param BaseURL $baseURL
* @param IManageConfigValues $config
* @param Database $dba
* @param Cache $cacheFactory
@ -43,7 +44,7 @@ class Session
* @param array $server
* @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');
$session_handler = $config->get('system', 'session_handler', self::HANDLER_DEFAULT);

View file

@ -7,7 +7,7 @@
namespace Friendica\Core\Session\Type;
use Friendica\App;
use Friendica\App\BaseURL;
use Friendica\Core\Session\Capability\IHandleSessions;
use Friendica\Model\User\Cookie;
use SessionHandlerInterface;
@ -17,7 +17,7 @@ use SessionHandlerInterface;
*/
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.use_only_cookies', 1);

View file

@ -208,11 +208,11 @@ class Theme
*/
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 = [
"view/theme/$theme/$file",
@ -245,11 +245,11 @@ class Theme
return 'view/theme/' . $theme . '/style.css';
}
$a = DI::app();
$appHelper = DI::appHelper();
$query_params = [];
$puid = Profile::getThemeUid($a);
$puid = Profile::getThemeUid($appHelper);
if ($puid) {
$query_params['puid'] = $puid;
}
@ -267,8 +267,8 @@ class Theme
{
$theme = Strings::sanitizeFilePathItem($theme);
$a = DI::app();
$base_theme = $a->getThemeInfoValue('extends') ?? '';
$appHelper = DI::appHelper();
$base_theme = $appHelper->getThemeInfoValue('extends') ?? '';
if (file_exists("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 boolean $via_worker Is the check run via the worker?
* @param App\Mode $mode The current app mode
* @return void
* @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)
{
$a = DI::app();
$appHelper = DI::appHelper();
self::coolDown();
@ -547,7 +547,7 @@ class Worker
// For this reason the variables have to be initialized.
DI::profiler()->reset();
$a->setQueue($queue);
$appHelper->setQueue($queue);
$up_duration = microtime(true) - self::$up_start;
@ -571,7 +571,7 @@ class Worker
Logger::disableWorker();
$a->setQueue([]);
$appHelper->setQueue([]);
$duration = (microtime(true) - $stamp);
@ -1371,7 +1371,7 @@ class Worker
*/
public static function getRetrial(): int
{
$queue = DI::app()->getQueue();
$queue = DI::appHelper()->getQueue();
return $queue['retrial'] ?? 0;
}
@ -1384,7 +1384,7 @@ class Worker
*/
public static function defer(int $worker_defer_limit = 0): bool
{
$queue = DI::app()->getQueue();
$queue = DI::appHelper()->getQueue();
if (empty($queue)) {
return false;

View file

@ -71,6 +71,8 @@ abstract class DI
//
/**
* @deprecated 2024.12 use DI::appHelper() instead
*
* @return App
*/
public static function app()
@ -78,6 +80,11 @@ abstract class DI
return self::$dice->create(App::class);
}
public static function appHelper(): AppHelper
{
return self::$dice->create(AppHelper::class);
}
/**
* @return Database\Database
*/

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
{
$a = DI::app();
$appHelper = DI::appHelper();
$uid = DI::userSession()->getLocalUserId();
Hook::callAll('prepare_body_init', $item);
@ -3522,8 +3522,8 @@ class Item
}
// Replace friendica image url size with theme preference.
if (!empty($a->getThemeInfoValue('item_image_size'))) {
$ps = $a->getThemeInfoValue('item_image_size');
if (!empty($appHelper->getThemeInfoValue('item_image_size'))) {
$ps = $appHelper->getThemeInfoValue('item_image_size');
$s = preg_replace('|(<img[^>]+src="[^"]+/photo/[0-9a-f]+)-[0-9]|', "$1-" . $ps, $s);
}

View file

@ -7,8 +7,8 @@
namespace Friendica\Model;
use Friendica\App;
use Friendica\App\Mode;
use Friendica\AppHelper;
use Friendica\Content\Text\BBCode;
use Friendica\Content\Widget\ContactBlock;
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
* load a lot of theme-specific content
*
* @param App $a
* @param string $nickname string
* @param bool $show_contacts
*
@ -199,7 +198,7 @@ class Profile
* @throws HTTPException\InternalServerErrorException
* @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);
if (!isset($profile['account_removed']) || $profile['account_removed']) {
@ -213,13 +212,13 @@ class Profile
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');
if (!DI::userSession()->getLocalUserId()) {
$a->setCurrentTheme($profile['theme']);
$a->setCurrentMobileTheme(DI::pConfig()->get($a->getProfileOwner(), 'system', 'mobile_theme') ?? '');
$appHelper->setCurrentTheme($profile['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
$theme_info_file = 'view/theme/' . $a->getCurrentTheme() . '/theme.php';
$theme_info_file = 'view/theme/' . $appHelper->getCurrentTheme() . '/theme.php';
if (file_exists($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
* want to see anybody else's theme settings except their own while on this site.
*
* @param App $a
*
* @return int user ID
*
* @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;
use Friendica\App;
use Friendica\App\BaseURL;
use Friendica\App\Request;
use Friendica\Core\Config\Capability\IManageConfigValues;
/**
@ -38,12 +39,12 @@ class Cookie
private $data;
/**
* @param App\Request $request The current http request
* @param Request $request The current http request
* @param IManageConfigValues $config
* @param App\BaseURL $baseURL
* @param BaseURL $baseURL
* @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->sitePrivateKey = $config->get('system', 'site_prvkey');

View file

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

View file

@ -7,7 +7,10 @@
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\Renderer;
use Friendica\DI;
@ -19,21 +22,21 @@ use Psr\Log\LoggerInterface;
class Embed extends BaseAdmin
{
/** @var App */
protected $app;
/** @var App\Mode */
/** @var AppHelper */
protected $appHelper;
/** @var 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);
$this->app = $app;
$this->appHelper = $appHelper;
$this->mode = $mode;
$theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
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";
if (function_exists('theme_admin_post')) {
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";
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;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n;
use Friendica\Database\Database;
use Friendica\Database\DBA;
@ -30,9 +32,9 @@ class Search extends BaseApi
/** @var 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->directMessage = $directMessage;

View file

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

View file

@ -7,7 +7,9 @@
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\Factory\Api\Friendica\Photo as FriendicaPhoto;
use Friendica\Module\BaseApi;
@ -23,9 +25,9 @@ class Photo extends BaseApi
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;
}

View file

@ -7,7 +7,9 @@
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\L10n;
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
@ -27,9 +29,9 @@ class Create extends BaseApi
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;
}

View file

@ -7,9 +7,11 @@
namespace Friendica\Module\Api\Friendica\Photo;
use Friendica\Database\DBA;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n;
use Friendica\Database\DBA;
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
use Friendica\Module\BaseApi;
use Friendica\Model\Contact;
@ -29,9 +31,9 @@ class Lists extends BaseApi
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;
}

View file

@ -7,7 +7,9 @@
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\L10n;
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
@ -27,9 +29,9 @@ class Update extends BaseApi
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;
}

View file

@ -7,7 +7,9 @@
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\Factory\Api\Friendica\Photo as FriendicaPhoto;
use Friendica\Model\Contact;
@ -29,9 +31,9 @@ class Show extends BaseApi
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;
}

View file

@ -7,7 +7,9 @@
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\L10n;
use Friendica\Core\System;
@ -37,9 +39,9 @@ class Instance extends BaseApi
/** @var 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->config = $config;

View file

@ -8,7 +8,9 @@
namespace Friendica\Module\Api\Mastodon\Instance;
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\L10n;
use Friendica\Model\User;
@ -26,9 +28,9 @@ class ExtendedDescription extends BaseApi
{
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;
}

View file

@ -9,6 +9,9 @@ namespace Friendica\Module\Api\Mastodon;
use Exception;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Contact\Header;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n;
@ -41,10 +44,10 @@ class InstanceV2 extends BaseApi
public function __construct(
\Friendica\Factory\Api\Mastodon\Error $errorFactory,
App $app,
AppHelper $appHelper,
L10n $l10n,
App\BaseURL $baseUrl,
App\Arguments $args,
BaseURL $baseUrl,
Arguments $args,
LoggerInterface $logger,
Profiler $profiler,
ApiResponse $response,
@ -53,7 +56,7 @@ class InstanceV2 extends BaseApi
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->config = $config;

View file

@ -7,7 +7,9 @@
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\DI;
use Friendica\Content\Conversation\Factory\Channel as ChannelFactory;
@ -29,9 +31,9 @@ class Lists extends BaseApi
/** @var Repository\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->userDefinedChannel = $userDefinedChannel;

View file

@ -7,7 +7,9 @@
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\Factory\Api\Mastodon\Error;
use Friendica\Factory\Api\Mastodon\Subscription as SubscriptionFactory;
@ -26,9 +28,9 @@ class PushSubscription extends BaseApi
/** @var SubscriptionFactory */
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;
}

View file

@ -7,7 +7,9 @@
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\System;
use Friendica\Model\Contact;
@ -27,9 +29,9 @@ class Reports extends BaseApi
/** @var \Friendica\Moderation\Repository\Report */
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->reportRepo = $reportRepo;

View file

@ -7,7 +7,9 @@
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\Logger;
use Friendica\Database\DBA;
@ -34,9 +36,9 @@ class ListTimeline extends BaseApi
/** @var 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;
}

View file

@ -7,7 +7,9 @@
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\L10n;
use Friendica\Core\Logger;
@ -34,9 +36,9 @@ class PublicTimeline extends BaseApi
*/
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;
}
/**

View file

@ -7,7 +7,9 @@
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\L10n;
use Friendica\Core\Logger;
@ -32,9 +34,9 @@ class Statuses extends BaseApi
*/
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;
}

View file

@ -7,7 +7,9 @@
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\DI;
use Friendica\Model\User;
@ -24,9 +26,9 @@ abstract class ContactEndpoint extends BaseApi
const DEFAULT_COUNT = 20;
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);
}

View file

@ -7,7 +7,9 @@
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\Database\Database;
use Friendica\Database\DBA;
@ -27,9 +29,9 @@ class Destroy extends BaseApi
/** @var Database */
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;
}

View file

@ -7,7 +7,9 @@
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\Database\Database;
use Friendica\Factory\Api\Twitter\DirectMessage;
@ -32,9 +34,9 @@ class NewDM extends BaseApi
/** @var 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->directMessage = $directMessage;

View file

@ -7,7 +7,9 @@
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\Database\Database;
use Friendica\Database\DBA;
@ -26,9 +28,9 @@ abstract class DirectMessagesEndpoint extends BaseApi
/** @var 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->directMessage = $directMessage;

View file

@ -8,7 +8,9 @@
namespace Friendica\Module\Api\Twitter\Friendships;
use Exception;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n;
use Friendica\Core\Logger;
use Friendica\Factory\Api\Twitter\User as TwitterUser;
@ -31,9 +33,9 @@ class Destroy extends ContactEndpoint
/** @var 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;
}

View file

@ -7,7 +7,9 @@
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\Database\Database;
use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle;
@ -32,9 +34,9 @@ class Create extends BaseApi
/** @var Database */
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->friendicaCircle = $friendicaCircle;

View file

@ -7,7 +7,9 @@
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\Database\Database;
use Friendica\Factory\Api\Friendica\Circle as FriendicaCirle;
@ -32,9 +34,9 @@ class Destroy extends BaseApi
/** @var Database */
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->friendicaCircle = $friendicaCircle;

View file

@ -7,7 +7,9 @@
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\Database\Database;
use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle;
@ -30,9 +32,9 @@ class Ownership extends BaseApi
/** @var Database */
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->friendicaCircle = $friendicaCircle;

View file

@ -7,7 +7,9 @@
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\Database\Database;
use Friendica\Database\DBA;
@ -34,9 +36,9 @@ class Statuses extends BaseApi
/** @var Database */
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->twitterStatus = $twitterStatus;

View file

@ -7,7 +7,9 @@
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\Database\Database;
use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle;
@ -32,9 +34,9 @@ class Update extends BaseApi
/** @var Database */
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->friendicaCircle = $friendicaCircle;

View file

@ -7,7 +7,8 @@
namespace Friendica\Module;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule;
use Friendica\Content\Nav;
use Friendica\Core\Config\Capability\IManageConfigValues;
@ -28,7 +29,7 @@ class Apps extends BaseModule
/** @var 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);

View file

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

View file

@ -7,7 +7,10 @@
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\Core\L10n;
use Friendica\Core\Renderer;
@ -33,18 +36,18 @@ abstract class BaseModeration extends BaseModule
protected $session;
/** @var SystemMessages */
protected $systemMessages;
/** @var App */
protected $app;
/** @var App\Page */
/** @var AppHelper */
protected $appHelper;
/** @var 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);
$this->session = $session;
$this->systemMessages = $systemMessages;
$this->app = $app;
$this->appHelper = $appHelper;
$this->page = $page;
}

View file

@ -8,14 +8,13 @@
namespace Friendica\Module;
use Exception;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule;
use Friendica\Content\Pager;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Navigation\Notifications\ValueObject\FormattedNotify;
use Friendica\Network\HTTPException\ForbiddenException;
use Friendica\Util\Profiler;
@ -76,7 +75,7 @@ abstract class BaseNotifications extends BaseModule
*/
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);

View file

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

View file

@ -7,7 +7,9 @@
namespace Friendica\Module;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\BaseModule;
use Friendica\Content\Feature;
use Friendica\Content\Nav;
@ -20,12 +22,12 @@ use Psr\Log\LoggerInterface;
class BaseSettings extends BaseModule
{
/** @var App\Page */
/** @var Page */
protected $page;
/** @var IHandleUserSessions */
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);

View file

@ -7,12 +7,13 @@
namespace Friendica\Module\Calendar\Event;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Protocol;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
@ -61,14 +62,14 @@ class API extends BaseModule
/** @var string */
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);
$this->session = $session;
$this->sysMessages = $sysMessages;
$this->aclFormatter = $aclFormatter;
$this->timezone = $app->getTimeZone();
$this->timezone = $appHelper->getTimeZone();
if (!$this->session->getLocalUserId()) {
throw new UnauthorizedException($this->t('Permission denied.'));

View file

@ -7,15 +7,14 @@
namespace Friendica\Module\Calendar\Event;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\BaseModule;
use Friendica\Content\Feature;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Model\Event;
use Friendica\Model\User;
use Friendica\Module\Response;
use Friendica\Network\HTTPException;
use Friendica\Util\Profiler;
@ -28,15 +27,15 @@ class Show extends BaseModule
{
/** @var IHandleUserSessions */
protected $session;
/** @var App */
private $app;
/** @var AppHelper */
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);
$this->session = $session;
$this->app = $app;
$this->appHelper = $appHelper;
}
protected function rawContent(array $request = [])

View file

@ -7,16 +7,16 @@
namespace Friendica\Module\Calendar;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\BaseModule;
use Friendica\Content\Feature;
use Friendica\Core\L10n;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Model\Event;
use Friendica\Model\Profile;
use Friendica\Model\User;
use Friendica\Module\Response;
use Friendica\Module\Security\Login;
use Friendica\Navigation\SystemMessages;
use Friendica\Network\HTTPException;
use Friendica\Util\Profiler;
@ -36,16 +36,16 @@ class Export extends BaseModule
protected $session;
/** @var SystemMessages */
protected $sysMessages;
/** @var App */
protected $app;
/** @var AppHelper */
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);
$this->session = $session;
$this->sysMessages = $sysMessages;
$this->app = $app;
$this->appHelper = $appHelper;
}
protected function rawContent(array $request = [])
@ -55,7 +55,7 @@ class Export extends BaseModule
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']) {
throw new HTTPException\NotFoundException($this->t('User not found.'));
}

View file

@ -7,7 +7,10 @@
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\Content\Feature;
use Friendica\Content\Nav;
@ -33,19 +36,19 @@ class Show extends BaseModule
protected $session;
/** @var SystemMessages */
protected $sysMessages;
/** @var App\Page */
/** @var Page */
protected $page;
/** @var App */
protected $app;
/** @var AppHelper */
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);
$this->session = $session;
$this->sysMessages = $sysMessages;
$this->page = $page;
$this->app = $app;
$this->appHelper = $appHelper;
}
protected function content(array $request = []): string
@ -55,7 +58,7 @@ class Show extends BaseModule
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']) {
throw new HTTPException\NotFoundException($this->t('User not found.'));
}

View file

@ -7,8 +7,10 @@
namespace Friendica\Module\Contact;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\Core\L10n;
use Friendica\App;
use Friendica\Core\Protocol;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\Worker;
@ -27,16 +29,16 @@ class Redir extends \Friendica\BaseModule
private $session;
/** @var Database */
private $database;
/** @var App */
private $app;
/** @var AppHelper */
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);
$this->session = $session;
$this->database = $database;
$this->app = $app;
$this->appHelper = $appHelper;
}
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
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->app->redirect($target_url);
$this->appHelper->redirect($target_url);
}
$separator = strpos($target_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->app->redirect($target_url);
$this->appHelper->redirect($target_url);
}
/**
@ -135,9 +137,9 @@ class Redir extends \Friendica\BaseModule
$this->checkUrl($contact_url, $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.
$this->app->redirect($target_url);
$this->appHelper->redirect($target_url);
}
if ($contact['uid'] == 0 && $this->session->getLocalUserId()) {
@ -148,10 +150,10 @@ class Redir extends \Friendica\BaseModule
$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.
$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'))) {
// 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->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->app->redirect($target_url);
$this->appHelper->redirect($target_url);
}

View file

@ -7,8 +7,11 @@
namespace Friendica\Module\Conversation;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Mode;
use Friendica\App\Page;
use Friendica\AppHelper;
use Friendica\Content\BoundariesPager;
use Friendica\Content\Conversation;
use Friendica\Content\Conversation\Entity\Channel;
@ -61,15 +64,15 @@ class Network extends Timeline
/** @var int */
protected $mention;
/** @var App */
protected $app;
/** @var AppHelper */
protected $appHelper;
/** @var ICanCache */
protected $cache;
/** @var IManageConfigValues The config */
protected $config;
/** @var SystemMessages */
protected $systemMessages;
/** @var App\Page */
/** @var Page */
protected $page;
/** @var Conversation */
protected $conversation;
@ -88,11 +91,11 @@ class Network extends Timeline
/** @var 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);
$this->app = $app;
$this->appHelper = $appHelper;
$this->timeline = $timeline;
$this->systemMessages = $systemMessages;
$this->conversation = $conversation;
@ -393,10 +396,10 @@ class Network extends Timeline
}
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) {
$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) {

View file

@ -7,7 +7,8 @@
namespace Friendica\Module;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Protocol;
@ -35,7 +36,7 @@ class FriendSuggest extends BaseModule
/** @var \Friendica\Contact\FriendSuggest\Factory\FriendSuggest */
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);

View file

@ -8,6 +8,8 @@
namespace Friendica\Module;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule;
use Friendica\Core\Addon;
use Friendica\Core\Config\Capability\IManageConfigValues;
@ -36,7 +38,7 @@ class Friendica extends BaseModule
/** @var IHandleUserSessions */
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);

View file

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

View file

@ -7,10 +7,14 @@
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\Core;
use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Installer;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
use Friendica\Core\Theme;
@ -51,20 +55,20 @@ class Install extends BaseModule
private $currentWizardStep;
/**
* @var Core\Installer The installer
* @var Installer The installer
*/
private $installer;
/** @var App */
protected $app;
/** @var App\Mode */
/** @var Cache */
protected $configCache;
/** @var 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);
$this->app = $app;
$this->configCache = $appHelper->getConfigCache();
$this->mode = $mode;
$this->installer = $installer;
@ -80,8 +84,7 @@ class Install extends BaseModule
}
// get basic installation information and save them to the config cache
$configCache = $this->app->getConfigCache();
$this->installer->setUpCache($configCache, $basePath->getPath());
$this->installer->setUpCache($this->configCache, $basePath->getPath());
// 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
@ -92,31 +95,29 @@ class Install extends BaseModule
protected function post(array $request = [])
{
$configCache = $this->app->getConfigCache();
switch ($this->currentWizardStep) {
case self::SYSTEM_CHECK:
case self::BASE_CONFIG:
$this->checkSetting($configCache, $_POST, 'config', 'php_path');
$this->checkSetting($this->configCache, $_POST, 'config', 'php_path');
break;
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($configCache, $_POST, 'system', 'url');
$this->checkSetting($this->configCache, $_POST, 'system', 'basepath');
$this->checkSetting($this->configCache, $_POST, 'system', 'url');
break;
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($configCache, $_POST, 'system', 'url');
$this->checkSetting($this->configCache, $_POST, 'system', 'basepath');
$this->checkSetting($this->configCache, $_POST, 'system', 'url');
$this->checkSetting($configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST);
$this->checkSetting($configCache, $_POST, 'database', 'username', '');
$this->checkSetting($configCache, $_POST, 'database', 'password', '');
$this->checkSetting($configCache, $_POST, 'database', 'database', '');
$this->checkSetting($this->configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST);
$this->checkSetting($this->configCache, $_POST, 'database', 'username', '');
$this->checkSetting($this->configCache, $_POST, 'database', 'password', '');
$this->checkSetting($this->configCache, $_POST, 'database', 'database', '');
// If we cannot connect to the database, return to the previous step
if (!$this->installer->checkDB(DI::dba())) {
@ -126,19 +127,19 @@ class Install extends BaseModule
break;
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($configCache, $_POST, 'system', 'url');
$this->checkSetting($this->configCache, $_POST, 'system', 'basepath');
$this->checkSetting($this->configCache, $_POST, 'system', 'url');
$this->checkSetting($configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST);
$this->checkSetting($configCache, $_POST, 'database', 'username', '');
$this->checkSetting($configCache, $_POST, 'database', 'password', '');
$this->checkSetting($configCache, $_POST, 'database', 'database', '');
$this->checkSetting($this->configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST);
$this->checkSetting($this->configCache, $_POST, 'database', 'username', '');
$this->checkSetting($this->configCache, $_POST, 'database', 'password', '');
$this->checkSetting($this->configCache, $_POST, 'database', 'database', '');
$this->checkSetting($configCache, $_POST, 'system', 'default_timezone', Core\Installer::DEFAULT_TZ);
$this->checkSetting($configCache, $_POST, 'system', 'language', Core\Installer::DEFAULT_LANG);
$this->checkSetting($configCache, $_POST, 'config', 'admin_email', '');
$this->checkSetting($this->configCache, $_POST, 'system', 'default_timezone', Core\Installer::DEFAULT_TZ);
$this->checkSetting($this->configCache, $_POST, 'system', 'language', Core\Installer::DEFAULT_LANG);
$this->checkSetting($this->configCache, $_POST, 'config', 'admin_email', '');
// If we cannot connect to the database, return to the Database config wizard
if (!$this->installer->checkDB(DI::dba())) {
@ -146,7 +147,7 @@ class Install extends BaseModule
return;
}
if (!$this->installer->createConfig($configCache)) {
if (!$this->installer->createConfig($this->configCache)) {
return;
}
@ -169,15 +170,13 @@ class Install extends BaseModule
protected function content(array $request = []): string
{
$configCache = $this->app->getConfigCache();
$output = '';
$install_title = $this->t('Friendica Communications Server - Setup');
switch ($this->currentWizardStep) {
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);
@ -199,8 +198,8 @@ class Install extends BaseModule
break;
case self::BASE_CONFIG:
$baseUrl = $configCache->get('system', 'url') ?
new Uri($configCache->get('system', 'url')) :
$baseUrl = $this->configCache->get('system', 'url') ?
new Uri($this->configCache->get('system', 'url')) :
$this->baseUrl;
$tpl = Renderer::getMarkupTemplate('install/02_base_config.tpl');
@ -209,7 +208,7 @@ class Install extends BaseModule
'$pass' => $this->t('Base settings'),
'$basepath' => ['system-basepath',
$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('Required')],
'$system_url' => ['system-url',
@ -217,7 +216,7 @@ class Install extends BaseModule
(string)$baseUrl,
$this->t("Overwrite this field in case the system URL determination isn't right, otherwise leave it as is."),
$this->t('Required')],
'$php_path' => $configCache->get('config', 'php_path'),
'$php_path' => $this->configCache->get('config', 'php_path'),
'$submit' => $this->t('Submit'),
]);
break;
@ -233,31 +232,31 @@ class Install extends BaseModule
'$required' => $this->t('Required'),
'$requirement_not_satisfied' => $this->t('Requirement not satisfied'),
'$checks' => $this->installer->getChecks(),
'$basepath' => $configCache->get('system', 'basepath'),
'$system_url' => $configCache->get('system', 'url'),
'$basepath' => $this->configCache->get('system', 'basepath'),
'$system_url' => $this->configCache->get('system', 'url'),
'$dbhost' => ['database-hostname',
$this->t('Database Server Name'),
$configCache->get('database', 'hostname'),
$this->configCache->get('database', 'hostname'),
'',
$this->t('Required')],
'$dbuser' => ['database-username',
$this->t('Database Login Name'),
$configCache->get('database', 'username'),
$this->configCache->get('database', 'username'),
'',
$this->t('Required'),
'autofocus'],
'$dbpass' => ['database-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('Required')],
'$dbdata' => ['database-database',
$this->t('Database Name'),
$configCache->get('database', 'database'),
$this->configCache->get('database', 'database'),
'',
$this->t('Required')],
'$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')
]);
break;
@ -272,27 +271,27 @@ class Install extends BaseModule
'$required' => $this->t('Required'),
'$checks' => $this->installer->getChecks(),
'$pass' => $this->t('Site settings'),
'$basepath' => $configCache->get('system', 'basepath'),
'$system_url' => $configCache->get('system', 'url'),
'$dbhost' => $configCache->get('database', 'hostname'),
'$dbuser' => $configCache->get('database', 'username'),
'$dbpass' => $configCache->get('database', 'password'),
'$dbdata' => $configCache->get('database', 'database'),
'$basepath' => $this->configCache->get('system', 'basepath'),
'$system_url' => $this->configCache->get('system', 'url'),
'$dbhost' => $this->configCache->get('database', 'hostname'),
'$dbuser' => $this->configCache->get('database', 'username'),
'$dbpass' => $this->configCache->get('database', 'password'),
'$dbdata' => $this->configCache->get('database', 'database'),
'$adminmail' => ['config-admin_email',
$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('Required'), 'autofocus', 'email'],
'$timezone' => Temporal::getTimezoneField('system-default_timezone',
$this->t('Please select a default timezone for your website'),
$configCache->get('system', 'default_timezone'),
$this->configCache->get('system', 'default_timezone'),
''),
'$language' => ['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.'),
$lang_choices],
'$php_path' => $configCache->get('config', 'php_path'),
'$php_path' => $this->configCache->get('config', 'php_path'),
'$submit' => $this->t('Submit')
]);
break;

View file

@ -8,7 +8,10 @@
namespace Friendica\Module\Item;
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\Content\Feature;
use Friendica\Core\ACL;
@ -41,7 +44,7 @@ class Compose extends BaseModule
/** @var ACLFormatter */
private $ACLFormatter;
/** @var App\Page */
/** @var Page */
private $page;
/** @var IManagePersonalConfigValues */
@ -53,11 +56,11 @@ class Compose extends BaseModule
/** @var UserSession */
private $session;
/** @var App */
private $app;
/** @var AppHelper */
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);
@ -67,7 +70,7 @@ class Compose extends BaseModule
$this->pConfig = $pConfig;
$this->config = $config;
$this->session = $session;
$this->app = $app;
$this->appHelper = $appHelper;
}
protected function post(array $request = [])
@ -87,7 +90,7 @@ class Compose extends BaseModule
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.'));
}
@ -115,7 +118,7 @@ class Compose extends BaseModule
$compose_title = $this->l10n->t('Compose new personal note');
$type = 'note';
$doesFederate = false;
$contact_allow_list = [$this->app->getContactId()];
$contact_allow_list = [$this->appHelper->getContactId()];
$circle_allow_list = [];
$contact_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/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')) {
$created_at = Temporal::getDateTimeField(
new \DateTime(DBA::NULL_DATETIME),
new \DateTime('now'),
new DateTime(DBA::NULL_DATETIME),
new DateTime('now'),
null,
$this->l10n->t('Created at'),
'created_at'

View file

@ -8,6 +8,7 @@
namespace Friendica\Module\Item;
use Friendica\App;
use Friendica\AppHelper;
use Friendica\BaseModule;
use Friendica\Content\Conversation;
use Friendica\Content\Item as ContentItem;
@ -46,8 +47,8 @@ class Display extends BaseModule
protected $pConfig;
/** @var IHandleUserSessions */
protected $session;
/** @var App */
protected $app;
/** @var AppHelper */
protected $appHelper;
/** @var ContentItem */
protected $contentItem;
/** @var Conversation */
@ -57,7 +58,7 @@ class Display extends BaseModule
/** @var 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);
@ -65,7 +66,7 @@ class Display extends BaseModule
$this->config = $config;
$this->pConfig = $pConfig;
$this->session = $session;
$this->app = $app;
$this->appHelper = $appHelper;
$this->contentItem = $contentItem;
$this->conversation = $conversation;
$this->notification = $notification;
@ -176,12 +177,12 @@ class Display extends BaseModule
}
if ($this->baseUrl->isLocalUrl($author['url'])) {
Profile::load($this->app, $author['nick'], false);
Profile::load($this->appHelper, $author['nick'], false);
} else {
$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

View file

@ -8,7 +8,9 @@
namespace Friendica\Module;
use Exception;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Protocol;
@ -35,8 +37,8 @@ use Psr\Log\LoggerInterface;
*/
class Magic extends BaseModule
{
/** @var App */
protected $app;
/** @var AppHelper */
protected $appHelper;
/** @var Database */
protected $dba;
/** @var ICanSendHttpRequests */
@ -44,11 +46,11 @@ class Magic extends BaseModule
/** @var IHandleUserSessions */
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);
$this->app = $app;
$this->appHelper = $appHelper;
$this->dba = $dba;
$this->httpClient = $httpClient;
$this->userSession = $userSession;
@ -79,12 +81,12 @@ class Magic extends BaseModule
$contact = Contact::getByURL($addr ?: $dest);
if ($contact === [] && $owa === 0) {
$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);
}
if ($contact !== []) {
// 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]);
System::externalRedirect($dest);
}
@ -94,7 +96,7 @@ class Magic extends BaseModule
if (!$this->userSession->getLocalUserId() || $owa === 0) {
$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');
@ -164,7 +166,7 @@ class Magic extends BaseModule
$j = json_decode($curlResult->getBodyString(), true);
if (empty($j) || !$j['success']) {
$this->logger->notice('Invalid JSON, redirecting to destination.', ['json' => $j, 'dest' => $dest]);
$this->app->redirect($dest);
$this->appHelper->redirect($dest);
}
if ($j['encrypted_token']) {

View file

@ -7,12 +7,13 @@
namespace Friendica\Module\Media\Attachment;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Model\Attach;
use Friendica\Module\Response;
use Friendica\Network\HTTPException\UnauthorizedException;
@ -27,15 +28,15 @@ class Browser extends BaseModule
{
/** @var IHandleUserSessions */
protected $session;
/** @var App */
protected $app;
/** @var AppHelper */
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);
$this->session = $session;
$this->app = $app;
$this->appHelper = $appHelper;
}
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
$theme = Strings::sanitizeFilePathItem($request['theme'] ?? '');
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()]);

View file

@ -7,7 +7,9 @@
namespace Friendica\Module\Media\Photo;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\AppHelper;
use Friendica\BaseModule;
use Friendica\Core\L10n;
use Friendica\Core\Renderer;
@ -28,15 +30,15 @@ class Browser extends BaseModule
{
/** @var IHandleUserSessions */
protected $session;
/** @var App */
protected $app;
/** @var AppHelper */
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);
$this->session = $session;
$this->app = $app;
$this->appHelper = $appHelper;
}
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
$theme = Strings::sanitizeFilePathItem($request['theme'] ?? '');
if ($theme && is_file("view/theme/$theme/config.php")) {
$this->app->setCurrentTheme($theme);
$this->appHelper->setCurrentTheme($theme);
}
$album = $this->parameters['album'] ?? null;

View file

@ -7,13 +7,15 @@
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\L10n;
use Friendica\Core\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Database\Database;
use Friendica\DI;
use Friendica\Model\Register;
use Friendica\Model\User;
use Friendica\Module\BaseModeration;
@ -29,9 +31,9 @@ abstract class BaseUsers extends BaseModeration
/** @var 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;
}

View file

@ -7,7 +7,10 @@
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\Core\L10n;
use Friendica\Core\Renderer;
@ -18,7 +21,6 @@ use Friendica\Model;
use Friendica\Module\BaseModeration;
use Friendica\Module\Response;
use Friendica\Navigation\SystemMessages;
use Friendica\Util\Network;
use Friendica\Util\Profiler;
use Psr\Log\LoggerInterface;
@ -27,9 +29,9 @@ class Contact extends BaseModeration
/** @var 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;
}

View file

@ -7,7 +7,10 @@
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\Core\L10n;
use Friendica\Core\Renderer;
@ -29,7 +32,7 @@ class Add extends BaseModeration
/** @var DomainPatternBlocklist */
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);

View file

@ -7,7 +7,10 @@
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\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
@ -27,9 +30,9 @@ class Import extends \Friendica\Module\BaseModeration
/** @var array of blocked server domain patterns */
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;
}

View file

@ -7,7 +7,10 @@
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\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
@ -24,9 +27,9 @@ class Index extends BaseModeration
/** @var DomainPatternBlocklist */
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;
}

View file

@ -7,7 +7,10 @@
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\L10n;
use Friendica\Core\Renderer;
@ -24,9 +27,9 @@ class Source extends BaseModeration
/** @var IManageConfigValues */
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;
}

View file

@ -7,7 +7,10 @@
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\Text\BBCode;
use Friendica\Core\L10n;
@ -27,9 +30,9 @@ class Reports extends BaseModeration
/** @var 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;
}

View file

@ -7,7 +7,10 @@
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\Renderer;
use Friendica\Core\Session\Capability\IHandleUserSessions;
@ -24,9 +27,9 @@ class Summary extends BaseModeration
/** @var 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;
}

View file

@ -8,6 +8,8 @@
namespace Friendica\Module;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule;
use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Config\Capability\IManageConfigValues;
@ -25,7 +27,7 @@ class NodeInfo110 extends BaseModule
/** @var IManageConfigValues */
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);

View file

@ -8,6 +8,8 @@
namespace Friendica\Module;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule;
use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Config\Capability\IManageConfigValues;
@ -25,7 +27,7 @@ class NodeInfo120 extends BaseModule
/** @var IManageConfigValues */
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);

View file

@ -8,6 +8,8 @@
namespace Friendica\Module;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule;
use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Config\Capability\IManageConfigValues;
@ -25,7 +27,7 @@ class NodeInfo121 extends BaseModule
/** @var IManageConfigValues */
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);

View file

@ -8,6 +8,8 @@
namespace Friendica\Module;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule;
use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Config\Capability\IManageConfigValues;
@ -25,7 +27,7 @@ class NodeInfo122 extends BaseModule
/** @var IManageConfigValues */
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);

View file

@ -8,6 +8,8 @@
namespace Friendica\Module;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\BaseModule;
use Friendica\Capabilities\ICanCreateResponses;
use Friendica\Core\Config\Capability\IManageConfigValues;
@ -25,7 +27,7 @@ class NodeInfo210 extends BaseModule
/** @var IManageConfigValues */
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);

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