mirror of
https://github.com/friendica/friendica
synced 2024-12-22 19:20:17 +00:00
Merge pull request #14542 from Art4/refactoring-of-app-class
[Refactoring] Extract App methods into AppHelper
This commit is contained in:
commit
17dba36e77
146 changed files with 1752 additions and 1572 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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)]);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -503,7 +503,7 @@ class App implements AppHelper
|
|||
}
|
||||
|
||||
if (!$this->mode->isBackend()) {
|
||||
$auth->withSession($this);
|
||||
$auth->withSession();
|
||||
}
|
||||
|
||||
if ($this->session->isUnauthenticated()) {
|
||||
|
|
|
@ -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,17 +176,22 @@ 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
|
||||
* @param IManagePersonalConfigValues $pConfig The Friendica personal configuration (for user)
|
||||
* @param int $localUID The local user id
|
||||
* @param Arguments $args The Friendica App Arguments
|
||||
* @param L10n $l10n The l10n language instance
|
||||
* @param IManageConfigValues $config The Friendica configuration
|
||||
* @param IManagePersonalConfigValues $pConfig The Friendica personal configuration (for user)
|
||||
* @param int $localUID The local user id
|
||||
*
|
||||
* @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,23 +403,34 @@ 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
|
||||
* @param ResponseInterface $response The Response of the module class, including type, content & headers
|
||||
* @param L10n $l10n The l10n language class
|
||||
* @param BaseURL $baseURL The Friendica Base URL
|
||||
* @param Arguments $args The Friendica App arguments
|
||||
* @param Mode $mode The current node mode
|
||||
* @param ResponseInterface $response The Response of the module class, including type, content & headers
|
||||
* @param L10n $l10n The l10n language class
|
||||
* @param Profiler $profiler
|
||||
* @param IManageConfigValues $config The Configuration of this node
|
||||
* @param IManagePersonalConfigValues $pconfig The personal/user configuration
|
||||
* @param IManageConfigValues $config The Configuration of this node
|
||||
* @param IManagePersonalConfigValues $pconfig The personal/user configuration
|
||||
* @param Nav $nav
|
||||
* @param int $localUID
|
||||
* @throws HTTPException\MethodNotAllowedException
|
||||
* @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();
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
@ -1017,7 +1018,7 @@ class Conversation
|
|||
$emojis[$count['uri-id']][$count['reaction']]['title'] = [];
|
||||
}
|
||||
|
||||
// @todo The following code should be removed, once that we display activity authors on demand
|
||||
// @todo The following code should be removed, once that we display activity authors on demand
|
||||
$activity_verbs = [
|
||||
Activity::LIKE,
|
||||
Activity::DISLIKE,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -1630,7 +1630,7 @@ class BBCode
|
|||
private static function convertStylesToHtml(string $text, int $simple_html): string
|
||||
{
|
||||
// Markdown is designed to pass through HTML elements that it can't handle itself,
|
||||
// so that the other system would parse the original HTML element.
|
||||
// so that the other system would parse the original HTML element.
|
||||
// But Diaspora has chosen not to do this and doesn't parse HTML elements.
|
||||
// So we need to make some changes here.
|
||||
if ($simple_html == BBCode::DIASPORA) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
@ -830,7 +830,7 @@ class Worker
|
|||
return false;
|
||||
} elseif ($max_idletime > 0) {
|
||||
Logger::debug('Maximum idletime not reached.', ['last' => $last_check, 'last-check' => $last_date, 'seconds' => $max_idletime, 'load' => $load, 'max_load' => $maxsysload, 'active_worker' => $active, 'max_worker' => $maxqueues]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1371,20 +1371,20 @@ class Worker
|
|||
*/
|
||||
public static function getRetrial(): int
|
||||
{
|
||||
$queue = DI::app()->getQueue();
|
||||
$queue = DI::appHelper()->getQueue();
|
||||
return $queue['retrial'] ?? 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defers the current worker entry
|
||||
*
|
||||
* @param int $worker_defer_limit Maximum defer limit
|
||||
* @param int $worker_defer_limit Maximum defer limit
|
||||
* @return boolean had the entry been deferred?
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function defer(int $worker_defer_limit = 0): bool
|
||||
{
|
||||
$queue = DI::app()->getQueue();
|
||||
$queue = DI::appHelper()->getQueue();
|
||||
|
||||
if (empty($queue)) {
|
||||
return false;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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->mode = $mode;
|
||||
$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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
|
||||
namespace Friendica\Module;
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\Hook;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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.'));
|
||||
|
|
|
@ -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->session = $session;
|
||||
$this->appHelper = $appHelper;
|
||||
}
|
||||
|
||||
protected function rawContent(array $request = [])
|
||||
|
|
|
@ -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.'));
|
||||
}
|
||||
|
|
|
@ -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.'));
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
@ -97,14 +98,14 @@ class FriendSuggest extends BaseModule
|
|||
}
|
||||
|
||||
$suggestableContacts = ContactModel::selectToArray(['id', 'name'], [
|
||||
'`uid` = ?
|
||||
AND `id` != ?
|
||||
AND `network` = ?
|
||||
AND NOT `self`
|
||||
AND NOT `blocked`
|
||||
AND NOT `pending`
|
||||
AND NOT `archive`
|
||||
AND NOT `deleted`
|
||||
'`uid` = ?
|
||||
AND `id` != ?
|
||||
AND `network` = ?
|
||||
AND NOT `self`
|
||||
AND NOT `blocked`
|
||||
AND NOT `pending`
|
||||
AND NOT `archive`
|
||||
AND NOT `deleted`
|
||||
AND `notify` != ""',
|
||||
DI::userSession()->getLocalUserId(),
|
||||
$cid,
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,22 +55,22 @@ 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->mode = $mode;
|
||||
$this->installer = $installer;
|
||||
$this->configCache = $appHelper->getConfigCache();
|
||||
$this->mode = $mode;
|
||||
$this->installer = $installer;
|
||||
|
||||
if (!$this->mode->isInstall()) {
|
||||
throw new HTTPException\ForbiddenException();
|
||||
|
@ -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;
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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;
|
||||
|
@ -175,12 +176,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
|
||||
|
|
|
@ -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;
|
||||
|
@ -85,11 +87,11 @@ class Magic extends BaseModule
|
|||
if (empty($contact)) {
|
||||
if (!$owa) {
|
||||
$this->logger->info('No contact record found, no oWA, redirecting to destination.', ['request' => $request, 'server' => $_SERVER, 'dest' => $dest]);
|
||||
$this->app->redirect($dest);
|
||||
$this->appHelper->redirect($dest);
|
||||
}
|
||||
} else {
|
||||
// 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);
|
||||
}
|
||||
|
@ -99,12 +101,12 @@ class Magic extends BaseModule
|
|||
|
||||
if (!$this->userSession->getLocalUserId() || !$owa) {
|
||||
$this->logger->notice('Not logged in or not OWA, redirecting to destination.', ['uid' => $this->userSession->getLocalUserId(), 'owa' => $owa, 'dest' => $dest]);
|
||||
$this->app->redirect($dest);
|
||||
$this->appHelper->redirect($dest);
|
||||
}
|
||||
|
||||
$dest = Network::removeUrlParameter($dest, 'zid');
|
||||
$dest = Network::removeUrlParameter($dest, 'f');
|
||||
|
||||
|
||||
// OpenWebAuth
|
||||
$owner = User::getOwnerDataById($this->userSession->getLocalUserId());
|
||||
|
||||
|
@ -169,7 +171,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']) {
|
||||
|
|
|
@ -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->session = $session;
|
||||
$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()]);
|
||||
|
|
|
@ -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->session = $session;
|
||||
$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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
@ -34,7 +37,7 @@ class Summary extends BaseModeration
|
|||
protected function content(array $request = []): string
|
||||
{
|
||||
parent::content();
|
||||
|
||||
|
||||
$accounts = [
|
||||
[$this->t('Personal Page'), 0],
|
||||
[$this->t('Organisation Page'), 0],
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
|
||||
namespace Friendica\Module\Notifications;
|
||||
|
||||
use Friendica\App;
|
||||
use Friendica\App\Arguments;
|
||||
use Friendica\App\BaseURL;
|
||||
use Friendica\AppHelper;
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Contact\Introduction\Repository\Introduction;
|
||||
use Friendica\Content\GroupManager;
|
||||
|
@ -60,10 +62,10 @@ class Ping extends BaseModule
|
|||
private $cache;
|
||||
/** @var Repository\Notify */
|
||||
private $notify;
|
||||
/** @var App */
|
||||
private $app;
|
||||
/** @var AppHelper */
|
||||
private $appHelper;
|
||||
|
||||
public function __construct(App $app, Repository\Notify $notify, ICanCache $cache, Database $database, IManagePersonalConfigValues $pconfig, IManageConfigValues $config, IHandleUserSessions $session, SystemMessages $systemMessages, Repository\Notification $notificationRepo, Introduction $introductionRepo, Factory\FormattedNavNotification $formattedNavNotification, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||
public function __construct(AppHelper $appHelper, Repository\Notify $notify, ICanCache $cache, Database $database, IManagePersonalConfigValues $pconfig, IManageConfigValues $config, IHandleUserSessions $session, SystemMessages $systemMessages, Repository\Notification $notificationRepo, Introduction $introductionRepo, Factory\FormattedNavNotification $formattedNavNotification, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||
{
|
||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
|
||||
|
@ -77,7 +79,7 @@ class Ping extends BaseModule
|
|||
$this->database = $database;
|
||||
$this->cache = $cache;
|
||||
$this->notify = $notify;
|
||||
$this->app = $app;
|
||||
$this->appHelper = $appHelper;
|
||||
}
|
||||
|
||||
protected function rawContent(array $request = [])
|
||||
|
|
|
@ -26,7 +26,7 @@ class Acknowledge extends BaseApi
|
|||
protected function post(array $request = [])
|
||||
{
|
||||
DI::session()->set('oauth_acknowledge', true);
|
||||
DI::app()->redirect(DI::session()->get('return_path'));
|
||||
DI::appHelper()->redirect(DI::session()->get('return_path'));
|
||||
}
|
||||
|
||||
protected function content(array $request = []): string
|
||||
|
|
|
@ -60,14 +60,14 @@ class Authorize extends BaseApi
|
|||
$uid = DI::userSession()->getLocalUserId();
|
||||
if (empty($uid)) {
|
||||
Logger::info('Redirect to login');
|
||||
DI::app()->redirect('login?' . http_build_query(['return_authorize' => $redirect]));
|
||||
DI::appHelper()->redirect('login?' . http_build_query(['return_authorize' => $redirect]));
|
||||
} else {
|
||||
Logger::info('Already logged in user', ['uid' => $uid]);
|
||||
}
|
||||
|
||||
if (!OAuth::existsTokenForUser($application, $uid) && !DI::session()->get('oauth_acknowledge')) {
|
||||
Logger::info('Redirect to acknowledge');
|
||||
DI::app()->redirect('oauth/acknowledge?' . http_build_query(['return_authorize' => $redirect, 'application' => $application['name']]));
|
||||
DI::appHelper()->redirect('oauth/acknowledge?' . http_build_query(['return_authorize' => $redirect, 'application' => $application['name']]));
|
||||
}
|
||||
|
||||
DI::session()->remove('oauth_acknowledge');
|
||||
|
@ -78,7 +78,7 @@ class Authorize extends BaseApi
|
|||
}
|
||||
|
||||
if ($application['redirect_uri'] != 'urn:ietf:wg:oauth:2.0:oob') {
|
||||
DI::app()->redirect($request['redirect_uri'] . (strpos($request['redirect_uri'], '?') ? '&' : '?') . http_build_query(['code' => $token['code'], 'state' => $request['state']]));
|
||||
DI::appHelper()->redirect($request['redirect_uri'] . (strpos($request['redirect_uri'], '?') ? '&' : '?') . http_build_query(['code' => $token['code'], 'state' => $request['state']]));
|
||||
}
|
||||
|
||||
self::$oauth_code = $token['code'];
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue