mirror of
https://github.com/friendica/friendica
synced 2024-12-22 23:20:16 +00:00
Merge branch 'develop' into phpstan-level-1
This commit is contained in:
commit
c79f3cde22
150 changed files with 2429 additions and 1781 deletions
|
@ -15,7 +15,6 @@ if (php_sapi_name() !== 'cli') {
|
||||||
}
|
}
|
||||||
|
|
||||||
use Dice\Dice;
|
use Dice\Dice;
|
||||||
use Friendica\App;
|
|
||||||
use Friendica\App\Mode;
|
use Friendica\App\Mode;
|
||||||
use Friendica\Core\Logger\Capability\LogChannel;
|
use Friendica\Core\Logger\Capability\LogChannel;
|
||||||
use Friendica\Core\Update;
|
use Friendica\Core\Update;
|
||||||
|
@ -57,7 +56,7 @@ DI::mode()->setExecutor(Mode::WORKER);
|
||||||
Update::check(DI::basePath(), true);
|
Update::check(DI::basePath(), true);
|
||||||
|
|
||||||
// Quit when in maintenance
|
// Quit when in maintenance
|
||||||
if (!DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) {
|
if (!DI::mode()->has(Mode::MAINTENANCEDISABLED)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* information.
|
* information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\AppHelper;
|
||||||
use Friendica\Content\Conversation;
|
use Friendica\Content\Conversation;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
@ -284,7 +284,7 @@ function item_process(array $post, array $request, bool $preview, string $return
|
||||||
unset($post['api_source']);
|
unset($post['api_source']);
|
||||||
|
|
||||||
if (!empty($request['scheduled_at'])) {
|
if (!empty($request['scheduled_at'])) {
|
||||||
$scheduled_at = DateTimeFormat::convert($request['scheduled_at'], 'UTC', DI::app()->getTimeZone());
|
$scheduled_at = DateTimeFormat::convert($request['scheduled_at'], 'UTC', DI::appHelper()->getTimeZone());
|
||||||
if ($scheduled_at > DateTimeFormat::utcNow()) {
|
if ($scheduled_at > DateTimeFormat::utcNow()) {
|
||||||
unset($post['created']);
|
unset($post['created']);
|
||||||
unset($post['edited']);
|
unset($post['edited']);
|
||||||
|
@ -330,7 +330,7 @@ function item_post_return($baseurl, $return_path)
|
||||||
System::jsonExit($json);
|
System::jsonExit($json);
|
||||||
}
|
}
|
||||||
|
|
||||||
function item_content(App $a)
|
function item_content(AppHelper $appHelper)
|
||||||
{
|
{
|
||||||
if (!DI::userSession()->isAuthenticated()) {
|
if (!DI::userSession()->isAuthenticated()) {
|
||||||
throw new HTTPException\UnauthorizedException();
|
throw new HTTPException\UnauthorizedException();
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -15,7 +15,7 @@ use Friendica\Model\User;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
|
||||||
function lostpass_post(App $a)
|
function lostpass_post(AppHelper $a)
|
||||||
{
|
{
|
||||||
$loginame = trim($_POST['login-name']);
|
$loginame = trim($_POST['login-name']);
|
||||||
if (!$loginame) {
|
if (!$loginame) {
|
||||||
|
@ -78,7 +78,7 @@ function lostpass_post(App $a)
|
||||||
DI::baseUrl()->redirect();
|
DI::baseUrl()->redirect();
|
||||||
}
|
}
|
||||||
|
|
||||||
function lostpass_content(App $a)
|
function lostpass_content(AppHelper $appHelper)
|
||||||
{
|
{
|
||||||
if (DI::args()->getArgc() > 1) {
|
if (DI::args()->getArgc() > 1) {
|
||||||
$pwdreset_token = DI::args()->getArgv()[1];
|
$pwdreset_token = DI::args()->getArgv()[1];
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\AppHelper;
|
||||||
use Friendica\Content\Conversation;
|
use Friendica\Content\Conversation;
|
||||||
use Friendica\Content\Nav;
|
use Friendica\Content\Nav;
|
||||||
use Friendica\Content\Pager;
|
use Friendica\Content\Pager;
|
||||||
|
@ -17,7 +17,7 @@ use Friendica\Model\Item;
|
||||||
use Friendica\Model\Post;
|
use Friendica\Model\Post;
|
||||||
use Friendica\Module\BaseProfile;
|
use Friendica\Module\BaseProfile;
|
||||||
|
|
||||||
function notes_init(App $a)
|
function notes_init(AppHelper $appHelper)
|
||||||
{
|
{
|
||||||
if (! DI::userSession()->getLocalUserId()) {
|
if (! DI::userSession()->getLocalUserId()) {
|
||||||
return;
|
return;
|
||||||
|
@ -27,7 +27,7 @@ function notes_init(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function notes_content(App $a, bool $update = false)
|
function notes_content(AppHelper $appHelper, bool $update = false)
|
||||||
{
|
{
|
||||||
if (!DI::userSession()->getLocalUserId()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
|
||||||
|
@ -46,11 +46,11 @@ function notes_content(App $a, bool $update = false)
|
||||||
'acl_data' => '',
|
'acl_data' => '',
|
||||||
];
|
];
|
||||||
|
|
||||||
$o .= DI::conversation()->statusEditor($x, $a->getContactId());
|
$o .= DI::conversation()->statusEditor($x, $appHelper->getContactId());
|
||||||
}
|
}
|
||||||
|
|
||||||
$condition = ['uid' => DI::userSession()->getLocalUserId(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT,
|
$condition = ['uid' => DI::userSession()->getLocalUserId(), 'post-type' => Item::PT_PERSONAL_NOTE, 'gravity' => Item::GRAVITY_PARENT,
|
||||||
'contact-id'=> $a->getContactId()];
|
'contact-id'=> $appHelper->getContactId()];
|
||||||
|
|
||||||
if (DI::mode()->isMobile()) {
|
if (DI::mode()->isMobile()) {
|
||||||
$itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
|
$itemsPerPage = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'itemspage_mobile_network',
|
||||||
|
|
|
@ -9,14 +9,14 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Post;
|
use Friendica\Model\Post;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
|
||||||
function update_contact_content(App $a)
|
function update_contact_content(AppHelper $appHelper)
|
||||||
{
|
{
|
||||||
if (!empty(DI::args()->get(1)) && !empty($_GET['force'])) {
|
if (!empty(DI::args()->get(1)) && !empty($_GET['force'])) {
|
||||||
$contact = DBA::selectFirst('account-user-view', ['pid', 'deleted'], ['id' => DI::args()->get(1)]);
|
$contact = DBA::selectFirst('account-user-view', ['pid', 'deleted'], ['id' => DI::args()->get(1)]);
|
||||||
|
|
|
@ -8,13 +8,12 @@
|
||||||
* AJAX synchronisation of notes page
|
* AJAX synchronisation of notes page
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\DI;
|
|
||||||
|
|
||||||
require_once 'mod/notes.php';
|
require_once 'mod/notes.php';
|
||||||
|
|
||||||
function update_notes_content(App $a)
|
function update_notes_content(AppHelper $appHelper)
|
||||||
{
|
{
|
||||||
$profile_uid = intval($_GET['p']);
|
$profile_uid = intval($_GET['p']);
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ function update_notes_content(App $a)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$text = notes_content($a, $profile_uid);
|
$text = notes_content($appHelper, $profile_uid);
|
||||||
|
|
||||||
System::htmlUpdateExit($text);
|
System::htmlUpdateExit($text);
|
||||||
}
|
}
|
||||||
|
|
524
src/App.php
524
src/App.php
|
@ -10,7 +10,10 @@ namespace Friendica;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Friendica\App\Arguments;
|
use Friendica\App\Arguments;
|
||||||
use Friendica\App\BaseURL;
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Mode;
|
||||||
|
use Friendica\App\Page;
|
||||||
use Friendica\App\Request;
|
use Friendica\App\Request;
|
||||||
|
use Friendica\App\Router;
|
||||||
use Friendica\Capabilities\ICanCreateResponses;
|
use Friendica\Capabilities\ICanCreateResponses;
|
||||||
use Friendica\Content\Nav;
|
use Friendica\Content\Nav;
|
||||||
use Friendica\Core\Config\Factory\Config;
|
use Friendica\Core\Config\Factory\Config;
|
||||||
|
@ -18,14 +21,13 @@ use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
use Friendica\Database\Definition\DbaDefinition;
|
use Friendica\Database\Definition\DbaDefinition;
|
||||||
use Friendica\Database\Definition\ViewDefinition;
|
use Friendica\Database\Definition\ViewDefinition;
|
||||||
use Friendica\Module\Maintenance;
|
use Friendica\Module\Maintenance;
|
||||||
|
use Friendica\Network\HTTPException\InternalServerErrorException;
|
||||||
use Friendica\Security\Authentication;
|
use Friendica\Security\Authentication;
|
||||||
use Friendica\Core\Config\ValueObject\Cache;
|
use Friendica\Core\Config\ValueObject\Cache;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Theme;
|
|
||||||
use Friendica\Database\Database;
|
|
||||||
use Friendica\Module\Special\HTTPException as ModuleHTTPException;
|
use Friendica\Module\Special\HTTPException as ModuleHTTPException;
|
||||||
use Friendica\Network\HTTPException;
|
use Friendica\Network\HTTPException;
|
||||||
use Friendica\Protocol\ATProtocol\DID;
|
use Friendica\Protocol\ATProtocol\DID;
|
||||||
|
@ -34,7 +36,6 @@ use Friendica\Util\DateTimeFormat;
|
||||||
use Friendica\Util\HTTPInputData;
|
use Friendica\Util\HTTPInputData;
|
||||||
use Friendica\Util\HTTPSignature;
|
use Friendica\Util\HTTPSignature;
|
||||||
use Friendica\Util\Profiler;
|
use Friendica\Util\Profiler;
|
||||||
use Friendica\Util\Strings;
|
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,26 +48,14 @@ use Psr\Log\LoggerInterface;
|
||||||
* before we spit the page out.
|
* before we spit the page out.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class App
|
class App implements AppHelper
|
||||||
{
|
{
|
||||||
const PLATFORM = 'Friendica';
|
const PLATFORM = 'Friendica';
|
||||||
const CODENAME = 'Yellow Archangel';
|
const CODENAME = 'Yellow Archangel';
|
||||||
const VERSION = '2024.12-dev';
|
const VERSION = '2024.12-dev';
|
||||||
|
|
||||||
// Allow themes to control internal parameters
|
|
||||||
// by changing App values in theme.php
|
|
||||||
private $theme_info = [
|
|
||||||
'videowidth' => 425,
|
|
||||||
'videoheight' => 350,
|
|
||||||
];
|
|
||||||
|
|
||||||
private $timezone = '';
|
|
||||||
private $profile_owner = 0;
|
|
||||||
private $contact_id = 0;
|
|
||||||
private $queue = [];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var App\Mode The Mode of the Application
|
* @var Mode The Mode of the Application
|
||||||
*/
|
*/
|
||||||
private $mode;
|
private $mode;
|
||||||
|
|
||||||
|
@ -75,11 +64,6 @@ class App
|
||||||
*/
|
*/
|
||||||
private $baseURL;
|
private $baseURL;
|
||||||
|
|
||||||
/** @var string The name of the current theme */
|
|
||||||
private $currentTheme;
|
|
||||||
/** @var string The name of the current mobile theme */
|
|
||||||
private $currentMobileTheme;
|
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
private $requestId;
|
private $requestId;
|
||||||
|
|
||||||
|
@ -101,11 +85,6 @@ class App
|
||||||
*/
|
*/
|
||||||
private $profiler;
|
private $profiler;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var Database The Friendica database connection
|
|
||||||
*/
|
|
||||||
private $database;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var L10n The translator
|
* @var L10n The translator
|
||||||
*/
|
*/
|
||||||
|
@ -116,166 +95,32 @@ class App
|
||||||
*/
|
*/
|
||||||
private $args;
|
private $args;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var IManagePersonalConfigValues
|
|
||||||
*/
|
|
||||||
private $pConfig;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var IHandleUserSessions
|
* @var IHandleUserSessions
|
||||||
*/
|
*/
|
||||||
private $session;
|
private $session;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the profile owner ID
|
* @var AppHelper $appHelper
|
||||||
*
|
|
||||||
* @param int $owner_id
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public function setProfileOwner(int $owner_id)
|
private $appHelper;
|
||||||
{
|
|
||||||
$this->profile_owner = $owner_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
public function __construct(
|
||||||
* Get the profile owner ID
|
Request $request,
|
||||||
*
|
Authentication $auth,
|
||||||
* @return int
|
IManageConfigValues $config,
|
||||||
*/
|
Mode $mode,
|
||||||
public function getProfileOwner(): int
|
BaseURL $baseURL,
|
||||||
{
|
LoggerInterface $logger,
|
||||||
return $this->profile_owner;
|
Profiler $profiler,
|
||||||
}
|
L10n $l10n,
|
||||||
|
Arguments $args,
|
||||||
/**
|
IHandleUserSessions $session,
|
||||||
* Set the contact ID
|
DbaDefinition $dbaDefinition,
|
||||||
*
|
ViewDefinition $viewDefinition
|
||||||
* @param int $contact_id
|
) {
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setContactId(int $contact_id)
|
|
||||||
{
|
|
||||||
$this->contact_id = $contact_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the contact ID
|
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function getContactId(): int
|
|
||||||
{
|
|
||||||
return $this->contact_id;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the timezone
|
|
||||||
*
|
|
||||||
* @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setTimeZone(string $timezone)
|
|
||||||
{
|
|
||||||
$this->timezone = (new \DateTimeZone($timezone))->getName();
|
|
||||||
DateTimeFormat::setLocalTimeZone($this->timezone);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the timezone
|
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public function getTimeZone(): string
|
|
||||||
{
|
|
||||||
return $this->timezone;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set workerqueue information
|
|
||||||
*
|
|
||||||
* @param array $queue
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setQueue(array $queue)
|
|
||||||
{
|
|
||||||
$this->queue = $queue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetch workerqueue information
|
|
||||||
*
|
|
||||||
* @return array Worker queue
|
|
||||||
*/
|
|
||||||
public function getQueue(): array
|
|
||||||
{
|
|
||||||
return $this->queue ?? [];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fetch a specific workerqueue field
|
|
||||||
*
|
|
||||||
* @param string $index Work queue record to fetch
|
|
||||||
* @return mixed Work queue item or NULL if not found
|
|
||||||
*/
|
|
||||||
public function getQueueValue(string $index)
|
|
||||||
{
|
|
||||||
return $this->queue[$index] ?? null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setThemeInfoValue(string $index, $value)
|
|
||||||
{
|
|
||||||
$this->theme_info[$index] = $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getThemeInfo()
|
|
||||||
{
|
|
||||||
return $this->theme_info;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getThemeInfoValue(string $index, $default = null)
|
|
||||||
{
|
|
||||||
return $this->theme_info[$index] ?? $default;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the current config cache of this node
|
|
||||||
*
|
|
||||||
* @return Cache
|
|
||||||
*/
|
|
||||||
public function getConfigCache()
|
|
||||||
{
|
|
||||||
return $this->config->getCache();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The basepath of this app
|
|
||||||
*
|
|
||||||
* @return string Base path from configuration
|
|
||||||
*/
|
|
||||||
public function getBasePath(): string
|
|
||||||
{
|
|
||||||
return $this->config->get('system', 'basepath');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param Database $database The Friendica Database
|
|
||||||
* @param IManageConfigValues $config The Configuration
|
|
||||||
* @param App\Mode $mode The mode of this Friendica app
|
|
||||||
* @param BaseURL $baseURL The full base URL of this Friendica app
|
|
||||||
* @param LoggerInterface $logger The current app logger
|
|
||||||
* @param Profiler $profiler The profiler of this application
|
|
||||||
* @param L10n $l10n The translator instance
|
|
||||||
* @param App\Arguments $args The Friendica Arguments of the call
|
|
||||||
* @param IManagePersonalConfigValues $pConfig Personal configuration
|
|
||||||
* @param IHandleUserSessions $session The (User)Session handler
|
|
||||||
* @param DbaDefinition $dbaDefinition
|
|
||||||
* @param ViewDefinition $viewDefinition
|
|
||||||
*/
|
|
||||||
public function __construct(Request $request, Authentication $auth, Database $database, IManageConfigValues $config, App\Mode $mode, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, IManagePersonalConfigValues $pConfig, IHandleUserSessions $session, DbaDefinition $dbaDefinition, ViewDefinition $viewDefinition)
|
|
||||||
{
|
|
||||||
$this->requestId = $request->getRequestId();
|
$this->requestId = $request->getRequestId();
|
||||||
$this->auth = $auth;
|
$this->auth = $auth;
|
||||||
$this->database = $database;
|
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->mode = $mode;
|
$this->mode = $mode;
|
||||||
$this->baseURL = $baseURL;
|
$this->baseURL = $baseURL;
|
||||||
|
@ -283,12 +128,171 @@ class App
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
$this->l10n = $l10n;
|
$this->l10n = $l10n;
|
||||||
$this->args = $args;
|
$this->args = $args;
|
||||||
$this->pConfig = $pConfig;
|
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
|
$this->appHelper = DI::appHelper();
|
||||||
|
|
||||||
$this->load($dbaDefinition, $viewDefinition);
|
$this->load($dbaDefinition, $viewDefinition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the profile owner ID
|
||||||
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::setProfileOwner() instead
|
||||||
|
*
|
||||||
|
* @param int $owner_id
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setProfileOwner(int $owner_id)
|
||||||
|
{
|
||||||
|
$this->appHelper->setProfileOwner($owner_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the profile owner ID
|
||||||
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::getProfileOwner() instead
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getProfileOwner(): int
|
||||||
|
{
|
||||||
|
return $this->appHelper->getProfileOwner();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the contact ID
|
||||||
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::setContactId() instead
|
||||||
|
*
|
||||||
|
* @param int $contact_id
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setContactId(int $contact_id)
|
||||||
|
{
|
||||||
|
$this->appHelper->setContactId($contact_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the contact ID
|
||||||
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::getContactId() instead
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getContactId(): int
|
||||||
|
{
|
||||||
|
return $this->appHelper->getContactId();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the timezone
|
||||||
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::setTimeZone() instead
|
||||||
|
*
|
||||||
|
* @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setTimeZone(string $timezone)
|
||||||
|
{
|
||||||
|
$this->appHelper->setTimeZone($timezone);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the timezone
|
||||||
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::getTimeZone() instead
|
||||||
|
*/
|
||||||
|
public function getTimeZone(): string
|
||||||
|
{
|
||||||
|
return $this->appHelper->getTimeZone();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set workerqueue information
|
||||||
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::setQueue() instead
|
||||||
|
*
|
||||||
|
* @param array $queue
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setQueue(array $queue)
|
||||||
|
{
|
||||||
|
$this->appHelper->setQueue($queue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch workerqueue information
|
||||||
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::getQueue() instead
|
||||||
|
*
|
||||||
|
* @return array Worker queue
|
||||||
|
*/
|
||||||
|
public function getQueue(): array
|
||||||
|
{
|
||||||
|
return $this->appHelper->getQueue();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch a specific workerqueue field
|
||||||
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::getQueueValue() instead
|
||||||
|
*
|
||||||
|
* @param string $index Work queue record to fetch
|
||||||
|
* @return mixed Work queue item or NULL if not found
|
||||||
|
*/
|
||||||
|
public function getQueueValue(string $index)
|
||||||
|
{
|
||||||
|
return $this->appHelper->getQueueValue($index);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated 2024.12 Use AppHelper::setThemeInfoValue() instead
|
||||||
|
*/
|
||||||
|
public function setThemeInfoValue(string $index, $value)
|
||||||
|
{
|
||||||
|
$this->appHelper->setThemeInfoValue($index, $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated 2024.12 Use AppHelper::getThemeInfo() instead
|
||||||
|
*/
|
||||||
|
public function getThemeInfo()
|
||||||
|
{
|
||||||
|
return $this->appHelper->getThemeInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated 2024.12 Use AppHelper::getThemeInfoValue() instead
|
||||||
|
*/
|
||||||
|
public function getThemeInfoValue(string $index, $default = null)
|
||||||
|
{
|
||||||
|
return $this->appHelper->getThemeInfoValue($index, $default);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current config cache of this node
|
||||||
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::getConfigCache() instead
|
||||||
|
*
|
||||||
|
* @return Cache
|
||||||
|
*/
|
||||||
|
public function getConfigCache()
|
||||||
|
{
|
||||||
|
return $this->appHelper->getConfigCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The basepath of this app
|
||||||
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::getBasePath() instead
|
||||||
|
*
|
||||||
|
* @return string Base path from configuration
|
||||||
|
*/
|
||||||
|
public function getBasePath(): string
|
||||||
|
{
|
||||||
|
return $this->appHelper->getBasePath();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the whole app instance
|
* Load the whole app instance
|
||||||
*/
|
*/
|
||||||
|
@ -310,17 +314,11 @@ class App
|
||||||
// Ensure that all "strtotime" operations do run timezone independent
|
// Ensure that all "strtotime" operations do run timezone independent
|
||||||
date_default_timezone_set('UTC');
|
date_default_timezone_set('UTC');
|
||||||
|
|
||||||
set_include_path(
|
|
||||||
get_include_path() . PATH_SEPARATOR
|
|
||||||
. $this->getBasePath() . DIRECTORY_SEPARATOR . 'include' . PATH_SEPARATOR
|
|
||||||
. $this->getBasePath() . DIRECTORY_SEPARATOR . 'library' . PATH_SEPARATOR
|
|
||||||
. $this->getBasePath());
|
|
||||||
|
|
||||||
$this->profiler->reset();
|
$this->profiler->reset();
|
||||||
|
|
||||||
if ($this->mode->has(App\Mode::DBAVAILABLE)) {
|
if ($this->mode->has(Mode::DBAVAILABLE)) {
|
||||||
Core\Hook::loadHooks();
|
Core\Hook::loadHooks();
|
||||||
$loader = (new Config())->createConfigFileManager($this->getBasePath(), $_SERVER);
|
$loader = (new Config())->createConfigFileManager($this->appHelper->getBasePath(), $_SERVER);
|
||||||
Core\Hook::callAll('load_config', $loader);
|
Core\Hook::callAll('load_config', $loader);
|
||||||
|
|
||||||
// Hooks are now working, reload the whole definitions with hook enabled
|
// Hooks are now working, reload the whole definitions with hook enabled
|
||||||
|
@ -349,157 +347,70 @@ class App
|
||||||
$timezone = $default_timezone ?? '' ?: 'UTC';
|
$timezone = $default_timezone ?? '' ?: 'UTC';
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->setTimeZone($timezone);
|
$this->appHelper->setTimeZone($timezone);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current theme name. May be overridden by the mobile theme name.
|
* Returns the current theme name. May be overridden by the mobile theme name.
|
||||||
*
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::getCurrentTheme() instead
|
||||||
|
*
|
||||||
* @return string Current theme name or empty string in installation phase
|
* @return string Current theme name or empty string in installation phase
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function getCurrentTheme(): string
|
public function getCurrentTheme(): string
|
||||||
{
|
{
|
||||||
if ($this->mode->isInstall()) {
|
return $this->appHelper->getCurrentTheme();
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Specific mobile theme override
|
|
||||||
if (($this->mode->isMobile() || $this->mode->isTablet()) && $this->session->get('show-mobile', true)) {
|
|
||||||
$user_mobile_theme = $this->getCurrentMobileTheme();
|
|
||||||
|
|
||||||
// --- means same mobile theme as desktop
|
|
||||||
if (!empty($user_mobile_theme) && $user_mobile_theme !== '---') {
|
|
||||||
return $user_mobile_theme;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$this->currentTheme) {
|
|
||||||
$this->computeCurrentTheme();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->currentTheme;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the current mobile theme name.
|
* Returns the current mobile theme name.
|
||||||
*
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::getCurrentMobileTheme() instead
|
||||||
|
*
|
||||||
* @return string Mobile theme name or empty string if installer
|
* @return string Mobile theme name or empty string if installer
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function getCurrentMobileTheme(): string
|
public function getCurrentMobileTheme(): string
|
||||||
{
|
{
|
||||||
if ($this->mode->isInstall()) {
|
return $this->appHelper->getCurrentMobileTheme();
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_null($this->currentMobileTheme)) {
|
|
||||||
$this->computeCurrentMobileTheme();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->currentMobileTheme;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for current theme name
|
* Setter for current theme name
|
||||||
*
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::setCurrentTheme() instead
|
||||||
|
*
|
||||||
* @param string $theme Name of current theme
|
* @param string $theme Name of current theme
|
||||||
*/
|
*/
|
||||||
public function setCurrentTheme(string $theme)
|
public function setCurrentTheme(string $theme)
|
||||||
{
|
{
|
||||||
$this->currentTheme = $theme;
|
$this->appHelper->setCurrentTheme($theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setter for current mobile theme name
|
* Setter for current mobile theme name
|
||||||
*
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::setCurrentMobileTheme() instead
|
||||||
|
*
|
||||||
* @param string $theme Name of current mobile theme
|
* @param string $theme Name of current mobile theme
|
||||||
*/
|
*/
|
||||||
public function setCurrentMobileTheme(string $theme)
|
public function setCurrentMobileTheme(string $theme)
|
||||||
{
|
{
|
||||||
$this->currentMobileTheme = $theme;
|
$this->appHelper->setCurrentMobileTheme($theme);
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Computes the current theme name based on the node settings, the page owner settings and the user settings
|
|
||||||
*
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
private function computeCurrentTheme()
|
|
||||||
{
|
|
||||||
$system_theme = $this->config->get('system', 'theme');
|
|
||||||
if (!$system_theme) {
|
|
||||||
throw new Exception($this->l10n->t('No system theme config value set.'));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sane default
|
|
||||||
$this->setCurrentTheme($system_theme);
|
|
||||||
|
|
||||||
$page_theme = null;
|
|
||||||
// Find the theme that belongs to the user whose stuff we are looking at
|
|
||||||
if (!empty($this->profile_owner) && ($this->profile_owner != $this->session->getLocalUserId())) {
|
|
||||||
// Allow folks to override user themes and always use their own on their own site.
|
|
||||||
// This works only if the user is on the same server
|
|
||||||
$user = $this->database->selectFirst('user', ['theme'], ['uid' => $this->profile_owner]);
|
|
||||||
if ($this->database->isResult($user) && !$this->session->getLocalUserId()) {
|
|
||||||
$page_theme = $user['theme'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$theme_name = $page_theme ?: $this->session->get('theme', $system_theme);
|
|
||||||
|
|
||||||
$theme_name = Strings::sanitizeFilePathItem($theme_name);
|
|
||||||
if ($theme_name
|
|
||||||
&& in_array($theme_name, Theme::getAllowedList())
|
|
||||||
&& (file_exists('view/theme/' . $theme_name . '/style.css')
|
|
||||||
|| file_exists('view/theme/' . $theme_name . '/style.php'))
|
|
||||||
) {
|
|
||||||
$this->setCurrentTheme($theme_name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Computes the current mobile theme name based on the node settings, the page owner settings and the user settings
|
|
||||||
*/
|
|
||||||
private function computeCurrentMobileTheme()
|
|
||||||
{
|
|
||||||
$system_mobile_theme = $this->config->get('system', 'mobile-theme', '');
|
|
||||||
|
|
||||||
// Sane default
|
|
||||||
$this->setCurrentMobileTheme($system_mobile_theme);
|
|
||||||
|
|
||||||
$page_mobile_theme = null;
|
|
||||||
// Find the theme that belongs to the user whose stuff we are looking at
|
|
||||||
if (!empty($this->profile_owner) && ($this->profile_owner != $this->session->getLocalUserId())) {
|
|
||||||
// Allow folks to override user themes and always use their own on their own site.
|
|
||||||
// This works only if the user is on the same server
|
|
||||||
if (!$this->session->getLocalUserId()) {
|
|
||||||
$page_mobile_theme = $this->pConfig->get($this->profile_owner, 'system', 'mobile-theme');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$mobile_theme_name = $page_mobile_theme ?: $this->session->get('mobile-theme', $system_mobile_theme);
|
|
||||||
|
|
||||||
$mobile_theme_name = Strings::sanitizeFilePathItem($mobile_theme_name);
|
|
||||||
if ($mobile_theme_name == '---'
|
|
||||||
||
|
|
||||||
in_array($mobile_theme_name, Theme::getAllowedList())
|
|
||||||
&& (file_exists('view/theme/' . $mobile_theme_name . '/style.css')
|
|
||||||
|| file_exists('view/theme/' . $mobile_theme_name . '/style.php'))
|
|
||||||
) {
|
|
||||||
$this->setCurrentMobileTheme($mobile_theme_name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provide a sane default if nothing is chosen or the specified theme does not exist.
|
* Provide a sane default if nothing is chosen or the specified theme does not exist.
|
||||||
*
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::getCurrentThemeStylesheetPath() instead
|
||||||
|
*
|
||||||
* @return string Current theme's stylesheet path
|
* @return string Current theme's stylesheet path
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public function getCurrentThemeStylesheetPath(): string
|
public function getCurrentThemeStylesheetPath(): string
|
||||||
{
|
{
|
||||||
return Core\Theme::getStylesheetPath($this->getCurrentTheme());
|
return $this->appHelper->getCurrentThemeStylesheetPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -510,10 +421,10 @@ class App
|
||||||
*
|
*
|
||||||
* This probably should change to limit the size of this monster method.
|
* This probably should change to limit the size of this monster method.
|
||||||
*
|
*
|
||||||
* @param App\Router $router
|
* @param Router $router
|
||||||
* @param IManagePersonalConfigValues $pconfig
|
* @param IManagePersonalConfigValues $pconfig
|
||||||
* @param Authentication $auth The Authentication backend of the node
|
* @param Authentication $auth The Authentication backend of the node
|
||||||
* @param App\Page $page The Friendica page printing container
|
* @param Page $page The Friendica page printing container
|
||||||
* @param ModuleHTTPException $httpException The possible HTTP Exception container
|
* @param ModuleHTTPException $httpException The possible HTTP Exception container
|
||||||
* @param HTTPInputData $httpInput A library for processing PHP input streams
|
* @param HTTPInputData $httpInput A library for processing PHP input streams
|
||||||
* @param float $start_time The start time of the overall script execution
|
* @param float $start_time The start time of the overall script execution
|
||||||
|
@ -522,8 +433,17 @@ class App
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
* @throws \ImagickException
|
* @throws \ImagickException
|
||||||
*/
|
*/
|
||||||
public function runFrontend(App\Router $router, IManagePersonalConfigValues $pconfig, Authentication $auth, App\Page $page, Nav $nav, ModuleHTTPException $httpException, HTTPInputData $httpInput, float $start_time, array $server)
|
public function runFrontend(
|
||||||
{
|
Router $router,
|
||||||
|
IManagePersonalConfigValues $pconfig,
|
||||||
|
Authentication $auth,
|
||||||
|
Page $page,
|
||||||
|
Nav $nav,
|
||||||
|
ModuleHTTPException $httpException,
|
||||||
|
HTTPInputData $httpInput,
|
||||||
|
float $start_time,
|
||||||
|
array $server
|
||||||
|
) {
|
||||||
$requeststring = ($server['REQUEST_METHOD'] ?? '') . ' ' . ($server['REQUEST_URI'] ?? '') . ' ' . ($server['SERVER_PROTOCOL'] ?? '');
|
$requeststring = ($server['REQUEST_METHOD'] ?? '') . ' ' . ($server['REQUEST_URI'] ?? '') . ' ' . ($server['SERVER_PROTOCOL'] ?? '');
|
||||||
$this->logger->debug('Request received', ['address' => $server['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $server['HTTP_REFERER'] ?? '', 'user-agent' => $server['HTTP_USER_AGENT'] ?? '']);
|
$this->logger->debug('Request received', ['address' => $server['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $server['HTTP_REFERER'] ?? '', 'user-agent' => $server['HTTP_USER_AGENT'] ?? '']);
|
||||||
$request_start = microtime(true);
|
$request_start = microtime(true);
|
||||||
|
@ -536,7 +456,7 @@ class App
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Missing DB connection: ERROR
|
// Missing DB connection: ERROR
|
||||||
if ($this->mode->has(App\Mode::LOCALCONFIGPRESENT) && !$this->mode->has(App\Mode::DBAVAILABLE)) {
|
if ($this->mode->has(Mode::LOCALCONFIGPRESENT) && !$this->mode->has(Mode::DBAVAILABLE)) {
|
||||||
throw new HTTPException\InternalServerErrorException($this->l10n->t('Apologies but the website is unavailable at the moment.'));
|
throw new HTTPException\InternalServerErrorException($this->l10n->t('Apologies but the website is unavailable at the moment.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -583,7 +503,7 @@ class App
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->mode->isBackend()) {
|
if (!$this->mode->isBackend()) {
|
||||||
$auth->withSession($this);
|
$auth->withSession();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->session->isUnauthenticated()) {
|
if ($this->session->isUnauthenticated()) {
|
||||||
|
@ -601,7 +521,7 @@ class App
|
||||||
if ($this->mode->isInstall() && $moduleName !== 'install') {
|
if ($this->mode->isInstall() && $moduleName !== 'install') {
|
||||||
$this->baseURL->redirect('install');
|
$this->baseURL->redirect('install');
|
||||||
} else {
|
} else {
|
||||||
Core\Update::check($this->getBasePath(), false);
|
Core\Update::check($this->appHelper->getBasePath(), false);
|
||||||
Core\Addon::loadAddons();
|
Core\Addon::loadAddons();
|
||||||
Core\Hook::loadHooks();
|
Core\Hook::loadHooks();
|
||||||
}
|
}
|
||||||
|
@ -648,7 +568,7 @@ class App
|
||||||
$page['page_title'] = $moduleName;
|
$page['page_title'] = $moduleName;
|
||||||
|
|
||||||
// The "view" module is required to show the theme CSS
|
// The "view" module is required to show the theme CSS
|
||||||
if (!$this->mode->isInstall() && !$this->mode->has(App\Mode::MAINTENANCEDISABLED) && $moduleName !== 'view') {
|
if (!$this->mode->isInstall() && !$this->mode->has(Mode::MAINTENANCEDISABLED) && $moduleName !== 'view') {
|
||||||
$module = $router->getModule(Maintenance::class);
|
$module = $router->getModule(Maintenance::class);
|
||||||
} else {
|
} else {
|
||||||
// determine the module class and save it to the module instance
|
// determine the module class and save it to the module instance
|
||||||
|
@ -688,17 +608,15 @@ class App
|
||||||
* Automatically redirects to relative or absolute URL
|
* Automatically redirects to relative or absolute URL
|
||||||
* Should only be used if it isn't clear if the URL is either internal or external
|
* Should only be used if it isn't clear if the URL is either internal or external
|
||||||
*
|
*
|
||||||
|
* @deprecated 2024.12 Use AppHelper::redirect() instead
|
||||||
|
*
|
||||||
* @param string $toUrl The target URL
|
* @param string $toUrl The target URL
|
||||||
*
|
*
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
public function redirect(string $toUrl)
|
public function redirect(string $toUrl)
|
||||||
{
|
{
|
||||||
if (!empty(parse_url($toUrl, PHP_URL_SCHEME))) {
|
$this->appHelper->redirect($toUrl);
|
||||||
Core\System::externalRedirect($toUrl);
|
|
||||||
} else {
|
|
||||||
$this->baseURL->redirect($toUrl);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,6 +11,7 @@ use ArrayAccess;
|
||||||
use DOMDocument;
|
use DOMDocument;
|
||||||
use DOMXPath;
|
use DOMXPath;
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Content\Nav;
|
use Friendica\Content\Nav;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
@ -21,7 +22,6 @@ use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Session\Model\UserSession;
|
use Friendica\Core\Session\Model\UserSession;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Core\Theme;
|
use Friendica\Core\Theme;
|
||||||
use Friendica\Module\Response;
|
|
||||||
use Friendica\Network\HTTPException;
|
use Friendica\Network\HTTPException;
|
||||||
use Friendica\Util\Images;
|
use Friendica\Util\Images;
|
||||||
use Friendica\Util\Network;
|
use Friendica\Util\Network;
|
||||||
|
@ -176,7 +176,6 @@ class Page implements ArrayAccess
|
||||||
* - Infinite scroll data
|
* - Infinite scroll data
|
||||||
* - head.tpl template
|
* - head.tpl template
|
||||||
*
|
*
|
||||||
* @param App $app The Friendica App instance
|
|
||||||
* @param Arguments $args The Friendica App Arguments
|
* @param Arguments $args The Friendica App Arguments
|
||||||
* @param L10n $l10n The l10n language instance
|
* @param L10n $l10n The l10n language instance
|
||||||
* @param IManageConfigValues $config The Friendica configuration
|
* @param IManageConfigValues $config The Friendica configuration
|
||||||
|
@ -185,8 +184,14 @@ class Page implements ArrayAccess
|
||||||
*
|
*
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
private function initHead(App $app, Arguments $args, L10n $l10n, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, int $localUID)
|
private function initHead(
|
||||||
{
|
AppHelper $appHelper,
|
||||||
|
Arguments $args,
|
||||||
|
L10n $l10n,
|
||||||
|
IManageConfigValues $config,
|
||||||
|
IManagePersonalConfigValues $pConfig,
|
||||||
|
int $localUID
|
||||||
|
) {
|
||||||
$interval = ($localUID ? $pConfig->get($localUID, 'system', 'update_interval') : 40000);
|
$interval = ($localUID ? $pConfig->get($localUID, 'system', 'update_interval') : 40000);
|
||||||
|
|
||||||
// If the update is 'deactivated' set it to the highest integer number (~24 days)
|
// If the update is 'deactivated' set it to the highest integer number (~24 days)
|
||||||
|
@ -209,7 +214,7 @@ class Page implements ArrayAccess
|
||||||
if (!empty(Renderer::$theme['stylesheet'])) {
|
if (!empty(Renderer::$theme['stylesheet'])) {
|
||||||
$stylesheet = Renderer::$theme['stylesheet'];
|
$stylesheet = Renderer::$theme['stylesheet'];
|
||||||
} else {
|
} else {
|
||||||
$stylesheet = $app->getCurrentThemeStylesheetPath();
|
$stylesheet = $appHelper->getCurrentThemeStylesheetPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->registerStylesheet($stylesheet);
|
$this->registerStylesheet($stylesheet);
|
||||||
|
@ -313,7 +318,6 @@ class Page implements ArrayAccess
|
||||||
* - Registered footer scripts (through App->registerFooterScript())
|
* - Registered footer scripts (through App->registerFooterScript())
|
||||||
* - footer.tpl template
|
* - footer.tpl template
|
||||||
*
|
*
|
||||||
* @param App $app The Friendica App instance
|
|
||||||
* @param Mode $mode The Friendica runtime mode
|
* @param Mode $mode The Friendica runtime mode
|
||||||
* @param L10n $l10n The l10n instance
|
* @param L10n $l10n The l10n instance
|
||||||
*
|
*
|
||||||
|
@ -399,7 +403,6 @@ class Page implements ArrayAccess
|
||||||
/**
|
/**
|
||||||
* Executes the creation of the current page and prints it to the screen
|
* Executes the creation of the current page and prints it to the screen
|
||||||
*
|
*
|
||||||
* @param App $app The Friendica App
|
|
||||||
* @param BaseURL $baseURL The Friendica Base URL
|
* @param BaseURL $baseURL The Friendica Base URL
|
||||||
* @param Arguments $args The Friendica App arguments
|
* @param Arguments $args The Friendica App arguments
|
||||||
* @param Mode $mode The current node mode
|
* @param Mode $mode The current node mode
|
||||||
|
@ -414,8 +417,20 @@ class Page implements ArrayAccess
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
* @throws HTTPException\ServiceUnavailableException
|
* @throws HTTPException\ServiceUnavailableException
|
||||||
*/
|
*/
|
||||||
public function run(App $app, UserSession $session, BaseURL $baseURL, Arguments $args, Mode $mode, ResponseInterface $response, L10n $l10n, Profiler $profiler, IManageConfigValues $config, IManagePersonalConfigValues $pconfig, Nav $nav, int $localUID)
|
public function run(
|
||||||
{
|
AppHelper $appHelper,
|
||||||
|
UserSession $session,
|
||||||
|
BaseURL $baseURL,
|
||||||
|
Arguments $args,
|
||||||
|
Mode $mode,
|
||||||
|
ResponseInterface $response,
|
||||||
|
L10n $l10n,
|
||||||
|
Profiler $profiler,
|
||||||
|
IManageConfigValues $config,
|
||||||
|
IManagePersonalConfigValues $pconfig,
|
||||||
|
Nav $nav,
|
||||||
|
int $localUID
|
||||||
|
) {
|
||||||
$moduleName = $args->getModuleName();
|
$moduleName = $args->getModuleName();
|
||||||
|
|
||||||
$this->command = $moduleName;
|
$this->command = $moduleName;
|
||||||
|
@ -430,7 +445,7 @@ class Page implements ArrayAccess
|
||||||
$this->initContent($response, $mode);
|
$this->initContent($response, $mode);
|
||||||
|
|
||||||
// Load current theme info after module has been initialized as theme could have been set in module
|
// Load current theme info after module has been initialized as theme could have been set in module
|
||||||
$currentTheme = $app->getCurrentTheme();
|
$currentTheme = $appHelper->getCurrentTheme();
|
||||||
$theme_info_file = 'view/theme/' . $currentTheme . '/theme.php';
|
$theme_info_file = 'view/theme/' . $currentTheme . '/theme.php';
|
||||||
if (file_exists($theme_info_file)) {
|
if (file_exists($theme_info_file)) {
|
||||||
require_once $theme_info_file;
|
require_once $theme_info_file;
|
||||||
|
@ -438,7 +453,7 @@ class Page implements ArrayAccess
|
||||||
|
|
||||||
if (function_exists(str_replace('-', '_', $currentTheme) . '_init')) {
|
if (function_exists(str_replace('-', '_', $currentTheme) . '_init')) {
|
||||||
$func = str_replace('-', '_', $currentTheme) . '_init';
|
$func = str_replace('-', '_', $currentTheme) . '_init';
|
||||||
$func($app);
|
$func($appHelper);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create the page head after setting the language
|
/* Create the page head after setting the language
|
||||||
|
@ -448,7 +463,7 @@ class Page implements ArrayAccess
|
||||||
* all the module functions have executed so that all
|
* all the module functions have executed so that all
|
||||||
* theme choices made by the modules can take effect.
|
* theme choices made by the modules can take effect.
|
||||||
*/
|
*/
|
||||||
$this->initHead($app, $args, $l10n, $config, $pconfig, $localUID);
|
$this->initHead($appHelper, $args, $l10n, $config, $pconfig, $localUID);
|
||||||
|
|
||||||
/* Build the page ending -- this is stuff that goes right before
|
/* Build the page ending -- this is stuff that goes right before
|
||||||
* the closing </body> tag
|
* the closing </body> tag
|
||||||
|
@ -534,7 +549,7 @@ class Page implements ArrayAccess
|
||||||
}
|
}
|
||||||
|
|
||||||
// Theme templates expect $a as an App instance
|
// Theme templates expect $a as an App instance
|
||||||
$a = $app;
|
$a = $appHelper;
|
||||||
|
|
||||||
// Used as is in view/php/default.php
|
// Used as is in view/php/default.php
|
||||||
$lang = $l10n->getCurrentLang();
|
$lang = $l10n->getCurrentLang();
|
||||||
|
|
139
src/AppHelper.php
Normal file
139
src/AppHelper.php
Normal file
|
@ -0,0 +1,139 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Copyright (C) 2010-2024, the Friendica project
|
||||||
|
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
namespace Friendica;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Friendica\Core\Config\ValueObject\Cache;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper for our main application structure for the life of this page.
|
||||||
|
*
|
||||||
|
* Primarily deals with the URL that got us here
|
||||||
|
* and tries to make some sense of it, and
|
||||||
|
* stores our page contents and config storage
|
||||||
|
* and anything else that might need to be passed around
|
||||||
|
* before we spit the page out.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
interface AppHelper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Set the profile owner ID
|
||||||
|
*/
|
||||||
|
public function setProfileOwner(int $owner_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the profile owner ID
|
||||||
|
*/
|
||||||
|
public function getProfileOwner(): int;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the timezone
|
||||||
|
*
|
||||||
|
* @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
|
||||||
|
*/
|
||||||
|
public function setTimeZone(string $timezone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the timezone name
|
||||||
|
*/
|
||||||
|
public function getTimeZone(): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the contact ID
|
||||||
|
*/
|
||||||
|
public function setContactId(int $contact_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the contact ID
|
||||||
|
*/
|
||||||
|
public function getContactId(): int;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set workerqueue information
|
||||||
|
*
|
||||||
|
* @param array<string,mixed> $queue
|
||||||
|
*/
|
||||||
|
public function setQueue(array $queue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch workerqueue information
|
||||||
|
*
|
||||||
|
* @return array<string,mixed> Worker queue
|
||||||
|
*/
|
||||||
|
public function getQueue();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch a specific workerqueue field
|
||||||
|
*
|
||||||
|
* @param string $index Work queue record to fetch
|
||||||
|
*
|
||||||
|
* @return mixed|null Work queue item or NULL if not found
|
||||||
|
*/
|
||||||
|
public function getQueueValue(string $index);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current theme name. May be overridden by the mobile theme name.
|
||||||
|
*
|
||||||
|
* @return string Current theme name or empty string in installation phase
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function getCurrentTheme(): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current mobile theme name.
|
||||||
|
*
|
||||||
|
* @return string Mobile theme name or empty string if installer
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function getCurrentMobileTheme(): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setter for current theme name
|
||||||
|
*
|
||||||
|
* @param string $theme Name of current theme
|
||||||
|
*/
|
||||||
|
public function setCurrentTheme(string $theme);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setter for current mobile theme name
|
||||||
|
*
|
||||||
|
* @param string $theme Name of current mobile theme
|
||||||
|
*/
|
||||||
|
public function setCurrentMobileTheme(string $theme);
|
||||||
|
|
||||||
|
public function setThemeInfoValue(string $index, $value);
|
||||||
|
|
||||||
|
public function getThemeInfo();
|
||||||
|
|
||||||
|
public function getThemeInfoValue(string $index, $default = null);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provide a sane default if nothing is chosen or the specified theme does not exist.
|
||||||
|
*
|
||||||
|
* @return string Current theme's stylesheet path
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function getCurrentThemeStylesheetPath(): string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current config cache of this node
|
||||||
|
*
|
||||||
|
* @return Cache
|
||||||
|
*/
|
||||||
|
public function getConfigCache();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The basepath of this app
|
||||||
|
*
|
||||||
|
* @return string Base path from configuration
|
||||||
|
*/
|
||||||
|
public function getBasePath(): string;
|
||||||
|
|
||||||
|
public function redirect(string $toUrl);
|
||||||
|
}
|
399
src/AppLegacy.php
Normal file
399
src/AppLegacy.php
Normal file
|
@ -0,0 +1,399 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Copyright (C) 2010-2024, the Friendica project
|
||||||
|
// SPDX-FileCopyrightText: 2010-2024 the Friendica project
|
||||||
|
//
|
||||||
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
namespace Friendica;
|
||||||
|
|
||||||
|
use DateTimeZone;
|
||||||
|
use Exception;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Mode;
|
||||||
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
|
use Friendica\Core\Config\ValueObject\Cache;
|
||||||
|
use Friendica\Core\L10n;
|
||||||
|
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
||||||
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
|
use Friendica\Core\System;
|
||||||
|
use Friendica\Core\Theme;
|
||||||
|
use Friendica\Database\Database;
|
||||||
|
use Friendica\Network\HTTPException\InternalServerErrorException;
|
||||||
|
use Friendica\Util\DateTimeFormat;
|
||||||
|
use Friendica\Util\Strings;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper for our main application structure for the life of this page.
|
||||||
|
*
|
||||||
|
* Primarily deals with the URL that got us here
|
||||||
|
* and tries to make some sense of it, and
|
||||||
|
* stores our page contents and config storage
|
||||||
|
* and anything else that might need to be passed around
|
||||||
|
* before we spit the page out.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
final class AppLegacy implements AppHelper
|
||||||
|
{
|
||||||
|
private $profile_owner = 0;
|
||||||
|
|
||||||
|
private $timezone = '';
|
||||||
|
|
||||||
|
private $contact_id = 0;
|
||||||
|
|
||||||
|
private $queue = [];
|
||||||
|
|
||||||
|
/** @var string The name of the current theme */
|
||||||
|
private $currentTheme;
|
||||||
|
|
||||||
|
/** @var string The name of the current mobile theme */
|
||||||
|
private $currentMobileTheme;
|
||||||
|
|
||||||
|
// Allow themes to control internal parameters
|
||||||
|
// by changing App values in theme.php
|
||||||
|
private $theme_info = [
|
||||||
|
'videowidth' => 425,
|
||||||
|
'videoheight' => 350,
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Database The Friendica database connection
|
||||||
|
*/
|
||||||
|
private $database;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var IManageConfigValues The config
|
||||||
|
*/
|
||||||
|
private $config;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var Mode The Mode of the Application
|
||||||
|
*/
|
||||||
|
private $mode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var BaseURL
|
||||||
|
*/
|
||||||
|
private $baseURL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var L10n The translator
|
||||||
|
*/
|
||||||
|
private $l10n;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var IManagePersonalConfigValues
|
||||||
|
*/
|
||||||
|
private $pConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var IHandleUserSessions
|
||||||
|
*/
|
||||||
|
private $session;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
Database $database,
|
||||||
|
IManageConfigValues $config,
|
||||||
|
Mode $mode,
|
||||||
|
BaseURL $baseURL,
|
||||||
|
L10n $l10n,
|
||||||
|
IManagePersonalConfigValues $pConfig,
|
||||||
|
IHandleUserSessions $session
|
||||||
|
) {
|
||||||
|
$this->database = $database;
|
||||||
|
$this->config = $config;
|
||||||
|
$this->mode = $mode;
|
||||||
|
$this->l10n = $l10n;
|
||||||
|
$this->baseURL = $baseURL;
|
||||||
|
$this->pConfig = $pConfig;
|
||||||
|
$this->session = $session;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the profile owner ID
|
||||||
|
*/
|
||||||
|
public function setProfileOwner(int $owner_id): void
|
||||||
|
{
|
||||||
|
$this->profile_owner = $owner_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the profile owner ID
|
||||||
|
*/
|
||||||
|
public function getProfileOwner(): int
|
||||||
|
{
|
||||||
|
return $this->profile_owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the timezone
|
||||||
|
*
|
||||||
|
* @param string $timezone A valid time zone identifier, see https://www.php.net/manual/en/timezones.php
|
||||||
|
*/
|
||||||
|
public function setTimeZone(string $timezone): void
|
||||||
|
{
|
||||||
|
$this->timezone = (new DateTimeZone($timezone))->getName();
|
||||||
|
|
||||||
|
DateTimeFormat::setLocalTimeZone($this->timezone);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the timezone name
|
||||||
|
*/
|
||||||
|
public function getTimeZone(): string
|
||||||
|
{
|
||||||
|
return $this->timezone;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the contact ID
|
||||||
|
*/
|
||||||
|
public function setContactId(int $contact_id): void
|
||||||
|
{
|
||||||
|
$this->contact_id = $contact_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the contact ID
|
||||||
|
*/
|
||||||
|
public function getContactId(): int
|
||||||
|
{
|
||||||
|
return $this->contact_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set workerqueue information
|
||||||
|
*
|
||||||
|
* @param array<string,mixed> $queue
|
||||||
|
*/
|
||||||
|
public function setQueue(array $queue): void
|
||||||
|
{
|
||||||
|
$this->queue = $queue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch workerqueue information
|
||||||
|
*
|
||||||
|
* @return array<string,mixed> Worker queue
|
||||||
|
*/
|
||||||
|
public function getQueue(): array
|
||||||
|
{
|
||||||
|
return $this->queue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch a specific workerqueue field
|
||||||
|
*
|
||||||
|
* @param string $index Work queue record to fetch
|
||||||
|
*
|
||||||
|
* @return mixed|null Work queue item or NULL if not found
|
||||||
|
*/
|
||||||
|
public function getQueueValue(string $index)
|
||||||
|
{
|
||||||
|
return $this->queue[$index] ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current theme name. May be overridden by the mobile theme name.
|
||||||
|
*
|
||||||
|
* @return string Current theme name or empty string in installation phase
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function getCurrentTheme(): string
|
||||||
|
{
|
||||||
|
if ($this->mode->isInstall()) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Specific mobile theme override
|
||||||
|
if (($this->mode->isMobile() || $this->mode->isTablet()) && $this->session->get('show-mobile', true)) {
|
||||||
|
$user_mobile_theme = $this->getCurrentMobileTheme();
|
||||||
|
|
||||||
|
// --- means same mobile theme as desktop
|
||||||
|
if (!empty($user_mobile_theme) && $user_mobile_theme !== '---') {
|
||||||
|
return $user_mobile_theme;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$this->currentTheme) {
|
||||||
|
$this->computeCurrentTheme();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->currentTheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current mobile theme name.
|
||||||
|
*
|
||||||
|
* @return string Mobile theme name or empty string if installer
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function getCurrentMobileTheme(): string
|
||||||
|
{
|
||||||
|
if ($this->mode->isInstall()) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_null($this->currentMobileTheme)) {
|
||||||
|
$this->computeCurrentMobileTheme();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->currentMobileTheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setter for current theme name
|
||||||
|
*
|
||||||
|
* @param string $theme Name of current theme
|
||||||
|
*/
|
||||||
|
public function setCurrentTheme(string $theme): void
|
||||||
|
{
|
||||||
|
$this->currentTheme = $theme;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Setter for current mobile theme name
|
||||||
|
*
|
||||||
|
* @param string $theme Name of current mobile theme
|
||||||
|
*/
|
||||||
|
public function setCurrentMobileTheme(string $theme): void
|
||||||
|
{
|
||||||
|
$this->currentMobileTheme = $theme;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setThemeInfoValue(string $index, $value): void
|
||||||
|
{
|
||||||
|
$this->theme_info[$index] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getThemeInfo(): array
|
||||||
|
{
|
||||||
|
return $this->theme_info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getThemeInfoValue(string $index, $default = null)
|
||||||
|
{
|
||||||
|
return $this->theme_info[$index] ?? $default;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provide a sane default if nothing is chosen or the specified theme does not exist.
|
||||||
|
*
|
||||||
|
* @return string Current theme's stylesheet path
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function getCurrentThemeStylesheetPath(): string
|
||||||
|
{
|
||||||
|
return Theme::getStylesheetPath($this->getCurrentTheme());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the current config cache of this node
|
||||||
|
*/
|
||||||
|
public function getConfigCache(): Cache
|
||||||
|
{
|
||||||
|
return $this->config->getCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The basepath of this app
|
||||||
|
*
|
||||||
|
* @return string Base path from configuration
|
||||||
|
*/
|
||||||
|
public function getBasePath(): string
|
||||||
|
{
|
||||||
|
return $this->config->get('system', 'basepath');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Computes the current theme name based on the node settings, the page owner settings and the user settings
|
||||||
|
*
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
private function computeCurrentTheme()
|
||||||
|
{
|
||||||
|
$system_theme = $this->config->get('system', 'theme');
|
||||||
|
if (!$system_theme) {
|
||||||
|
throw new Exception($this->l10n->t('No system theme config value set.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sane default
|
||||||
|
$this->setCurrentTheme($system_theme);
|
||||||
|
|
||||||
|
$page_theme = null;
|
||||||
|
$profile_owner = $this->getProfileOwner();
|
||||||
|
|
||||||
|
// Find the theme that belongs to the user whose stuff we are looking at
|
||||||
|
if (!empty($profile_owner) && ($profile_owner != $this->session->getLocalUserId())) {
|
||||||
|
// Allow folks to override user themes and always use their own on their own site.
|
||||||
|
// This works only if the user is on the same server
|
||||||
|
$user = $this->database->selectFirst('user', ['theme'], ['uid' => $profile_owner]);
|
||||||
|
if ($this->database->isResult($user) && !$this->session->getLocalUserId()) {
|
||||||
|
$page_theme = $user['theme'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$theme_name = $page_theme ?: $this->session->get('theme', $system_theme);
|
||||||
|
|
||||||
|
$theme_name = Strings::sanitizeFilePathItem($theme_name);
|
||||||
|
if ($theme_name
|
||||||
|
&& in_array($theme_name, Theme::getAllowedList())
|
||||||
|
&& (file_exists('view/theme/' . $theme_name . '/style.css')
|
||||||
|
|| file_exists('view/theme/' . $theme_name . '/style.php'))
|
||||||
|
) {
|
||||||
|
$this->setCurrentTheme($theme_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Computes the current mobile theme name based on the node settings, the page owner settings and the user settings
|
||||||
|
*/
|
||||||
|
private function computeCurrentMobileTheme()
|
||||||
|
{
|
||||||
|
$system_mobile_theme = $this->config->get('system', 'mobile-theme', '');
|
||||||
|
|
||||||
|
// Sane default
|
||||||
|
$this->setCurrentMobileTheme($system_mobile_theme);
|
||||||
|
|
||||||
|
$page_mobile_theme = null;
|
||||||
|
$profile_owner = $this->getProfileOwner();
|
||||||
|
|
||||||
|
// Find the theme that belongs to the user whose stuff we are looking at
|
||||||
|
if (!empty($profile_owner) && ($profile_owner != $this->session->getLocalUserId())) {
|
||||||
|
// Allow folks to override user themes and always use their own on their own site.
|
||||||
|
// This works only if the user is on the same server
|
||||||
|
if (!$this->session->getLocalUserId()) {
|
||||||
|
$page_mobile_theme = $this->pConfig->get($profile_owner, 'system', 'mobile-theme');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$mobile_theme_name = $page_mobile_theme ?: $this->session->get('mobile-theme', $system_mobile_theme);
|
||||||
|
|
||||||
|
$mobile_theme_name = Strings::sanitizeFilePathItem($mobile_theme_name);
|
||||||
|
if ($mobile_theme_name == '---'
|
||||||
|
||
|
||||||
|
in_array($mobile_theme_name, Theme::getAllowedList())
|
||||||
|
&& (file_exists('view/theme/' . $mobile_theme_name . '/style.css')
|
||||||
|
|| file_exists('view/theme/' . $mobile_theme_name . '/style.php'))
|
||||||
|
) {
|
||||||
|
$this->setCurrentMobileTheme($mobile_theme_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Automatically redirects to relative or absolute URL
|
||||||
|
* Should only be used if it isn't clear if the URL is either internal or external
|
||||||
|
*
|
||||||
|
* @param string $toUrl The target URL
|
||||||
|
*
|
||||||
|
* @throws InternalServerErrorException
|
||||||
|
*/
|
||||||
|
public function redirect(string $toUrl)
|
||||||
|
{
|
||||||
|
if (!empty(parse_url($toUrl, PHP_URL_SCHEME))) {
|
||||||
|
System::externalRedirect($toUrl);
|
||||||
|
} else {
|
||||||
|
$this->baseURL->redirect($toUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,8 +8,7 @@
|
||||||
namespace Friendica\Console;
|
namespace Friendica\Console;
|
||||||
|
|
||||||
use Console_Table;
|
use Console_Table;
|
||||||
use Friendica\App;
|
use Friendica\App\Mode;
|
||||||
use Friendica\Content\Pager;
|
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Addon as AddonCore;
|
use Friendica\Core\Addon as AddonCore;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
|
@ -24,7 +23,7 @@ class Addon extends \Asika\SimpleConsole\Console
|
||||||
protected $helpOptions = ['h', 'help', '?'];
|
protected $helpOptions = ['h', 'help', '?'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var App\Mode
|
* @var Mode
|
||||||
*/
|
*/
|
||||||
private $appMode;
|
private $appMode;
|
||||||
/**
|
/**
|
||||||
|
@ -57,7 +56,7 @@ HELP;
|
||||||
return $help;
|
return $help;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(App\Mode $appMode, L10n $l10n, Database $dba, array $argv = null)
|
public function __construct(Mode $appMode, L10n $l10n, Database $dba, array $argv = null)
|
||||||
{
|
{
|
||||||
parent::__construct($argv);
|
parent::__construct($argv);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
namespace Friendica\Console;
|
namespace Friendica\Console;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Mode;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
@ -28,7 +28,7 @@ class ArchiveContact extends \Asika\SimpleConsole\Console
|
||||||
protected $helpOptions = ['h', 'help', '?'];
|
protected $helpOptions = ['h', 'help', '?'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var App\Mode
|
* @var Mode
|
||||||
*/
|
*/
|
||||||
private $appMode;
|
private $appMode;
|
||||||
/**
|
/**
|
||||||
|
@ -57,7 +57,7 @@ HELP;
|
||||||
return $help;
|
return $help;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(App\Mode $appMode, Database $dba, \Friendica\Core\L10n $l10n, array $argv = null)
|
public function __construct(Mode $appMode, Database $dba, \Friendica\Core\L10n $l10n, array $argv = null)
|
||||||
{
|
{
|
||||||
parent::__construct($argv);
|
parent::__construct($argv);
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,7 @@ namespace Friendica\Console;
|
||||||
|
|
||||||
use Asika\SimpleConsole\Console;
|
use Asika\SimpleConsole\Console;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Friendica\App;
|
use Friendica\App\Mode;
|
||||||
use Friendica\App\BaseURL;
|
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\Config\ValueObject\Cache;
|
use Friendica\Core\Config\ValueObject\Cache;
|
||||||
use Friendica\Core\Installer;
|
use Friendica\Core\Installer;
|
||||||
|
@ -21,7 +20,7 @@ use RuntimeException;
|
||||||
|
|
||||||
class AutomaticInstallation extends Console
|
class AutomaticInstallation extends Console
|
||||||
{
|
{
|
||||||
/** @var App\Mode */
|
/** @var Mode */
|
||||||
private $appMode;
|
private $appMode;
|
||||||
/** @var \Friendica\Core\Config\ValueObject\Cache */
|
/** @var \Friendica\Core\Config\ValueObject\Cache */
|
||||||
private $configCache;
|
private $configCache;
|
||||||
|
@ -87,7 +86,7 @@ Examples
|
||||||
HELP;
|
HELP;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(App\Mode $appMode, Cache $configCache, IManageConfigValues $config, Database $dba, array $argv = null)
|
public function __construct(Mode $appMode, Cache $configCache, IManageConfigValues $config, Database $dba, array $argv = null)
|
||||||
{
|
{
|
||||||
parent::__construct($argv);
|
parent::__construct($argv);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
namespace Friendica\Console;
|
namespace Friendica\Console;
|
||||||
|
|
||||||
use Asika\SimpleConsole\CommandArgsException;
|
use Asika\SimpleConsole\CommandArgsException;
|
||||||
use Friendica\App;
|
use Friendica\App\Mode;
|
||||||
use Friendica\Core\Cache\Enum\Duration;
|
use Friendica\Core\Cache\Enum\Duration;
|
||||||
use Friendica\Core\Cache\Capability\ICanCache;
|
use Friendica\Core\Cache\Capability\ICanCache;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
|
@ -25,7 +25,7 @@ class Cache extends \Asika\SimpleConsole\Console
|
||||||
protected $helpOptions = ['h', 'help', '?'];
|
protected $helpOptions = ['h', 'help', '?'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var App\Mode
|
* @var Mode
|
||||||
*/
|
*/
|
||||||
private $appMode;
|
private $appMode;
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ HELP;
|
||||||
return $help;
|
return $help;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(App\Mode $appMode, ICanCache $cache, array $argv = null)
|
public function __construct(Mode $appMode, ICanCache $cache, array $argv = null)
|
||||||
{
|
{
|
||||||
parent::__construct($argv);
|
parent::__construct($argv);
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ HELP;
|
||||||
$this->out('Options: ' . var_export($this->options, true));
|
$this->out('Options: ' . var_export($this->options, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->appMode->has(App\Mode::DBAVAILABLE)) {
|
if (!$this->appMode->has(Mode::DBAVAILABLE)) {
|
||||||
$this->out('Database isn\'t ready or populated yet, database cache won\'t be available');
|
$this->out('Database isn\'t ready or populated yet, database cache won\'t be available');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
namespace Friendica\Console;
|
namespace Friendica\Console;
|
||||||
|
|
||||||
use Asika\SimpleConsole\CommandArgsException;
|
use Asika\SimpleConsole\CommandArgsException;
|
||||||
use Friendica\App;
|
use Friendica\App\Mode;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ class Config extends \Asika\SimpleConsole\Console
|
||||||
protected $helpOptions = ['h', 'help', '?'];
|
protected $helpOptions = ['h', 'help', '?'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var App\Mode
|
* @var Mode
|
||||||
*/
|
*/
|
||||||
private $appMode;
|
private $appMode;
|
||||||
/**
|
/**
|
||||||
|
@ -80,7 +80,7 @@ HELP;
|
||||||
return $help;
|
return $help;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(App\Mode $appMode, IManageConfigValues $config, array $argv = null)
|
public function __construct(Mode $appMode, IManageConfigValues $config, array $argv = null)
|
||||||
{
|
{
|
||||||
parent::__construct($argv);
|
parent::__construct($argv);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
namespace Friendica\Console;
|
namespace Friendica\Console;
|
||||||
|
|
||||||
use Console_Table;
|
use Console_Table;
|
||||||
use Friendica\App;
|
use Friendica\App\Mode;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Contact as ContactModel;
|
use Friendica\Model\Contact as ContactModel;
|
||||||
use Friendica\Model\User as UserModel;
|
use Friendica\Model\User as UserModel;
|
||||||
|
@ -25,7 +25,7 @@ class Contact extends \Asika\SimpleConsole\Console
|
||||||
protected $helpOptions = ['h', 'help', '?'];
|
protected $helpOptions = ['h', 'help', '?'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var App\Mode
|
* @var Mode
|
||||||
*/
|
*/
|
||||||
private $appMode;
|
private $appMode;
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +55,7 @@ HELP;
|
||||||
return $help;
|
return $help;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(App\Mode $appMode, array $argv = null)
|
public function __construct(Mode $appMode, array $argv = null)
|
||||||
{
|
{
|
||||||
parent::__construct($argv);
|
parent::__construct($argv);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
namespace Friendica\Console;
|
namespace Friendica\Console;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\AppHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When I installed docblox, I had the experience that it does not generate any output at all.
|
* When I installed docblox, I had the experience that it does not generate any output at all.
|
||||||
|
@ -33,14 +33,14 @@ class DocBloxErrorChecker extends \Asika\SimpleConsole\Console
|
||||||
|
|
||||||
protected $helpOptions = ['h', 'help', '?'];
|
protected $helpOptions = ['h', 'help', '?'];
|
||||||
|
|
||||||
/** @var App */
|
/** @var string */
|
||||||
private $app;
|
private $basePath;
|
||||||
|
|
||||||
public function __construct(App $app, array $argv = null)
|
public function __construct(AppHelper $appHelper, array $argv = null)
|
||||||
{
|
{
|
||||||
parent::__construct($argv);
|
parent::__construct($argv);
|
||||||
|
|
||||||
$this->app = $app;
|
$this->basePath = $appHelper->getBasePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getHelp()
|
protected function getHelp()
|
||||||
|
@ -73,7 +73,7 @@ HELP;
|
||||||
throw new \RuntimeException('DocBlox isn\'t available.');
|
throw new \RuntimeException('DocBlox isn\'t available.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$dir = $this->app->getBasePath();
|
$dir = $this->basePath;
|
||||||
|
|
||||||
//stack for dirs to search
|
//stack for dirs to search
|
||||||
$dirstack = [];
|
$dirstack = [];
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
namespace Friendica\Console;
|
namespace Friendica\Console;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Mode;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ class GlobalCommunityBlock extends \Asika\SimpleConsole\Console
|
||||||
protected $helpOptions = ['h', 'help', '?'];
|
protected $helpOptions = ['h', 'help', '?'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var App\Mode
|
* @var Mode
|
||||||
*/
|
*/
|
||||||
private $appMode;
|
private $appMode;
|
||||||
/**
|
/**
|
||||||
|
@ -48,7 +48,7 @@ HELP;
|
||||||
return $help;
|
return $help;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(App\Mode $appMode, L10n $l10n, $argv = null)
|
public function __construct(Mode $appMode, L10n $l10n, $argv = null)
|
||||||
{
|
{
|
||||||
parent::__construct($argv);
|
parent::__construct($argv);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
namespace Friendica\Console;
|
namespace Friendica\Console;
|
||||||
|
|
||||||
use Asika\SimpleConsole\CommandArgsException;
|
use Asika\SimpleConsole\CommandArgsException;
|
||||||
use Friendica\App;
|
use Friendica\App\Mode;
|
||||||
use Friendica\Core\Lock\Capability\ICanLock;
|
use Friendica\Core\Lock\Capability\ICanLock;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ class Lock extends \Asika\SimpleConsole\Console
|
||||||
protected $helpOptions = ['h', 'help', '?'];
|
protected $helpOptions = ['h', 'help', '?'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var App\Mode
|
* @var Mode
|
||||||
*/
|
*/
|
||||||
private $appMode;
|
private $appMode;
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ HELP;
|
||||||
return $help;
|
return $help;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(App\Mode $appMode, ICanLock $lock, array $argv = null)
|
public function __construct(Mode $appMode, ICanLock $lock, array $argv = null)
|
||||||
{
|
{
|
||||||
parent::__construct($argv);
|
parent::__construct($argv);
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ HELP;
|
||||||
$this->out('Options: ' . var_export($this->options, true));
|
$this->out('Options: ' . var_export($this->options, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->appMode->has(App\Mode::DBAVAILABLE)) {
|
if (!$this->appMode->has(Mode::DBAVAILABLE)) {
|
||||||
$this->out('Database isn\'t ready or populated yet, database cache won\'t be available');
|
$this->out('Database isn\'t ready or populated yet, database cache won\'t be available');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
namespace Friendica\Console;
|
namespace Friendica\Console;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Mode;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,7 +18,7 @@ class Maintenance extends \Asika\SimpleConsole\Console
|
||||||
protected $helpOptions = ['h', 'help', '?'];
|
protected $helpOptions = ['h', 'help', '?'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var App\Mode
|
* @var Mode
|
||||||
*/
|
*/
|
||||||
private $appMode;
|
private $appMode;
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +55,7 @@ HELP;
|
||||||
return $help;
|
return $help;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(App\Mode $appMode, IManageConfigValues $config, $argv = null)
|
public function __construct(Mode $appMode, IManageConfigValues $config, $argv = null)
|
||||||
{
|
{
|
||||||
parent::__construct($argv);
|
parent::__construct($argv);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
namespace Friendica\Console;
|
namespace Friendica\Console;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\AppHelper;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read a strings.php file and create messages.po in the same directory
|
* Read a strings.php file and create messages.po in the same directory
|
||||||
|
@ -20,14 +21,14 @@ class PhpToPo extends \Asika\SimpleConsole\Console
|
||||||
private $normBaseMsgIds = [];
|
private $normBaseMsgIds = [];
|
||||||
const NORM_REGEXP = "|[\\\]|";
|
const NORM_REGEXP = "|[\\\]|";
|
||||||
|
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
private $app;
|
private $appHelper;
|
||||||
|
|
||||||
public function __construct(App $app, array $argv = null)
|
public function __construct(AppHelper $appHelper, array $argv = null)
|
||||||
{
|
{
|
||||||
parent::__construct($argv);
|
parent::__construct($argv);
|
||||||
|
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getHelp()
|
protected function getHelp()
|
||||||
|
@ -66,7 +67,8 @@ HELP;
|
||||||
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments');
|
||||||
}
|
}
|
||||||
|
|
||||||
$a = $this->app;
|
$a = new stdClass();
|
||||||
|
$a->strings = [];
|
||||||
|
|
||||||
$phpfile = realpath($this->getArgument(0));
|
$phpfile = realpath($this->getArgument(0));
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,11 @@
|
||||||
|
|
||||||
namespace Friendica\Console;
|
namespace Friendica\Console;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Mode;
|
||||||
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
|
use Friendica\Core\KeyValueStorage\Capability\IManageKeyValuePairs;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Update;
|
use Friendica\Core\Update;
|
||||||
|
use Friendica\DI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs database post updates
|
* Performs database post updates
|
||||||
|
@ -20,7 +21,7 @@ class PostUpdate extends \Asika\SimpleConsole\Console
|
||||||
protected $helpOptions = ['h', 'help', '?'];
|
protected $helpOptions = ['h', 'help', '?'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var App\Mode
|
* @var Mode
|
||||||
*/
|
*/
|
||||||
private $appMode;
|
private $appMode;
|
||||||
/**
|
/**
|
||||||
|
@ -31,6 +32,10 @@ class PostUpdate extends \Asika\SimpleConsole\Console
|
||||||
* @var L10n
|
* @var L10n
|
||||||
*/
|
*/
|
||||||
private $l10n;
|
private $l10n;
|
||||||
|
/**
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
private $basePath;
|
||||||
|
|
||||||
protected function getHelp()
|
protected function getHelp()
|
||||||
{
|
{
|
||||||
|
@ -46,19 +51,18 @@ HELP;
|
||||||
return $help;
|
return $help;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(App\Mode $appMode, IManageKeyValuePairs $keyValue, L10n $l10n, array $argv = null)
|
public function __construct(Mode $appMode, IManageKeyValuePairs $keyValue, L10n $l10n, array $argv = null)
|
||||||
{
|
{
|
||||||
parent::__construct($argv);
|
parent::__construct($argv);
|
||||||
|
|
||||||
$this->appMode = $appMode;
|
$this->appMode = $appMode;
|
||||||
$this->keyValue = $keyValue;
|
$this->keyValue = $keyValue;
|
||||||
$this->l10n = $l10n;
|
$this->l10n = $l10n;
|
||||||
|
$this->basePath = DI::appHelper()->getBasePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function doExecute(): int
|
protected function doExecute(): int
|
||||||
{
|
{
|
||||||
$a = \Friendica\DI::app();
|
|
||||||
|
|
||||||
if ($this->getOption($this->helpOptions)) {
|
if ($this->getOption($this->helpOptions)) {
|
||||||
$this->out($this->getHelp());
|
$this->out($this->getHelp());
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -79,7 +83,7 @@ HELP;
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $this->l10n->t('Check for pending update actions.') . "\n";
|
echo $this->l10n->t('Check for pending update actions.') . "\n";
|
||||||
Update::run($a->getBasePath(), true, false, true, false);
|
Update::run($this->basePath, true, false, true, false);
|
||||||
echo $this->l10n->t('Done.') . "\n";
|
echo $this->l10n->t('Done.') . "\n";
|
||||||
|
|
||||||
echo $this->l10n->t('Execute pending post updates.') . "\n";
|
echo $this->l10n->t('Execute pending post updates.') . "\n";
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
namespace Friendica\Console;
|
namespace Friendica\Console;
|
||||||
|
|
||||||
use Console_Table;
|
use Console_Table;
|
||||||
use Friendica\App;
|
use Friendica\App\Mode;
|
||||||
use Friendica\Content\Pager;
|
use Friendica\Content\Pager;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
|
||||||
|
@ -26,7 +26,7 @@ class User extends \Asika\SimpleConsole\Console
|
||||||
protected $helpOptions = ['h', 'help', '?'];
|
protected $helpOptions = ['h', 'help', '?'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var App\Mode
|
* @var Mode
|
||||||
*/
|
*/
|
||||||
private $appMode;
|
private $appMode;
|
||||||
/**
|
/**
|
||||||
|
@ -74,7 +74,7 @@ HELP;
|
||||||
return $help;
|
return $help;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct(App\Mode $appMode, L10n $l10n, IManagePersonalConfigValues $pConfig, array $argv = null)
|
public function __construct(Mode $appMode, L10n $l10n, IManagePersonalConfigValues $pConfig, array $argv = null)
|
||||||
{
|
{
|
||||||
parent::__construct($argv);
|
parent::__construct($argv);
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,11 @@
|
||||||
|
|
||||||
namespace Friendica\Content;
|
namespace Friendica\Content;
|
||||||
|
|
||||||
use Friendica\App;
|
|
||||||
use Friendica\App\Arguments;
|
use Friendica\App\Arguments;
|
||||||
use Friendica\App\BaseURL;
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Mode;
|
||||||
|
use Friendica\App\Page;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core\ACL;
|
use Friendica\Core\ACL;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
|
@ -32,8 +34,7 @@ use Friendica\Network\HTTPException\InternalServerErrorException;
|
||||||
use Friendica\Object\Post as PostObject;
|
use Friendica\Object\Post as PostObject;
|
||||||
use Friendica\Object\Thread;
|
use Friendica\Object\Thread;
|
||||||
use Friendica\Protocol\Activity;
|
use Friendica\Protocol\Activity;
|
||||||
use Friendica\User\Settings\Entity\UserGServer;
|
use Friendica\User\Settings\Repository\UserGServer;
|
||||||
use Friendica\User\Settings\Repository;
|
|
||||||
use Friendica\Util\Crypto;
|
use Friendica\Util\Crypto;
|
||||||
use Friendica\Util\DateTimeFormat;
|
use Friendica\Util\DateTimeFormat;
|
||||||
use Friendica\Util\Profiler;
|
use Friendica\Util\Profiler;
|
||||||
|
@ -64,7 +65,7 @@ class Conversation
|
||||||
private $logger;
|
private $logger;
|
||||||
/** @var Item */
|
/** @var Item */
|
||||||
private $item;
|
private $item;
|
||||||
/** @var App\Arguments */
|
/** @var Arguments */
|
||||||
private $args;
|
private $args;
|
||||||
/** @var IManagePersonalConfigValues */
|
/** @var IManagePersonalConfigValues */
|
||||||
private $pConfig;
|
private $pConfig;
|
||||||
|
@ -72,18 +73,18 @@ class Conversation
|
||||||
private $baseURL;
|
private $baseURL;
|
||||||
/** @var IManageConfigValues */
|
/** @var IManageConfigValues */
|
||||||
private $config;
|
private $config;
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
private $app;
|
private $appHelper;
|
||||||
/** @var App\Page */
|
/** @var Page */
|
||||||
private $page;
|
private $page;
|
||||||
/** @var App\Mode */
|
/** @var Mode */
|
||||||
private $mode;
|
private $mode;
|
||||||
/** @var IHandleUserSessions */
|
/** @var IHandleUserSessions */
|
||||||
private $session;
|
private $session;
|
||||||
/** @var Repository\UserGServer */
|
/** @var UserGServer */
|
||||||
private $userGServer;
|
private $userGServer;
|
||||||
|
|
||||||
public function __construct(Repository\UserGServer $userGServer, LoggerInterface $logger, Profiler $profiler, Activity $activity, L10n $l10n, Item $item, Arguments $args, BaseURL $baseURL, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, App\Page $page, App\Mode $mode, App $app, IHandleUserSessions $session)
|
public function __construct(UserGServer $userGServer, LoggerInterface $logger, Profiler $profiler, Activity $activity, L10n $l10n, Item $item, Arguments $args, BaseURL $baseURL, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, Page $page, Mode $mode, AppHelper $appHelper, IHandleUserSessions $session)
|
||||||
{
|
{
|
||||||
$this->activity = $activity;
|
$this->activity = $activity;
|
||||||
$this->item = $item;
|
$this->item = $item;
|
||||||
|
@ -96,7 +97,7 @@ class Conversation
|
||||||
$this->args = $args;
|
$this->args = $args;
|
||||||
$this->pConfig = $pConfig;
|
$this->pConfig = $pConfig;
|
||||||
$this->page = $page;
|
$this->page = $page;
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
$this->userGServer = $userGServer;
|
$this->userGServer = $userGServer;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
namespace Friendica\Content;
|
namespace Friendica\Content;
|
||||||
|
|
||||||
use Friendica\App;
|
|
||||||
use Friendica\App\BaseURL;
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Content\Text\BBCode\Video;
|
use Friendica\Content\Text\BBCode\Video;
|
||||||
use Friendica\Content\Text\HTML;
|
use Friendica\Content\Text\HTML;
|
||||||
|
@ -66,10 +66,10 @@ class Item
|
||||||
private $baseURL;
|
private $baseURL;
|
||||||
/** @var Emailer */
|
/** @var Emailer */
|
||||||
private $emailer;
|
private $emailer;
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
private $app;
|
private $appHelper;
|
||||||
|
|
||||||
public function __construct(Profiler $profiler, Activity $activity, L10n $l10n, IHandleUserSessions $userSession, Video $bbCodeVideo, ACLFormatter $aclFormatter, IManagePersonalConfigValues $pConfig, BaseURL $baseURL, Emailer $emailer, App $app)
|
public function __construct(Profiler $profiler, Activity $activity, L10n $l10n, IHandleUserSessions $userSession, Video $bbCodeVideo, ACLFormatter $aclFormatter, IManagePersonalConfigValues $pConfig, BaseURL $baseURL, Emailer $emailer, AppHelper $appHelper)
|
||||||
{
|
{
|
||||||
$this->profiler = $profiler;
|
$this->profiler = $profiler;
|
||||||
$this->activity = $activity;
|
$this->activity = $activity;
|
||||||
|
@ -80,7 +80,7 @@ class Item
|
||||||
$this->baseURL = $baseURL;
|
$this->baseURL = $baseURL;
|
||||||
$this->pConfig = $pConfig;
|
$this->pConfig = $pConfig;
|
||||||
$this->emailer = $emailer;
|
$this->emailer = $emailer;
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -48,11 +48,11 @@ class OEmbed
|
||||||
{
|
{
|
||||||
$embedurl = trim($embedurl, '\'"');
|
$embedurl = trim($embedurl, '\'"');
|
||||||
|
|
||||||
$a = DI::app();
|
$appHelper = DI::appHelper();
|
||||||
|
|
||||||
$cache_key = 'oembed:' . $a->getThemeInfoValue('videowidth') . ':' . $embedurl;
|
$cache_key = 'oembed:' . $appHelper->getThemeInfoValue('videowidth') . ':' . $embedurl;
|
||||||
|
|
||||||
$condition = ['url' => Strings::normaliseLink($embedurl), 'maxwidth' => $a->getThemeInfoValue('videowidth')];
|
$condition = ['url' => Strings::normaliseLink($embedurl), 'maxwidth' => $appHelper->getThemeInfoValue('videowidth')];
|
||||||
$oembed_record = DBA::selectFirst('oembed', ['content'], $condition);
|
$oembed_record = DBA::selectFirst('oembed', ['content'], $condition);
|
||||||
if (DBA::isResult($oembed_record)) {
|
if (DBA::isResult($oembed_record)) {
|
||||||
$json_string = $oembed_record['content'];
|
$json_string = $oembed_record['content'];
|
||||||
|
@ -88,7 +88,7 @@ class OEmbed
|
||||||
// but their OEmbed endpoint is only accessible by HTTPS ¯\_(ツ)_/¯
|
// but their OEmbed endpoint is only accessible by HTTPS ¯\_(ツ)_/¯
|
||||||
$href = str_replace(['http://www.youtube.com/', 'http://player.vimeo.com/'],
|
$href = str_replace(['http://www.youtube.com/', 'http://player.vimeo.com/'],
|
||||||
['https://www.youtube.com/', 'https://player.vimeo.com/'], $href);
|
['https://www.youtube.com/', 'https://player.vimeo.com/'], $href);
|
||||||
$result = DI::httpClient()->get($href . '&maxwidth=' . $a->getThemeInfoValue('videowidth'), HttpClientAccept::DEFAULT, [HttpClientOptions::REQUEST => HttpClientRequest::SITEINFO]);
|
$result = DI::httpClient()->get($href . '&maxwidth=' . $appHelper->getThemeInfoValue('videowidth'), HttpClientAccept::DEFAULT, [HttpClientOptions::REQUEST => HttpClientRequest::SITEINFO]);
|
||||||
if ($result->isSuccess()) {
|
if ($result->isSuccess()) {
|
||||||
$json_string = $result->getBodyString();
|
$json_string = $result->getBodyString();
|
||||||
break;
|
break;
|
||||||
|
@ -109,7 +109,7 @@ class OEmbed
|
||||||
if (!empty($oembed->type) && $oembed->type != 'error') {
|
if (!empty($oembed->type) && $oembed->type != 'error') {
|
||||||
DBA::insert('oembed', [
|
DBA::insert('oembed', [
|
||||||
'url' => Strings::normaliseLink($embedurl),
|
'url' => Strings::normaliseLink($embedurl),
|
||||||
'maxwidth' => $a->getThemeInfoValue('videowidth'),
|
'maxwidth' => $appHelper->getThemeInfoValue('videowidth'),
|
||||||
'content' => $json_string,
|
'content' => $json_string,
|
||||||
'created' => DateTimeFormat::utcNow()
|
'created' => DateTimeFormat::utcNow()
|
||||||
], Database::INSERT_UPDATE);
|
], Database::INSERT_UPDATE);
|
||||||
|
|
|
@ -1926,19 +1926,20 @@ class BBCode
|
||||||
|
|
||||||
private static function convertVideoPlatformsToHtml(string $text, bool $try_oembed): string
|
private static function convertVideoPlatformsToHtml(string $text, bool $try_oembed): string
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$appHelper = DI::appHelper();
|
||||||
|
|
||||||
$text = self::normalizeVideoLinks($text);
|
$text = self::normalizeVideoLinks($text);
|
||||||
|
|
||||||
// Youtube extensions
|
// Youtube extensions
|
||||||
if ($try_oembed && OEmbed::isAllowedURL('https://www.youtube.com/embed/')) {
|
if ($try_oembed && OEmbed::isAllowedURL('https://www.youtube.com/embed/')) {
|
||||||
$text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '<iframe width="' . $a->getThemeInfoValue('videowidth') . '" height="' . $a->getThemeInfoValue('videoheight') . '" src="https://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $text);
|
$text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '<iframe width="' . $appHelper->getThemeInfoValue('videowidth') . '" height="' . $appHelper->getThemeInfoValue('videoheight') . '" src="https://www.youtube.com/embed/$1" frameborder="0" ></iframe>', $text);
|
||||||
} else {
|
} else {
|
||||||
$text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '[url]https://www.youtube.com/watch?v=$1[/url]', $text);
|
$text = preg_replace("/\[youtube\]([A-Za-z0-9\-_=]+)(.*?)\[\/youtube\]/ism", '[url]https://www.youtube.com/watch?v=$1[/url]', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Vimeo extensions
|
// Vimeo extensions
|
||||||
if ($try_oembed && OEmbed::isAllowedURL('https://player.vimeo.com/video')) {
|
if ($try_oembed && OEmbed::isAllowedURL('https://player.vimeo.com/video')) {
|
||||||
$text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '<iframe width="' . $a->getThemeInfoValue('videowidth') . '" height="' . $a->getThemeInfoValue('videoheight') . '" src="https://player.vimeo.com/video/$1" frameborder="0" ></iframe>', $text);
|
$text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '<iframe width="' . $appHelper->getThemeInfoValue('videowidth') . '" height="' . $appHelper->getThemeInfoValue('videoheight') . '" src="https://player.vimeo.com/video/$1" frameborder="0" ></iframe>', $text);
|
||||||
} else {
|
} else {
|
||||||
$text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '[url]https://vimeo.com/$1[/url]', $text);
|
$text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", '[url]https://vimeo.com/$1[/url]', $text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
namespace Friendica\Core;
|
namespace Friendica\Core;
|
||||||
|
|
||||||
use Friendica\App;
|
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Util\Strings;
|
use Friendica\Util\Strings;
|
||||||
|
@ -81,7 +80,7 @@ class Hook
|
||||||
*/
|
*/
|
||||||
public static function register(string $hook, string $file, string $function, int $priority = 0)
|
public static function register(string $hook, string $file, string $function, int $priority = 0)
|
||||||
{
|
{
|
||||||
$file = str_replace(DI::app()->getBasePath() . DIRECTORY_SEPARATOR, '', $file);
|
$file = str_replace(DI::appHelper()->getBasePath() . DIRECTORY_SEPARATOR, '', $file);
|
||||||
|
|
||||||
$condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
|
$condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
|
||||||
if (DBA::exists('hook', $condition)) {
|
if (DBA::exists('hook', $condition)) {
|
||||||
|
@ -102,7 +101,7 @@ class Hook
|
||||||
*/
|
*/
|
||||||
public static function unregister(string $hook, string $file, string $function): bool
|
public static function unregister(string $hook, string $file, string $function): bool
|
||||||
{
|
{
|
||||||
$relative_file = str_replace(DI::app()->getBasePath() . DIRECTORY_SEPARATOR, '', $file);
|
$relative_file = str_replace(DI::appHelper()->getBasePath() . DIRECTORY_SEPARATOR, '', $file);
|
||||||
|
|
||||||
// This here is only needed for fixing a problem that existed on the develop branch
|
// This here is only needed for fixing a problem that existed on the develop branch
|
||||||
$condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
|
$condition = ['hook' => $hook, 'file' => $file, 'function' => $function];
|
||||||
|
@ -198,7 +197,7 @@ class Hook
|
||||||
public static function callSingle(string $name, array $hook, &$data = null)
|
public static function callSingle(string $name, array $hook, &$data = null)
|
||||||
{
|
{
|
||||||
// Don't run a theme's hook if the user isn't using the theme
|
// Don't run a theme's hook if the user isn't using the theme
|
||||||
if (strpos($hook[0], 'view/theme/') !== false && strpos($hook[0], 'view/theme/' . DI::app()->getCurrentTheme()) === false) {
|
if (strpos($hook[0], 'view/theme/') !== false && strpos($hook[0], 'view/theme/' . DI::appHelper()->getCurrentTheme()) === false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,9 +155,9 @@ class Renderer
|
||||||
if (isset(self::$template_engine_instance[$template_engine])) {
|
if (isset(self::$template_engine_instance[$template_engine])) {
|
||||||
return self::$template_engine_instance[$template_engine];
|
return self::$template_engine_instance[$template_engine];
|
||||||
} else {
|
} else {
|
||||||
$a = DI::app();
|
$appHelper = DI::appHelper();
|
||||||
$class = self::$template_engines[$template_engine];
|
$class = self::$template_engines[$template_engine];
|
||||||
$obj = new $class($a->getCurrentTheme(), $a->getThemeInfo());
|
$obj = new $class($appHelper->getCurrentTheme(), $appHelper->getThemeInfo());
|
||||||
self::$template_engine_instance[$template_engine] = $obj;
|
self::$template_engine_instance[$template_engine] = $obj;
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
namespace Friendica\Core\Session\Factory;
|
namespace Friendica\Core\Session\Factory;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Mode;
|
||||||
use Friendica\Core\Cache\Factory\Cache;
|
use Friendica\Core\Cache\Factory\Cache;
|
||||||
use Friendica\Core\Cache\Type\DatabaseCache;
|
use Friendica\Core\Cache\Type\DatabaseCache;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
|
@ -33,8 +34,8 @@ class Session
|
||||||
const HANDLER_DEFAULT = self::HANDLER_DATABASE;
|
const HANDLER_DEFAULT = self::HANDLER_DATABASE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param App\Mode $mode
|
* @param Mode $mode
|
||||||
* @param App\BaseURL $baseURL
|
* @param BaseURL $baseURL
|
||||||
* @param IManageConfigValues $config
|
* @param IManageConfigValues $config
|
||||||
* @param Database $dba
|
* @param Database $dba
|
||||||
* @param Cache $cacheFactory
|
* @param Cache $cacheFactory
|
||||||
|
@ -43,7 +44,7 @@ class Session
|
||||||
* @param array $server
|
* @param array $server
|
||||||
* @return IHandleSessions
|
* @return IHandleSessions
|
||||||
*/
|
*/
|
||||||
public function create(App\Mode $mode, App\BaseURL $baseURL, IManageConfigValues $config, Database $dba, Cache $cacheFactory, LoggerInterface $logger, Profiler $profiler, array $server = []): IHandleSessions
|
public function create(Mode $mode, BaseURL $baseURL, IManageConfigValues $config, Database $dba, Cache $cacheFactory, LoggerInterface $logger, Profiler $profiler, array $server = []): IHandleSessions
|
||||||
{
|
{
|
||||||
$profiler->startRecording('session');
|
$profiler->startRecording('session');
|
||||||
$session_handler = $config->get('system', 'session_handler', self::HANDLER_DEFAULT);
|
$session_handler = $config->get('system', 'session_handler', self::HANDLER_DEFAULT);
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
namespace Friendica\Core\Session\Type;
|
namespace Friendica\Core\Session\Type;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\BaseURL;
|
||||||
use Friendica\Core\Session\Capability\IHandleSessions;
|
use Friendica\Core\Session\Capability\IHandleSessions;
|
||||||
use Friendica\Model\User\Cookie;
|
use Friendica\Model\User\Cookie;
|
||||||
use SessionHandlerInterface;
|
use SessionHandlerInterface;
|
||||||
|
@ -17,7 +17,7 @@ use SessionHandlerInterface;
|
||||||
*/
|
*/
|
||||||
class Native extends AbstractSession implements IHandleSessions
|
class Native extends AbstractSession implements IHandleSessions
|
||||||
{
|
{
|
||||||
public function __construct(App\BaseURL $baseURL, SessionHandlerInterface $handler = null)
|
public function __construct(BaseURL $baseURL, SessionHandlerInterface $handler = null)
|
||||||
{
|
{
|
||||||
ini_set('session.gc_probability', 50);
|
ini_set('session.gc_probability', 50);
|
||||||
ini_set('session.use_only_cookies', 1);
|
ini_set('session.use_only_cookies', 1);
|
||||||
|
|
|
@ -208,11 +208,11 @@ class Theme
|
||||||
*/
|
*/
|
||||||
public static function getPathForFile(string $file): string
|
public static function getPathForFile(string $file): string
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$appHelper = DI::appHelper();
|
||||||
|
|
||||||
$theme = $a->getCurrentTheme();
|
$theme = $appHelper->getCurrentTheme();
|
||||||
|
|
||||||
$parent = Strings::sanitizeFilePathItem($a->getThemeInfoValue('extends', $theme));
|
$parent = Strings::sanitizeFilePathItem($appHelper->getThemeInfoValue('extends', $theme));
|
||||||
|
|
||||||
$paths = [
|
$paths = [
|
||||||
"view/theme/$theme/$file",
|
"view/theme/$theme/$file",
|
||||||
|
@ -245,11 +245,11 @@ class Theme
|
||||||
return 'view/theme/' . $theme . '/style.css';
|
return 'view/theme/' . $theme . '/style.css';
|
||||||
}
|
}
|
||||||
|
|
||||||
$a = DI::app();
|
$appHelper = DI::appHelper();
|
||||||
|
|
||||||
$query_params = [];
|
$query_params = [];
|
||||||
|
|
||||||
$puid = Profile::getThemeUid($a);
|
$puid = Profile::getThemeUid($appHelper);
|
||||||
if ($puid) {
|
if ($puid) {
|
||||||
$query_params['puid'] = $puid;
|
$query_params['puid'] = $puid;
|
||||||
}
|
}
|
||||||
|
@ -267,8 +267,8 @@ class Theme
|
||||||
{
|
{
|
||||||
$theme = Strings::sanitizeFilePathItem($theme);
|
$theme = Strings::sanitizeFilePathItem($theme);
|
||||||
|
|
||||||
$a = DI::app();
|
$appHelper = DI::appHelper();
|
||||||
$base_theme = $a->getThemeInfoValue('extends') ?? '';
|
$base_theme = $appHelper->getThemeInfoValue('extends') ?? '';
|
||||||
|
|
||||||
if (file_exists("view/theme/$theme/config.php")) {
|
if (file_exists("view/theme/$theme/config.php")) {
|
||||||
return "view/theme/$theme/config.php";
|
return "view/theme/$theme/config.php";
|
||||||
|
|
|
@ -67,7 +67,6 @@ class Update
|
||||||
*
|
*
|
||||||
* @param string $basePath The base path of this application
|
* @param string $basePath The base path of this application
|
||||||
* @param boolean $via_worker Is the check run via the worker?
|
* @param boolean $via_worker Is the check run via the worker?
|
||||||
* @param App\Mode $mode The current app mode
|
|
||||||
* @return void
|
* @return void
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -533,7 +533,7 @@ class Worker
|
||||||
*/
|
*/
|
||||||
private static function execFunction(array $queue, string $funcname, array $argv, bool $method_call)
|
private static function execFunction(array $queue, string $funcname, array $argv, bool $method_call)
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$appHelper = DI::appHelper();
|
||||||
|
|
||||||
self::coolDown();
|
self::coolDown();
|
||||||
|
|
||||||
|
@ -547,7 +547,7 @@ class Worker
|
||||||
// For this reason the variables have to be initialized.
|
// For this reason the variables have to be initialized.
|
||||||
DI::profiler()->reset();
|
DI::profiler()->reset();
|
||||||
|
|
||||||
$a->setQueue($queue);
|
$appHelper->setQueue($queue);
|
||||||
|
|
||||||
$up_duration = microtime(true) - self::$up_start;
|
$up_duration = microtime(true) - self::$up_start;
|
||||||
|
|
||||||
|
@ -571,7 +571,7 @@ class Worker
|
||||||
|
|
||||||
Logger::disableWorker();
|
Logger::disableWorker();
|
||||||
|
|
||||||
$a->setQueue([]);
|
$appHelper->setQueue([]);
|
||||||
|
|
||||||
$duration = (microtime(true) - $stamp);
|
$duration = (microtime(true) - $stamp);
|
||||||
|
|
||||||
|
@ -1371,7 +1371,7 @@ class Worker
|
||||||
*/
|
*/
|
||||||
public static function getRetrial(): int
|
public static function getRetrial(): int
|
||||||
{
|
{
|
||||||
$queue = DI::app()->getQueue();
|
$queue = DI::appHelper()->getQueue();
|
||||||
return $queue['retrial'] ?? 0;
|
return $queue['retrial'] ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1384,7 +1384,7 @@ class Worker
|
||||||
*/
|
*/
|
||||||
public static function defer(int $worker_defer_limit = 0): bool
|
public static function defer(int $worker_defer_limit = 0): bool
|
||||||
{
|
{
|
||||||
$queue = DI::app()->getQueue();
|
$queue = DI::appHelper()->getQueue();
|
||||||
|
|
||||||
if (empty($queue)) {
|
if (empty($queue)) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -71,6 +71,8 @@ abstract class DI
|
||||||
//
|
//
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @deprecated 2024.12 use DI::appHelper() instead
|
||||||
|
*
|
||||||
* @return App
|
* @return App
|
||||||
*/
|
*/
|
||||||
public static function app()
|
public static function app()
|
||||||
|
@ -78,6 +80,11 @@ abstract class DI
|
||||||
return self::$dice->create(App::class);
|
return self::$dice->create(App::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function appHelper(): AppHelper
|
||||||
|
{
|
||||||
|
return self::$dice->create(AppHelper::class);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Database\Database
|
* @return Database\Database
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3348,7 +3348,7 @@ class Item
|
||||||
*/
|
*/
|
||||||
public static function prepareBody(array &$item, bool $attach = false, bool $is_preview = false, bool $only_cache = false): string
|
public static function prepareBody(array &$item, bool $attach = false, bool $is_preview = false, bool $only_cache = false): string
|
||||||
{
|
{
|
||||||
$a = DI::app();
|
$appHelper = DI::appHelper();
|
||||||
$uid = DI::userSession()->getLocalUserId();
|
$uid = DI::userSession()->getLocalUserId();
|
||||||
Hook::callAll('prepare_body_init', $item);
|
Hook::callAll('prepare_body_init', $item);
|
||||||
|
|
||||||
|
@ -3522,8 +3522,8 @@ class Item
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace friendica image url size with theme preference.
|
// Replace friendica image url size with theme preference.
|
||||||
if (!empty($a->getThemeInfoValue('item_image_size'))) {
|
if (!empty($appHelper->getThemeInfoValue('item_image_size'))) {
|
||||||
$ps = $a->getThemeInfoValue('item_image_size');
|
$ps = $appHelper->getThemeInfoValue('item_image_size');
|
||||||
$s = preg_replace('|(<img[^>]+src="[^"]+/photo/[0-9a-f]+)-[0-9]|', "$1-" . $ps, $s);
|
$s = preg_replace('|(<img[^>]+src="[^"]+/photo/[0-9a-f]+)-[0-9]|', "$1-" . $ps, $s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
namespace Friendica\Model;
|
namespace Friendica\Model;
|
||||||
|
|
||||||
use Friendica\App;
|
|
||||||
use Friendica\App\Mode;
|
use Friendica\App\Mode;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Content\Widget\ContactBlock;
|
use Friendica\Content\Widget\ContactBlock;
|
||||||
use Friendica\Core\Cache\Enum\Duration;
|
use Friendica\Core\Cache\Enum\Duration;
|
||||||
|
@ -190,7 +190,6 @@ class Profile
|
||||||
* the theme is chosen before the _init() function of a theme is run, which will usually
|
* the theme is chosen before the _init() function of a theme is run, which will usually
|
||||||
* load a lot of theme-specific content
|
* load a lot of theme-specific content
|
||||||
*
|
*
|
||||||
* @param App $a
|
|
||||||
* @param string $nickname string
|
* @param string $nickname string
|
||||||
* @param bool $show_contacts
|
* @param bool $show_contacts
|
||||||
*
|
*
|
||||||
|
@ -199,7 +198,7 @@ class Profile
|
||||||
* @throws HTTPException\InternalServerErrorException
|
* @throws HTTPException\InternalServerErrorException
|
||||||
* @throws \ImagickException
|
* @throws \ImagickException
|
||||||
*/
|
*/
|
||||||
public static function load(App $a, string $nickname, bool $show_contacts = true): array
|
public static function load(AppHelper $appHelper, string $nickname, bool $show_contacts = true): array
|
||||||
{
|
{
|
||||||
$profile = User::getOwnerDataByNick($nickname);
|
$profile = User::getOwnerDataByNick($nickname);
|
||||||
if (!isset($profile['account_removed']) || $profile['account_removed']) {
|
if (!isset($profile['account_removed']) || $profile['account_removed']) {
|
||||||
|
@ -213,13 +212,13 @@ class Profile
|
||||||
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
|
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$a->setProfileOwner($profile['uid']);
|
$appHelper->setProfileOwner($profile['uid']);
|
||||||
|
|
||||||
DI::page()['title'] = $profile['name'] . ' @ ' . DI::config()->get('config', 'sitename');
|
DI::page()['title'] = $profile['name'] . ' @ ' . DI::config()->get('config', 'sitename');
|
||||||
|
|
||||||
if (!DI::userSession()->getLocalUserId()) {
|
if (!DI::userSession()->getLocalUserId()) {
|
||||||
$a->setCurrentTheme($profile['theme']);
|
$appHelper->setCurrentTheme($profile['theme']);
|
||||||
$a->setCurrentMobileTheme(DI::pConfig()->get($a->getProfileOwner(), 'system', 'mobile_theme') ?? '');
|
$appHelper->setCurrentMobileTheme(DI::pConfig()->get($appHelper->getProfileOwner(), 'system', 'mobile_theme') ?? '');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -228,7 +227,7 @@ class Profile
|
||||||
|
|
||||||
Renderer::setActiveTemplateEngine(); // reset the template engine to the default in case the user's theme doesn't specify one
|
Renderer::setActiveTemplateEngine(); // reset the template engine to the default in case the user's theme doesn't specify one
|
||||||
|
|
||||||
$theme_info_file = 'view/theme/' . $a->getCurrentTheme() . '/theme.php';
|
$theme_info_file = 'view/theme/' . $appHelper->getCurrentTheme() . '/theme.php';
|
||||||
if (file_exists($theme_info_file)) {
|
if (file_exists($theme_info_file)) {
|
||||||
require_once $theme_info_file;
|
require_once $theme_info_file;
|
||||||
}
|
}
|
||||||
|
@ -687,15 +686,13 @@ class Profile
|
||||||
* settings take precedence; unless a local user is logged in which means they don't
|
* settings take precedence; unless a local user is logged in which means they don't
|
||||||
* want to see anybody else's theme settings except their own while on this site.
|
* want to see anybody else's theme settings except their own while on this site.
|
||||||
*
|
*
|
||||||
* @param App $a
|
|
||||||
*
|
|
||||||
* @return int user ID
|
* @return int user ID
|
||||||
*
|
*
|
||||||
* @note Returns local_user instead of user ID if "always_my_theme" is set to true
|
* @note Returns local_user instead of user ID if "always_my_theme" is set to true
|
||||||
*/
|
*/
|
||||||
public static function getThemeUid(App $a): int
|
public static function getThemeUid(AppHelper $appHelper): int
|
||||||
{
|
{
|
||||||
return DI::userSession()->getLocalUserId() ?: $a->getProfileOwner();
|
return DI::userSession()->getLocalUserId() ?: $appHelper->getProfileOwner();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
namespace Friendica\Model\User;
|
namespace Friendica\Model\User;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Request;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,12 +39,12 @@ class Cookie
|
||||||
private $data;
|
private $data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param App\Request $request The current http request
|
* @param Request $request The current http request
|
||||||
* @param IManageConfigValues $config
|
* @param IManageConfigValues $config
|
||||||
* @param App\BaseURL $baseURL
|
* @param BaseURL $baseURL
|
||||||
* @param array $COOKIE The $_COOKIE array
|
* @param array $COOKIE The $_COOKIE array
|
||||||
*/
|
*/
|
||||||
public function __construct(App\Request $request, IManageConfigValues $config, App\BaseURL $baseURL, array $COOKIE = [])
|
public function __construct(Request $request, IManageConfigValues $config, BaseURL $baseURL, array $COOKIE = [])
|
||||||
{
|
{
|
||||||
$this->sslEnabled = $baseURL->getScheme() === 'https';
|
$this->sslEnabled = $baseURL->getScheme() === 'https';
|
||||||
$this->sitePrivateKey = $config->get('system', 'site_prvkey');
|
$this->sitePrivateKey = $config->get('system', 'site_prvkey');
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Summary extends BaseAdmin
|
||||||
{
|
{
|
||||||
parent::content();
|
parent::content();
|
||||||
|
|
||||||
$a = DI::app();
|
$basePath = DI::appHelper()->getBasePath();
|
||||||
|
|
||||||
// are there MyISAM tables in the DB? If so, trigger a warning message
|
// are there MyISAM tables in the DB? If so, trigger a warning message
|
||||||
$warningtext = [];
|
$warningtext = [];
|
||||||
|
@ -116,7 +116,7 @@ class Summary extends BaseAdmin
|
||||||
}
|
}
|
||||||
|
|
||||||
// check legacy basepath settings
|
// check legacy basepath settings
|
||||||
$configLoader = (new Config())->createConfigFileManager($a->getBasePath(), $_SERVER);
|
$configLoader = (new Config())->createConfigFileManager($basePath, $_SERVER);
|
||||||
$configCache = new Cache();
|
$configCache = new Cache();
|
||||||
$configLoader->setupCache($configCache);
|
$configLoader->setupCache($configCache);
|
||||||
$confBasepath = $configCache->get('system', 'basepath');
|
$confBasepath = $configCache->get('system', 'basepath');
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Admin\Themes;
|
namespace Friendica\Module\Admin\Themes;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Mode;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
|
@ -19,21 +22,21 @@ use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class Embed extends BaseAdmin
|
class Embed extends BaseAdmin
|
||||||
{
|
{
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
protected $app;
|
protected $appHelper;
|
||||||
/** @var App\Mode */
|
/** @var Mode */
|
||||||
protected $mode;
|
protected $mode;
|
||||||
|
|
||||||
public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, App\Mode $mode, array $server, array $parameters = [])
|
public function __construct(AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Mode $mode, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
$this->mode = $mode;
|
$this->mode = $mode;
|
||||||
|
|
||||||
$theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
|
$theme = Strings::sanitizeFilePathItem($this->parameters['theme']);
|
||||||
if (is_file("view/theme/$theme/config.php")) {
|
if (is_file("view/theme/$theme/config.php")) {
|
||||||
$this->app->setCurrentTheme($theme);
|
$this->appHelper->setCurrentTheme($theme);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +49,7 @@ class Embed extends BaseAdmin
|
||||||
require_once "view/theme/$theme/config.php";
|
require_once "view/theme/$theme/config.php";
|
||||||
if (function_exists('theme_admin_post')) {
|
if (function_exists('theme_admin_post')) {
|
||||||
self::checkFormSecurityTokenRedirectOnError('/admin/themes/' . $theme . '/embed?mode=minimal', 'admin_theme_settings');
|
self::checkFormSecurityTokenRedirectOnError('/admin/themes/' . $theme . '/embed?mode=minimal', 'admin_theme_settings');
|
||||||
theme_admin_post($this->app);
|
theme_admin_post($this->appHelper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,7 +75,7 @@ class Embed extends BaseAdmin
|
||||||
require_once "view/theme/$theme/config.php";
|
require_once "view/theme/$theme/config.php";
|
||||||
|
|
||||||
if (function_exists('theme_admin')) {
|
if (function_exists('theme_admin')) {
|
||||||
$admin_form = theme_admin($this->app);
|
$admin_form = theme_admin($this->appHelper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Friendica\DirectMessages;
|
namespace Friendica\Module\Api\Friendica\DirectMessages;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
@ -30,9 +32,9 @@ class Search extends BaseApi
|
||||||
/** @var DirectMessage */
|
/** @var DirectMessage */
|
||||||
private $directMessage;
|
private $directMessage;
|
||||||
|
|
||||||
public function __construct(DirectMessage $directMessage, Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(DirectMessage $directMessage, Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->dba = $dba;
|
$this->dba = $dba;
|
||||||
$this->directMessage = $directMessage;
|
$this->directMessage = $directMessage;
|
||||||
|
|
|
@ -59,11 +59,11 @@ class Create extends BaseApi
|
||||||
$finish = DBA::NULL_DATETIME;
|
$finish = DBA::NULL_DATETIME;
|
||||||
$nofinish = true;
|
$nofinish = true;
|
||||||
} else {
|
} else {
|
||||||
$finish = DateTimeFormat::convert($request['end_time'], 'UTC', DI::app()->getTimeZone());
|
$finish = DateTimeFormat::convert($request['end_time'], 'UTC', DI::appHelper()->getTimeZone());
|
||||||
$nofinish = false;
|
$nofinish = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$start = DateTimeFormat::convert($request['start_time'], 'UTC', DI::app()->getTimeZone());
|
$start = DateTimeFormat::convert($request['start_time'], 'UTC', DI::appHelper()->getTimeZone());
|
||||||
|
|
||||||
// create event
|
// create event
|
||||||
$event = [];
|
$event = [];
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Friendica;
|
namespace Friendica\Module\Api\Friendica;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
|
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
|
||||||
use Friendica\Module\BaseApi;
|
use Friendica\Module\BaseApi;
|
||||||
|
@ -23,9 +25,9 @@ class Photo extends BaseApi
|
||||||
private $friendicaPhoto;
|
private $friendicaPhoto;
|
||||||
|
|
||||||
|
|
||||||
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->friendicaPhoto = $friendicaPhoto;
|
$this->friendicaPhoto = $friendicaPhoto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Friendica\Photo;
|
namespace Friendica\Module\Api\Friendica\Photo;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\ACL;
|
use Friendica\Core\ACL;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
|
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
|
||||||
|
@ -27,9 +29,9 @@ class Create extends BaseApi
|
||||||
private $friendicaPhoto;
|
private $friendicaPhoto;
|
||||||
|
|
||||||
|
|
||||||
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->friendicaPhoto = $friendicaPhoto;
|
$this->friendicaPhoto = $friendicaPhoto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,11 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Friendica\Photo;
|
namespace Friendica\Module\Api\Friendica\Photo;
|
||||||
|
|
||||||
use Friendica\Database\DBA;
|
use Friendica\App\Arguments;
|
||||||
use Friendica\App;
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
|
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
|
||||||
use Friendica\Module\BaseApi;
|
use Friendica\Module\BaseApi;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
@ -29,9 +31,9 @@ class Lists extends BaseApi
|
||||||
private $friendicaPhoto;
|
private $friendicaPhoto;
|
||||||
|
|
||||||
|
|
||||||
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->friendicaPhoto = $friendicaPhoto;
|
$this->friendicaPhoto = $friendicaPhoto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Friendica\Photo;
|
namespace Friendica\Module\Api\Friendica\Photo;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\ACL;
|
use Friendica\Core\ACL;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
|
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
|
||||||
|
@ -27,9 +29,9 @@ class Update extends BaseApi
|
||||||
private $friendicaPhoto;
|
private $friendicaPhoto;
|
||||||
|
|
||||||
|
|
||||||
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->friendicaPhoto = $friendicaPhoto;
|
$this->friendicaPhoto = $friendicaPhoto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Friendica\Photoalbum;
|
namespace Friendica\Module\Api\Friendica\Photoalbum;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
|
use Friendica\Factory\Api\Friendica\Photo as FriendicaPhoto;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
@ -29,9 +31,9 @@ class Show extends BaseApi
|
||||||
private $friendicaPhoto;
|
private $friendicaPhoto;
|
||||||
|
|
||||||
|
|
||||||
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(FriendicaPhoto $friendicaPhoto, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->friendicaPhoto = $friendicaPhoto;
|
$this->friendicaPhoto = $friendicaPhoto;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Mastodon;
|
namespace Friendica\Module\Api\Mastodon;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
|
@ -37,9 +39,9 @@ class Instance extends BaseApi
|
||||||
/** @var AccountFactory */
|
/** @var AccountFactory */
|
||||||
private $accountFactory;
|
private $accountFactory;
|
||||||
|
|
||||||
public function __construct(AccountFactory $accountFactory, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, Database $database, IManageConfigValues $config, array $server, array $parameters = [])
|
public function __construct(AccountFactory $accountFactory, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, Database $database, IManageConfigValues $config, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->database = $database;
|
$this->database = $database;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
namespace Friendica\Module\Api\Mastodon\Instance;
|
namespace Friendica\Module\Api\Mastodon\Instance;
|
||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
|
@ -26,9 +28,9 @@ class ExtendedDescription extends BaseApi
|
||||||
{
|
{
|
||||||
private IManageConfigValues $config;
|
private IManageConfigValues $config;
|
||||||
|
|
||||||
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, IManageConfigValues $config, array $server, array $parameters = [])
|
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, IManageConfigValues $config, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,9 @@ namespace Friendica\Module\Api\Mastodon;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Contact\Header;
|
use Friendica\Contact\Header;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
|
@ -41,10 +44,10 @@ class InstanceV2 extends BaseApi
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
\Friendica\Factory\Api\Mastodon\Error $errorFactory,
|
\Friendica\Factory\Api\Mastodon\Error $errorFactory,
|
||||||
App $app,
|
AppHelper $appHelper,
|
||||||
L10n $l10n,
|
L10n $l10n,
|
||||||
App\BaseURL $baseUrl,
|
BaseURL $baseUrl,
|
||||||
App\Arguments $args,
|
Arguments $args,
|
||||||
LoggerInterface $logger,
|
LoggerInterface $logger,
|
||||||
Profiler $profiler,
|
Profiler $profiler,
|
||||||
ApiResponse $response,
|
ApiResponse $response,
|
||||||
|
@ -53,7 +56,7 @@ class InstanceV2 extends BaseApi
|
||||||
array $server,
|
array $server,
|
||||||
array $parameters = []
|
array $parameters = []
|
||||||
) {
|
) {
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->database = $database;
|
$this->database = $database;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Mastodon;
|
namespace Friendica\Module\Api\Mastodon;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Content\Conversation\Factory\Channel as ChannelFactory;
|
use Friendica\Content\Conversation\Factory\Channel as ChannelFactory;
|
||||||
|
@ -29,9 +31,9 @@ class Lists extends BaseApi
|
||||||
/** @var Repository\UserDefinedChannel */
|
/** @var Repository\UserDefinedChannel */
|
||||||
protected $userDefinedChannel;
|
protected $userDefinedChannel;
|
||||||
|
|
||||||
public function __construct(Repository\UserDefinedChannel $userDefinedChannel, ChannelFactory $channel, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(Repository\UserDefinedChannel $userDefinedChannel, ChannelFactory $channel, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->channel = $channel;
|
$this->channel = $channel;
|
||||||
$this->userDefinedChannel = $userDefinedChannel;
|
$this->userDefinedChannel = $userDefinedChannel;
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Mastodon;
|
namespace Friendica\Module\Api\Mastodon;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Factory\Api\Mastodon\Error;
|
use Friendica\Factory\Api\Mastodon\Error;
|
||||||
use Friendica\Factory\Api\Mastodon\Subscription as SubscriptionFactory;
|
use Friendica\Factory\Api\Mastodon\Subscription as SubscriptionFactory;
|
||||||
|
@ -26,9 +28,9 @@ class PushSubscription extends BaseApi
|
||||||
/** @var SubscriptionFactory */
|
/** @var SubscriptionFactory */
|
||||||
protected $subscriptionFac;
|
protected $subscriptionFac;
|
||||||
|
|
||||||
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, SubscriptionFactory $subscriptionFac, array $server, array $parameters = [])
|
public function __construct(Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, SubscriptionFactory $subscriptionFac, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->subscriptionFac = $subscriptionFac;
|
$this->subscriptionFac = $subscriptionFac;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Mastodon;
|
namespace Friendica\Module\Api\Mastodon;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\System;
|
use Friendica\Core\System;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
@ -27,9 +29,9 @@ class Reports extends BaseApi
|
||||||
/** @var \Friendica\Moderation\Repository\Report */
|
/** @var \Friendica\Moderation\Repository\Report */
|
||||||
private $reportRepo;
|
private $reportRepo;
|
||||||
|
|
||||||
public function __construct(\Friendica\Moderation\Repository\Report $reportRepo, \Friendica\Moderation\Factory\Report $reportFactory, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(\Friendica\Moderation\Repository\Report $reportRepo, \Friendica\Moderation\Factory\Report $reportFactory, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->reportFactory = $reportFactory;
|
$this->reportFactory = $reportFactory;
|
||||||
$this->reportRepo = $reportRepo;
|
$this->reportRepo = $reportRepo;
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Mastodon\Timelines;
|
namespace Friendica\Module\Api\Mastodon\Timelines;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
@ -34,9 +36,9 @@ class ListTimeline extends BaseApi
|
||||||
/** @var Timeline */
|
/** @var Timeline */
|
||||||
protected $timeline;
|
protected $timeline;
|
||||||
|
|
||||||
public function __construct(Timeline $timeline, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(Timeline $timeline, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
$this->timeline = $timeline;
|
$this->timeline = $timeline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Mastodon\Timelines;
|
namespace Friendica\Module\Api\Mastodon\Timelines;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
@ -34,9 +36,9 @@ class PublicTimeline extends BaseApi
|
||||||
*/
|
*/
|
||||||
private $config;
|
private $config;
|
||||||
|
|
||||||
public function __construct(IManageConfigValues $config, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(IManageConfigValues $config, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Mastodon\Trends;
|
namespace Friendica\Module\Api\Mastodon\Trends;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
@ -32,9 +34,9 @@ class Statuses extends BaseApi
|
||||||
*/
|
*/
|
||||||
private $config;
|
private $config;
|
||||||
|
|
||||||
public function __construct(IManageConfigValues $config, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(IManageConfigValues $config, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Twitter;
|
namespace Friendica\Module\Api\Twitter;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
|
@ -24,9 +26,9 @@ abstract class ContactEndpoint extends BaseApi
|
||||||
const DEFAULT_COUNT = 20;
|
const DEFAULT_COUNT = 20;
|
||||||
const MAX_COUNT = 200;
|
const MAX_COUNT = 200;
|
||||||
|
|
||||||
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->checkAllowedScope(self::SCOPE_READ);
|
$this->checkAllowedScope(self::SCOPE_READ);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Twitter\DirectMessages;
|
namespace Friendica\Module\Api\Twitter\DirectMessages;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
@ -27,9 +29,9 @@ class Destroy extends BaseApi
|
||||||
/** @var Database */
|
/** @var Database */
|
||||||
private $dba;
|
private $dba;
|
||||||
|
|
||||||
public function __construct(Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->dba = $dba;
|
$this->dba = $dba;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Twitter\DirectMessages;
|
namespace Friendica\Module\Api\Twitter\DirectMessages;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
use Friendica\Factory\Api\Twitter\DirectMessage;
|
use Friendica\Factory\Api\Twitter\DirectMessage;
|
||||||
|
@ -32,9 +34,9 @@ class NewDM extends BaseApi
|
||||||
/** @var DirectMessage */
|
/** @var DirectMessage */
|
||||||
private $directMessage;
|
private $directMessage;
|
||||||
|
|
||||||
public function __construct(DirectMessage $directMessage, Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(DirectMessage $directMessage, Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->dba = $dba;
|
$this->dba = $dba;
|
||||||
$this->directMessage = $directMessage;
|
$this->directMessage = $directMessage;
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Twitter;
|
namespace Friendica\Module\Api\Twitter;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
@ -26,9 +28,9 @@ abstract class DirectMessagesEndpoint extends BaseApi
|
||||||
/** @var DirectMessage */
|
/** @var DirectMessage */
|
||||||
private $directMessage;
|
private $directMessage;
|
||||||
|
|
||||||
public function __construct(DirectMessage $directMessage, Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(DirectMessage $directMessage, Database $dba, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->dba = $dba;
|
$this->dba = $dba;
|
||||||
$this->directMessage = $directMessage;
|
$this->directMessage = $directMessage;
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
namespace Friendica\Module\Api\Twitter\Friendships;
|
namespace Friendica\Module\Api\Twitter\Friendships;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
use Friendica\Factory\Api\Twitter\User as TwitterUser;
|
use Friendica\Factory\Api\Twitter\User as TwitterUser;
|
||||||
|
@ -31,9 +33,9 @@ class Destroy extends ContactEndpoint
|
||||||
/** @var TwitterUser */
|
/** @var TwitterUser */
|
||||||
private $twitterUser;
|
private $twitterUser;
|
||||||
|
|
||||||
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, TwitterUser $twitterUser, array $server, array $parameters = [])
|
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, TwitterUser $twitterUser, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->twitterUser = $twitterUser;
|
$this->twitterUser = $twitterUser;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Twitter\Lists;
|
namespace Friendica\Module\Api\Twitter\Lists;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle;
|
use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle;
|
||||||
|
@ -32,9 +34,9 @@ class Create extends BaseApi
|
||||||
/** @var Database */
|
/** @var Database */
|
||||||
private $dba;
|
private $dba;
|
||||||
|
|
||||||
public function __construct(Database $dba, FriendicaCircle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(Database $dba, FriendicaCircle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->dba = $dba;
|
$this->dba = $dba;
|
||||||
$this->friendicaCircle = $friendicaCircle;
|
$this->friendicaCircle = $friendicaCircle;
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Twitter\Lists;
|
namespace Friendica\Module\Api\Twitter\Lists;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
use Friendica\Factory\Api\Friendica\Circle as FriendicaCirle;
|
use Friendica\Factory\Api\Friendica\Circle as FriendicaCirle;
|
||||||
|
@ -32,9 +34,9 @@ class Destroy extends BaseApi
|
||||||
/** @var Database */
|
/** @var Database */
|
||||||
private $dba;
|
private $dba;
|
||||||
|
|
||||||
public function __construct(Database $dba, FriendicaCirle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(Database $dba, FriendicaCirle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->dba = $dba;
|
$this->dba = $dba;
|
||||||
$this->friendicaCircle = $friendicaCircle;
|
$this->friendicaCircle = $friendicaCircle;
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Twitter\Lists;
|
namespace Friendica\Module\Api\Twitter\Lists;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle;
|
use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle;
|
||||||
|
@ -30,9 +32,9 @@ class Ownership extends BaseApi
|
||||||
/** @var Database */
|
/** @var Database */
|
||||||
private $dba;
|
private $dba;
|
||||||
|
|
||||||
public function __construct(Database $dba, FriendicaCircle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(Database $dba, FriendicaCircle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->dba = $dba;
|
$this->dba = $dba;
|
||||||
$this->friendicaCircle = $friendicaCircle;
|
$this->friendicaCircle = $friendicaCircle;
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Twitter\Lists;
|
namespace Friendica\Module\Api\Twitter\Lists;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
|
@ -34,9 +36,9 @@ class Statuses extends BaseApi
|
||||||
/** @var Database */
|
/** @var Database */
|
||||||
private $dba;
|
private $dba;
|
||||||
|
|
||||||
public function __construct(Database $dba, TwitterStatus $twitterStatus, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(Database $dba, TwitterStatus $twitterStatus, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->dba = $dba;
|
$this->dba = $dba;
|
||||||
$this->twitterStatus = $twitterStatus;
|
$this->twitterStatus = $twitterStatus;
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Api\Twitter\Lists;
|
namespace Friendica\Module\Api\Twitter\Lists;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle;
|
use Friendica\Factory\Api\Friendica\Circle as FriendicaCircle;
|
||||||
|
@ -32,9 +34,9 @@ class Update extends BaseApi
|
||||||
/** @var Database */
|
/** @var Database */
|
||||||
private $dba;
|
private $dba;
|
||||||
|
|
||||||
public function __construct(Database $dba, FriendicaCircle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(Database $dba, FriendicaCircle $friendicaCircle, \Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($errorFactory, $appHelper, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->dba = $dba;
|
$this->dba = $dba;
|
||||||
$this->friendicaCircle = $friendicaCircle;
|
$this->friendicaCircle = $friendicaCircle;
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Content\Nav;
|
use Friendica\Content\Nav;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
|
@ -28,7 +29,7 @@ class Apps extends BaseModule
|
||||||
/** @var SystemMessages */
|
/** @var SystemMessages */
|
||||||
protected $systemMessages;
|
protected $systemMessages;
|
||||||
|
|
||||||
public function __construct(SystemMessages $systemMessages, Nav $nav, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
|
public function __construct(SystemMessages $systemMessages, Nav $nav, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,10 @@
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
use Friendica\App\Router;
|
use Friendica\App\Router;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Logger;
|
use Friendica\Core\Logger;
|
||||||
|
@ -51,8 +53,8 @@ class BaseApi extends BaseModule
|
||||||
*/
|
*/
|
||||||
protected static $request = [];
|
protected static $request = [];
|
||||||
|
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
protected $app;
|
protected $appHelper;
|
||||||
|
|
||||||
/** @var ApiResponse */
|
/** @var ApiResponse */
|
||||||
protected $response;
|
protected $response;
|
||||||
|
@ -60,11 +62,11 @@ class BaseApi extends BaseModule
|
||||||
/** @var \Friendica\Factory\Api\Mastodon\Error */
|
/** @var \Friendica\Factory\Api\Mastodon\Error */
|
||||||
protected $errorFactory;
|
protected $errorFactory;
|
||||||
|
|
||||||
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
$this->errorFactory = $errorFactory;
|
$this->errorFactory = $errorFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
|
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Page;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
|
@ -33,18 +36,18 @@ abstract class BaseModeration extends BaseModule
|
||||||
protected $session;
|
protected $session;
|
||||||
/** @var SystemMessages */
|
/** @var SystemMessages */
|
||||||
protected $systemMessages;
|
protected $systemMessages;
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
protected $app;
|
protected $appHelper;
|
||||||
/** @var App\Page */
|
/** @var Page */
|
||||||
protected $page;
|
protected $page;
|
||||||
|
|
||||||
public function __construct(App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
public function __construct(Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
$this->systemMessages = $systemMessages;
|
$this->systemMessages = $systemMessages;
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
$this->page = $page;
|
$this->page = $page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,13 @@
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Friendica\App;
|
|
||||||
use Friendica\App\Arguments;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Content\Pager;
|
use Friendica\Content\Pager;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
use Friendica\Core\System;
|
|
||||||
use Friendica\Navigation\Notifications\ValueObject\FormattedNotify;
|
use Friendica\Navigation\Notifications\ValueObject\FormattedNotify;
|
||||||
use Friendica\Network\HTTPException\ForbiddenException;
|
use Friendica\Network\HTTPException\ForbiddenException;
|
||||||
use Friendica\Util\Profiler;
|
use Friendica\Util\Profiler;
|
||||||
|
@ -76,7 +75,7 @@ abstract class BaseNotifications extends BaseModule
|
||||||
*/
|
*/
|
||||||
abstract public function getNotifications();
|
abstract public function getNotifications();
|
||||||
|
|
||||||
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, array $server, array $parameters = [])
|
public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\App;
|
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Content\Feature;
|
use Friendica\Content\Feature;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Page;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Content\Feature;
|
use Friendica\Content\Feature;
|
||||||
use Friendica\Content\Nav;
|
use Friendica\Content\Nav;
|
||||||
|
@ -20,12 +22,12 @@ use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class BaseSettings extends BaseModule
|
class BaseSettings extends BaseModule
|
||||||
{
|
{
|
||||||
/** @var App\Page */
|
/** @var Page */
|
||||||
protected $page;
|
protected $page;
|
||||||
/** @var IHandleUserSessions */
|
/** @var IHandleUserSessions */
|
||||||
protected $session;
|
protected $session;
|
||||||
|
|
||||||
public function __construct(IHandleUserSessions $session, App\Page $page, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
public function __construct(IHandleUserSessions $session, Page $page, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,13 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Calendar\Event;
|
namespace Friendica\Module\Calendar\Event;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
use Friendica\Core\System;
|
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
use Friendica\Database\DBA;
|
use Friendica\Database\DBA;
|
||||||
use Friendica\Model\Contact;
|
use Friendica\Model\Contact;
|
||||||
|
@ -61,14 +62,14 @@ class API extends BaseModule
|
||||||
/** @var string */
|
/** @var string */
|
||||||
protected $timezone;
|
protected $timezone;
|
||||||
|
|
||||||
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, ACLFormatter $aclFormatter, App $app, array $server, array $parameters = [])
|
public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, ACLFormatter $aclFormatter, AppHelper $appHelper, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
$this->sysMessages = $sysMessages;
|
$this->sysMessages = $sysMessages;
|
||||||
$this->aclFormatter = $aclFormatter;
|
$this->aclFormatter = $aclFormatter;
|
||||||
$this->timezone = $app->getTimeZone();
|
$this->timezone = $appHelper->getTimeZone();
|
||||||
|
|
||||||
if (!$this->session->getLocalUserId()) {
|
if (!$this->session->getLocalUserId()) {
|
||||||
throw new UnauthorizedException($this->t('Permission denied.'));
|
throw new UnauthorizedException($this->t('Permission denied.'));
|
||||||
|
|
|
@ -7,15 +7,14 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Calendar\Event;
|
namespace Friendica\Module\Calendar\Event;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Content\Feature;
|
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
use Friendica\Core\System;
|
|
||||||
use Friendica\Model\Event;
|
use Friendica\Model\Event;
|
||||||
use Friendica\Model\User;
|
|
||||||
use Friendica\Module\Response;
|
use Friendica\Module\Response;
|
||||||
use Friendica\Network\HTTPException;
|
use Friendica\Network\HTTPException;
|
||||||
use Friendica\Util\Profiler;
|
use Friendica\Util\Profiler;
|
||||||
|
@ -28,15 +27,15 @@ class Show extends BaseModule
|
||||||
{
|
{
|
||||||
/** @var IHandleUserSessions */
|
/** @var IHandleUserSessions */
|
||||||
protected $session;
|
protected $session;
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
private $app;
|
protected $appHelper;
|
||||||
|
|
||||||
public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, array $server, array $parameters = [])
|
public function __construct(AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function rawContent(array $request = [])
|
protected function rawContent(array $request = [])
|
||||||
|
|
|
@ -7,16 +7,16 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Calendar;
|
namespace Friendica\Module\Calendar;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Content\Feature;
|
use Friendica\Content\Feature;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
use Friendica\Model\Event;
|
use Friendica\Model\Event;
|
||||||
use Friendica\Model\Profile;
|
use Friendica\Model\Profile;
|
||||||
use Friendica\Model\User;
|
|
||||||
use Friendica\Module\Response;
|
use Friendica\Module\Response;
|
||||||
use Friendica\Module\Security\Login;
|
|
||||||
use Friendica\Navigation\SystemMessages;
|
use Friendica\Navigation\SystemMessages;
|
||||||
use Friendica\Network\HTTPException;
|
use Friendica\Network\HTTPException;
|
||||||
use Friendica\Util\Profiler;
|
use Friendica\Util\Profiler;
|
||||||
|
@ -36,16 +36,16 @@ class Export extends BaseModule
|
||||||
protected $session;
|
protected $session;
|
||||||
/** @var SystemMessages */
|
/** @var SystemMessages */
|
||||||
protected $sysMessages;
|
protected $sysMessages;
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
protected $app;
|
protected $appHelper;
|
||||||
|
|
||||||
public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, array $server, array $parameters = [])
|
public function __construct(AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
$this->sysMessages = $sysMessages;
|
$this->sysMessages = $sysMessages;
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function rawContent(array $request = [])
|
protected function rawContent(array $request = [])
|
||||||
|
@ -55,7 +55,7 @@ class Export extends BaseModule
|
||||||
throw new HTTPException\BadRequestException();
|
throw new HTTPException\BadRequestException();
|
||||||
}
|
}
|
||||||
|
|
||||||
$owner = Profile::load($this->app, $nickname, false);
|
$owner = Profile::load($this->appHelper, $nickname, false);
|
||||||
if (!$owner || $owner['account_expired'] || $owner['account_removed']) {
|
if (!$owner || $owner['account_expired'] || $owner['account_removed']) {
|
||||||
throw new HTTPException\NotFoundException($this->t('User not found.'));
|
throw new HTTPException\NotFoundException($this->t('User not found.'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Calendar;
|
namespace Friendica\Module\Calendar;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Page;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Content\Feature;
|
use Friendica\Content\Feature;
|
||||||
use Friendica\Content\Nav;
|
use Friendica\Content\Nav;
|
||||||
|
@ -33,19 +36,19 @@ class Show extends BaseModule
|
||||||
protected $session;
|
protected $session;
|
||||||
/** @var SystemMessages */
|
/** @var SystemMessages */
|
||||||
protected $sysMessages;
|
protected $sysMessages;
|
||||||
/** @var App\Page */
|
/** @var Page */
|
||||||
protected $page;
|
protected $page;
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
protected $app;
|
protected $appHelper;
|
||||||
|
|
||||||
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, App\Page $page, App $app, array $server, array $parameters = [])
|
public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, SystemMessages $sysMessages, Page $page, AppHelper $appHelper, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
$this->sysMessages = $sysMessages;
|
$this->sysMessages = $sysMessages;
|
||||||
$this->page = $page;
|
$this->page = $page;
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function content(array $request = []): string
|
protected function content(array $request = []): string
|
||||||
|
@ -55,7 +58,7 @@ class Show extends BaseModule
|
||||||
throw new HTTPException\UnauthorizedException();
|
throw new HTTPException\UnauthorizedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
$owner = Profile::load($this->app, $nickname, false);
|
$owner = Profile::load($this->appHelper, $nickname, false);
|
||||||
if (!$owner || $owner['account_expired'] || $owner['account_removed']) {
|
if (!$owner || $owner['account_expired'] || $owner['account_removed']) {
|
||||||
throw new HTTPException\NotFoundException($this->t('User not found.'));
|
throw new HTTPException\NotFoundException($this->t('User not found.'));
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,8 +7,10 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Contact;
|
namespace Friendica\Module\Contact;
|
||||||
|
|
||||||
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\App;
|
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
use Friendica\Core\Worker;
|
use Friendica\Core\Worker;
|
||||||
|
@ -27,16 +29,16 @@ class Redir extends \Friendica\BaseModule
|
||||||
private $session;
|
private $session;
|
||||||
/** @var Database */
|
/** @var Database */
|
||||||
private $database;
|
private $database;
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
private $app;
|
private $appHelper;
|
||||||
|
|
||||||
public function __construct(App $app, Database $database, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
public function __construct(AppHelper $appHelper, Database $database, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
$this->database = $database;
|
$this->database = $database;
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function rawContent(array $request = [])
|
protected function rawContent(array $request = [])
|
||||||
|
@ -100,14 +102,14 @@ class Redir extends \Friendica\BaseModule
|
||||||
// We don't use magic auth when there is no visitor, we are on the same system, or we visit our own stuff
|
// We don't use magic auth when there is no visitor, we are on the same system, or we visit our own stuff
|
||||||
if (empty($visitor) || Strings::compareLink($basepath, $this->baseUrl) || Strings::compareLink($contact_url, $visitor)) {
|
if (empty($visitor) || Strings::compareLink($basepath, $this->baseUrl) || Strings::compareLink($contact_url, $visitor)) {
|
||||||
$this->logger->info('Redirecting without magic', ['target' => $target_url, 'visitor' => $visitor, 'contact' => $contact_url]);
|
$this->logger->info('Redirecting without magic', ['target' => $target_url, 'visitor' => $visitor, 'contact' => $contact_url]);
|
||||||
$this->app->redirect($target_url);
|
$this->appHelper->redirect($target_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
$separator = strpos($target_url, '?') ? '&' : '?';
|
$separator = strpos($target_url, '?') ? '&' : '?';
|
||||||
$target_url .= $separator . 'zrl=' . urlencode($visitor) . '&addr=' . urlencode($contact_url);
|
$target_url .= $separator . 'zrl=' . urlencode($visitor) . '&addr=' . urlencode($contact_url);
|
||||||
|
|
||||||
$this->logger->info('Redirecting with magic', ['target' => $target_url, 'visitor' => $visitor, 'contact' => $contact_url]);
|
$this->logger->info('Redirecting with magic', ['target' => $target_url, 'visitor' => $visitor, 'contact' => $contact_url]);
|
||||||
$this->app->redirect($target_url);
|
$this->appHelper->redirect($target_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -135,9 +137,9 @@ class Redir extends \Friendica\BaseModule
|
||||||
$this->checkUrl($contact_url, $url);
|
$this->checkUrl($contact_url, $url);
|
||||||
$target_url = $url ?: $contact_url;
|
$target_url = $url ?: $contact_url;
|
||||||
|
|
||||||
if (!empty($this->app->getContactId()) && $this->app->getContactId() == $cid) {
|
if (!empty($this->appHelper->getContactId()) && $this->appHelper->getContactId() == $cid) {
|
||||||
// Local user is already authenticated.
|
// Local user is already authenticated.
|
||||||
$this->app->redirect($target_url);
|
$this->appHelper->redirect($target_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contact['uid'] == 0 && $this->session->getLocalUserId()) {
|
if ($contact['uid'] == 0 && $this->session->getLocalUserId()) {
|
||||||
|
@ -148,10 +150,10 @@ class Redir extends \Friendica\BaseModule
|
||||||
$cid = $contact['id'];
|
$cid = $contact['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($this->app->getContactId()) && $this->app->getContactId() == $cid) {
|
if (!empty($this->appHelper->getContactId()) && $this->appHelper->getContactId() == $cid) {
|
||||||
// Local user is already authenticated.
|
// Local user is already authenticated.
|
||||||
$this->logger->info('Contact already authenticated. Redirecting to target url', ['url' => $contact['url'], 'name' => $contact['name'], 'target_url' => $target_url]);
|
$this->logger->info('Contact already authenticated. Redirecting to target url', ['url' => $contact['url'], 'name' => $contact['name'], 'target_url' => $target_url]);
|
||||||
$this->app->redirect($target_url);
|
$this->appHelper->redirect($target_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +168,7 @@ class Redir extends \Friendica\BaseModule
|
||||||
if (($host == $remotehost) && ($this->session->getRemoteContactID($this->session->get('visitor_visiting')) == $this->session->get('visitor_id'))) {
|
if (($host == $remotehost) && ($this->session->getRemoteContactID($this->session->get('visitor_visiting')) == $this->session->get('visitor_id'))) {
|
||||||
// Remote user is already authenticated.
|
// Remote user is already authenticated.
|
||||||
$this->logger->info('Contact already authenticated. Redirecting to target url', ['url' => $contact['url'], 'name' => $contact['name'], 'target_url' => $target_url]);
|
$this->logger->info('Contact already authenticated. Redirecting to target url', ['url' => $contact['url'], 'name' => $contact['name'], 'target_url' => $target_url]);
|
||||||
$this->app->redirect($target_url);
|
$this->appHelper->redirect($target_url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +183,7 @@ class Redir extends \Friendica\BaseModule
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->logger->info('redirecting to ' . $target_url);
|
$this->logger->info('redirecting to ' . $target_url);
|
||||||
$this->app->redirect($target_url);
|
$this->appHelper->redirect($target_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,11 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Conversation;
|
namespace Friendica\Module\Conversation;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
use Friendica\App\Mode;
|
use Friendica\App\Mode;
|
||||||
|
use Friendica\App\Page;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Content\BoundariesPager;
|
use Friendica\Content\BoundariesPager;
|
||||||
use Friendica\Content\Conversation;
|
use Friendica\Content\Conversation;
|
||||||
use Friendica\Content\Conversation\Entity\Channel;
|
use Friendica\Content\Conversation\Entity\Channel;
|
||||||
|
@ -61,15 +64,15 @@ class Network extends Timeline
|
||||||
/** @var int */
|
/** @var int */
|
||||||
protected $mention;
|
protected $mention;
|
||||||
|
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
protected $app;
|
protected $appHelper;
|
||||||
/** @var ICanCache */
|
/** @var ICanCache */
|
||||||
protected $cache;
|
protected $cache;
|
||||||
/** @var IManageConfigValues The config */
|
/** @var IManageConfigValues The config */
|
||||||
protected $config;
|
protected $config;
|
||||||
/** @var SystemMessages */
|
/** @var SystemMessages */
|
||||||
protected $systemMessages;
|
protected $systemMessages;
|
||||||
/** @var App\Page */
|
/** @var Page */
|
||||||
protected $page;
|
protected $page;
|
||||||
/** @var Conversation */
|
/** @var Conversation */
|
||||||
protected $conversation;
|
protected $conversation;
|
||||||
|
@ -88,11 +91,11 @@ class Network extends Timeline
|
||||||
/** @var NetworkFactory */
|
/** @var NetworkFactory */
|
||||||
protected $networkFactory;
|
protected $networkFactory;
|
||||||
|
|
||||||
public function __construct(UserDefinedChannelFactory $userDefinedChannel, NetworkFactory $network, CommunityFactory $community, ChannelFactory $channelFactory, UserDefinedChannel $channel, App $app, TimelineFactory $timeline, SystemMessages $systemMessages, Mode $mode, Conversation $conversation, App\Page $page, IHandleUserSessions $session, Database $database, IManagePersonalConfigValues $pConfig, IManageConfigValues $config, ICanCache $cache, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
public function __construct(UserDefinedChannelFactory $userDefinedChannel, NetworkFactory $network, CommunityFactory $community, ChannelFactory $channelFactory, UserDefinedChannel $channel, AppHelper $appHelper, TimelineFactory $timeline, SystemMessages $systemMessages, Mode $mode, Conversation $conversation, Page $page, IHandleUserSessions $session, Database $database, IManagePersonalConfigValues $pConfig, IManageConfigValues $config, ICanCache $cache, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($channel, $mode, $session, $database, $pConfig, $config, $cache, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($channel, $mode, $session, $database, $pConfig, $config, $cache, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
$this->timeline = $timeline;
|
$this->timeline = $timeline;
|
||||||
$this->systemMessages = $systemMessages;
|
$this->systemMessages = $systemMessages;
|
||||||
$this->conversation = $conversation;
|
$this->conversation = $conversation;
|
||||||
|
@ -393,10 +396,10 @@ class Network extends Timeline
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->dateFrom) {
|
if ($this->dateFrom) {
|
||||||
$conditionStrings = DBA::mergeConditions($conditionStrings, ["`received` <= ? ", DateTimeFormat::convert($this->dateFrom, 'UTC', $this->app->getTimeZone())]);
|
$conditionStrings = DBA::mergeConditions($conditionStrings, ["`received` <= ? ", DateTimeFormat::convert($this->dateFrom, 'UTC', $this->appHelper->getTimeZone())]);
|
||||||
}
|
}
|
||||||
if ($this->dateTo) {
|
if ($this->dateTo) {
|
||||||
$conditionStrings = DBA::mergeConditions($conditionStrings, ["`received` >= ? ", DateTimeFormat::convert($this->dateTo, 'UTC', $this->app->getTimeZone())]);
|
$conditionStrings = DBA::mergeConditions($conditionStrings, ["`received` >= ? ", DateTimeFormat::convert($this->dateTo, 'UTC', $this->appHelper->getTimeZone())]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->circleId) {
|
if ($this->circleId) {
|
||||||
|
|
|
@ -7,7 +7,8 @@
|
||||||
|
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
|
@ -35,7 +36,7 @@ class FriendSuggest extends BaseModule
|
||||||
/** @var \Friendica\Contact\FriendSuggest\Factory\FriendSuggest */
|
/** @var \Friendica\Contact\FriendSuggest\Factory\FriendSuggest */
|
||||||
protected $friendSuggestFac;
|
protected $friendSuggestFac;
|
||||||
|
|
||||||
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Database $dba, \Friendica\Contact\FriendSuggest\Repository\FriendSuggest $friendSuggestRepo, \Friendica\Contact\FriendSuggest\Factory\FriendSuggest $friendSuggestFac, array $server, array $parameters = [])
|
public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Database $dba, \Friendica\Contact\FriendSuggest\Repository\FriendSuggest $friendSuggestRepo, \Friendica\Contact\FriendSuggest\Factory\FriendSuggest $friendSuggestFac, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core\Addon;
|
use Friendica\Core\Addon;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
|
@ -36,7 +38,7 @@ class Friendica extends BaseModule
|
||||||
/** @var IHandleUserSessions */
|
/** @var IHandleUserSessions */
|
||||||
private $session;
|
private $session;
|
||||||
|
|
||||||
public function __construct(IHandleUserSessions $session, IManageKeyValuePairs $keyValue, IManageConfigValues $config, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
public function __construct(IHandleUserSessions $session, IManageKeyValuePairs $keyValue, IManageConfigValues $config, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ class Home extends BaseModule
|
||||||
|
|
||||||
protected function content(array $request = []): string
|
protected function content(array $request = []): string
|
||||||
{
|
{
|
||||||
$app = DI::app();
|
$basePath = DI::appHelper()->getBasePath();
|
||||||
$config = DI::config();
|
$config = DI::config();
|
||||||
|
|
||||||
// currently no returned data is used
|
// currently no returned data is used
|
||||||
|
@ -51,8 +51,8 @@ class Home extends BaseModule
|
||||||
$customHome = '';
|
$customHome = '';
|
||||||
$defaultHeader = ($config->get('config', 'sitename') ? DI::l10n()->t('Welcome to %s', $config->get('config', 'sitename')) : '');
|
$defaultHeader = ($config->get('config', 'sitename') ? DI::l10n()->t('Welcome to %s', $config->get('config', 'sitename')) : '');
|
||||||
|
|
||||||
$homeFilePath = $app->getBasePath() . '/home.html';
|
$homeFilePath = $basePath . '/home.html';
|
||||||
$cssFilePath = $app->getBasePath() . '/home.css';
|
$cssFilePath = $basePath . '/home.css';
|
||||||
|
|
||||||
if (file_exists($homeFilePath)) {
|
if (file_exists($homeFilePath)) {
|
||||||
$customHome = $homeFilePath;
|
$customHome = $homeFilePath;
|
||||||
|
|
|
@ -7,10 +7,14 @@
|
||||||
|
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Mode;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core;
|
use Friendica\Core;
|
||||||
use Friendica\Core\Config\ValueObject\Cache;
|
use Friendica\Core\Config\ValueObject\Cache;
|
||||||
|
use Friendica\Core\Installer;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Theme;
|
use Friendica\Core\Theme;
|
||||||
|
@ -51,20 +55,20 @@ class Install extends BaseModule
|
||||||
private $currentWizardStep;
|
private $currentWizardStep;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Core\Installer The installer
|
* @var Installer The installer
|
||||||
*/
|
*/
|
||||||
private $installer;
|
private $installer;
|
||||||
|
|
||||||
/** @var App */
|
/** @var Cache */
|
||||||
protected $app;
|
protected $configCache;
|
||||||
/** @var App\Mode */
|
/** @var Mode */
|
||||||
protected $mode;
|
protected $mode;
|
||||||
|
|
||||||
public function __construct(App $app, BasePath $basePath, App\Mode $mode, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Core\Installer $installer, array $server, array $parameters = [])
|
public function __construct(AppHelper $appHelper, BasePath $basePath, Mode $mode, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Installer $installer, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->app = $app;
|
$this->configCache = $appHelper->getConfigCache();
|
||||||
$this->mode = $mode;
|
$this->mode = $mode;
|
||||||
$this->installer = $installer;
|
$this->installer = $installer;
|
||||||
|
|
||||||
|
@ -80,8 +84,7 @@ class Install extends BaseModule
|
||||||
}
|
}
|
||||||
|
|
||||||
// get basic installation information and save them to the config cache
|
// get basic installation information and save them to the config cache
|
||||||
$configCache = $this->app->getConfigCache();
|
$this->installer->setUpCache($this->configCache, $basePath->getPath());
|
||||||
$this->installer->setUpCache($configCache, $basePath->getPath());
|
|
||||||
|
|
||||||
// We overwrite current theme css, because during install we may not have a working mod_rewrite
|
// We overwrite current theme css, because during install we may not have a working mod_rewrite
|
||||||
// so we may not have a css at all. Here we set a static css file for the install procedure pages
|
// so we may not have a css at all. Here we set a static css file for the install procedure pages
|
||||||
|
@ -92,31 +95,29 @@ class Install extends BaseModule
|
||||||
|
|
||||||
protected function post(array $request = [])
|
protected function post(array $request = [])
|
||||||
{
|
{
|
||||||
$configCache = $this->app->getConfigCache();
|
|
||||||
|
|
||||||
switch ($this->currentWizardStep) {
|
switch ($this->currentWizardStep) {
|
||||||
case self::SYSTEM_CHECK:
|
case self::SYSTEM_CHECK:
|
||||||
case self::BASE_CONFIG:
|
case self::BASE_CONFIG:
|
||||||
$this->checkSetting($configCache, $_POST, 'config', 'php_path');
|
$this->checkSetting($this->configCache, $_POST, 'config', 'php_path');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case self::DATABASE_CONFIG:
|
case self::DATABASE_CONFIG:
|
||||||
$this->checkSetting($configCache, $_POST, 'config', 'php_path');
|
$this->checkSetting($this->configCache, $_POST, 'config', 'php_path');
|
||||||
|
|
||||||
$this->checkSetting($configCache, $_POST, 'system', 'basepath');
|
$this->checkSetting($this->configCache, $_POST, 'system', 'basepath');
|
||||||
$this->checkSetting($configCache, $_POST, 'system', 'url');
|
$this->checkSetting($this->configCache, $_POST, 'system', 'url');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case self::SITE_SETTINGS:
|
case self::SITE_SETTINGS:
|
||||||
$this->checkSetting($configCache, $_POST, 'config', 'php_path');
|
$this->checkSetting($this->configCache, $_POST, 'config', 'php_path');
|
||||||
|
|
||||||
$this->checkSetting($configCache, $_POST, 'system', 'basepath');
|
$this->checkSetting($this->configCache, $_POST, 'system', 'basepath');
|
||||||
$this->checkSetting($configCache, $_POST, 'system', 'url');
|
$this->checkSetting($this->configCache, $_POST, 'system', 'url');
|
||||||
|
|
||||||
$this->checkSetting($configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST);
|
$this->checkSetting($this->configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST);
|
||||||
$this->checkSetting($configCache, $_POST, 'database', 'username', '');
|
$this->checkSetting($this->configCache, $_POST, 'database', 'username', '');
|
||||||
$this->checkSetting($configCache, $_POST, 'database', 'password', '');
|
$this->checkSetting($this->configCache, $_POST, 'database', 'password', '');
|
||||||
$this->checkSetting($configCache, $_POST, 'database', 'database', '');
|
$this->checkSetting($this->configCache, $_POST, 'database', 'database', '');
|
||||||
|
|
||||||
// If we cannot connect to the database, return to the previous step
|
// If we cannot connect to the database, return to the previous step
|
||||||
if (!$this->installer->checkDB(DI::dba())) {
|
if (!$this->installer->checkDB(DI::dba())) {
|
||||||
|
@ -126,19 +127,19 @@ class Install extends BaseModule
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case self::FINISHED:
|
case self::FINISHED:
|
||||||
$this->checkSetting($configCache, $_POST, 'config', 'php_path');
|
$this->checkSetting($this->configCache, $_POST, 'config', 'php_path');
|
||||||
|
|
||||||
$this->checkSetting($configCache, $_POST, 'system', 'basepath');
|
$this->checkSetting($this->configCache, $_POST, 'system', 'basepath');
|
||||||
$this->checkSetting($configCache, $_POST, 'system', 'url');
|
$this->checkSetting($this->configCache, $_POST, 'system', 'url');
|
||||||
|
|
||||||
$this->checkSetting($configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST);
|
$this->checkSetting($this->configCache, $_POST, 'database', 'hostname', Core\Installer::DEFAULT_HOST);
|
||||||
$this->checkSetting($configCache, $_POST, 'database', 'username', '');
|
$this->checkSetting($this->configCache, $_POST, 'database', 'username', '');
|
||||||
$this->checkSetting($configCache, $_POST, 'database', 'password', '');
|
$this->checkSetting($this->configCache, $_POST, 'database', 'password', '');
|
||||||
$this->checkSetting($configCache, $_POST, 'database', 'database', '');
|
$this->checkSetting($this->configCache, $_POST, 'database', 'database', '');
|
||||||
|
|
||||||
$this->checkSetting($configCache, $_POST, 'system', 'default_timezone', Core\Installer::DEFAULT_TZ);
|
$this->checkSetting($this->configCache, $_POST, 'system', 'default_timezone', Core\Installer::DEFAULT_TZ);
|
||||||
$this->checkSetting($configCache, $_POST, 'system', 'language', Core\Installer::DEFAULT_LANG);
|
$this->checkSetting($this->configCache, $_POST, 'system', 'language', Core\Installer::DEFAULT_LANG);
|
||||||
$this->checkSetting($configCache, $_POST, 'config', 'admin_email', '');
|
$this->checkSetting($this->configCache, $_POST, 'config', 'admin_email', '');
|
||||||
|
|
||||||
// If we cannot connect to the database, return to the Database config wizard
|
// If we cannot connect to the database, return to the Database config wizard
|
||||||
if (!$this->installer->checkDB(DI::dba())) {
|
if (!$this->installer->checkDB(DI::dba())) {
|
||||||
|
@ -146,7 +147,7 @@ class Install extends BaseModule
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->installer->createConfig($configCache)) {
|
if (!$this->installer->createConfig($this->configCache)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,15 +170,13 @@ class Install extends BaseModule
|
||||||
|
|
||||||
protected function content(array $request = []): string
|
protected function content(array $request = []): string
|
||||||
{
|
{
|
||||||
$configCache = $this->app->getConfigCache();
|
|
||||||
|
|
||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
$install_title = $this->t('Friendica Communications Server - Setup');
|
$install_title = $this->t('Friendica Communications Server - Setup');
|
||||||
|
|
||||||
switch ($this->currentWizardStep) {
|
switch ($this->currentWizardStep) {
|
||||||
case self::SYSTEM_CHECK:
|
case self::SYSTEM_CHECK:
|
||||||
$php_path = $configCache->get('config', 'php_path');
|
$php_path = $this->configCache->get('config', 'php_path');
|
||||||
|
|
||||||
$status = $this->installer->checkEnvironment($this->baseUrl, $php_path);
|
$status = $this->installer->checkEnvironment($this->baseUrl, $php_path);
|
||||||
|
|
||||||
|
@ -199,8 +198,8 @@ class Install extends BaseModule
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case self::BASE_CONFIG:
|
case self::BASE_CONFIG:
|
||||||
$baseUrl = $configCache->get('system', 'url') ?
|
$baseUrl = $this->configCache->get('system', 'url') ?
|
||||||
new Uri($configCache->get('system', 'url')) :
|
new Uri($this->configCache->get('system', 'url')) :
|
||||||
$this->baseUrl;
|
$this->baseUrl;
|
||||||
|
|
||||||
$tpl = Renderer::getMarkupTemplate('install/02_base_config.tpl');
|
$tpl = Renderer::getMarkupTemplate('install/02_base_config.tpl');
|
||||||
|
@ -209,7 +208,7 @@ class Install extends BaseModule
|
||||||
'$pass' => $this->t('Base settings'),
|
'$pass' => $this->t('Base settings'),
|
||||||
'$basepath' => ['system-basepath',
|
'$basepath' => ['system-basepath',
|
||||||
$this->t("Base path to installation"),
|
$this->t("Base path to installation"),
|
||||||
$configCache->get('system', 'basepath'),
|
$this->configCache->get('system', 'basepath'),
|
||||||
$this->t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."),
|
$this->t("If the system cannot detect the correct path to your installation, enter the correct path here. This setting should only be set if you are using a restricted system and symbolic links to your webroot."),
|
||||||
$this->t('Required')],
|
$this->t('Required')],
|
||||||
'$system_url' => ['system-url',
|
'$system_url' => ['system-url',
|
||||||
|
@ -217,7 +216,7 @@ class Install extends BaseModule
|
||||||
(string)$baseUrl,
|
(string)$baseUrl,
|
||||||
$this->t("Overwrite this field in case the system URL determination isn't right, otherwise leave it as is."),
|
$this->t("Overwrite this field in case the system URL determination isn't right, otherwise leave it as is."),
|
||||||
$this->t('Required')],
|
$this->t('Required')],
|
||||||
'$php_path' => $configCache->get('config', 'php_path'),
|
'$php_path' => $this->configCache->get('config', 'php_path'),
|
||||||
'$submit' => $this->t('Submit'),
|
'$submit' => $this->t('Submit'),
|
||||||
]);
|
]);
|
||||||
break;
|
break;
|
||||||
|
@ -233,31 +232,31 @@ class Install extends BaseModule
|
||||||
'$required' => $this->t('Required'),
|
'$required' => $this->t('Required'),
|
||||||
'$requirement_not_satisfied' => $this->t('Requirement not satisfied'),
|
'$requirement_not_satisfied' => $this->t('Requirement not satisfied'),
|
||||||
'$checks' => $this->installer->getChecks(),
|
'$checks' => $this->installer->getChecks(),
|
||||||
'$basepath' => $configCache->get('system', 'basepath'),
|
'$basepath' => $this->configCache->get('system', 'basepath'),
|
||||||
'$system_url' => $configCache->get('system', 'url'),
|
'$system_url' => $this->configCache->get('system', 'url'),
|
||||||
'$dbhost' => ['database-hostname',
|
'$dbhost' => ['database-hostname',
|
||||||
$this->t('Database Server Name'),
|
$this->t('Database Server Name'),
|
||||||
$configCache->get('database', 'hostname'),
|
$this->configCache->get('database', 'hostname'),
|
||||||
'',
|
'',
|
||||||
$this->t('Required')],
|
$this->t('Required')],
|
||||||
'$dbuser' => ['database-username',
|
'$dbuser' => ['database-username',
|
||||||
$this->t('Database Login Name'),
|
$this->t('Database Login Name'),
|
||||||
$configCache->get('database', 'username'),
|
$this->configCache->get('database', 'username'),
|
||||||
'',
|
'',
|
||||||
$this->t('Required'),
|
$this->t('Required'),
|
||||||
'autofocus'],
|
'autofocus'],
|
||||||
'$dbpass' => ['database-password',
|
'$dbpass' => ['database-password',
|
||||||
$this->t('Database Login Password'),
|
$this->t('Database Login Password'),
|
||||||
$configCache->get('database', 'password'),
|
$this->configCache->get('database', 'password'),
|
||||||
$this->t("For security reasons the password must not be empty"),
|
$this->t("For security reasons the password must not be empty"),
|
||||||
$this->t('Required')],
|
$this->t('Required')],
|
||||||
'$dbdata' => ['database-database',
|
'$dbdata' => ['database-database',
|
||||||
$this->t('Database Name'),
|
$this->t('Database Name'),
|
||||||
$configCache->get('database', 'database'),
|
$this->configCache->get('database', 'database'),
|
||||||
'',
|
'',
|
||||||
$this->t('Required')],
|
$this->t('Required')],
|
||||||
'$lbl_10' => $this->t('Please select a default timezone for your website'),
|
'$lbl_10' => $this->t('Please select a default timezone for your website'),
|
||||||
'$php_path' => $configCache->get('config', 'php_path'),
|
'$php_path' => $this->configCache->get('config', 'php_path'),
|
||||||
'$submit' => $this->t('Submit')
|
'$submit' => $this->t('Submit')
|
||||||
]);
|
]);
|
||||||
break;
|
break;
|
||||||
|
@ -272,27 +271,27 @@ class Install extends BaseModule
|
||||||
'$required' => $this->t('Required'),
|
'$required' => $this->t('Required'),
|
||||||
'$checks' => $this->installer->getChecks(),
|
'$checks' => $this->installer->getChecks(),
|
||||||
'$pass' => $this->t('Site settings'),
|
'$pass' => $this->t('Site settings'),
|
||||||
'$basepath' => $configCache->get('system', 'basepath'),
|
'$basepath' => $this->configCache->get('system', 'basepath'),
|
||||||
'$system_url' => $configCache->get('system', 'url'),
|
'$system_url' => $this->configCache->get('system', 'url'),
|
||||||
'$dbhost' => $configCache->get('database', 'hostname'),
|
'$dbhost' => $this->configCache->get('database', 'hostname'),
|
||||||
'$dbuser' => $configCache->get('database', 'username'),
|
'$dbuser' => $this->configCache->get('database', 'username'),
|
||||||
'$dbpass' => $configCache->get('database', 'password'),
|
'$dbpass' => $this->configCache->get('database', 'password'),
|
||||||
'$dbdata' => $configCache->get('database', 'database'),
|
'$dbdata' => $this->configCache->get('database', 'database'),
|
||||||
'$adminmail' => ['config-admin_email',
|
'$adminmail' => ['config-admin_email',
|
||||||
$this->t('Site administrator email address'),
|
$this->t('Site administrator email address'),
|
||||||
$configCache->get('config', 'admin_email'),
|
$this->configCache->get('config', 'admin_email'),
|
||||||
$this->t('Your account email address must match this in order to use the web admin panel.'),
|
$this->t('Your account email address must match this in order to use the web admin panel.'),
|
||||||
$this->t('Required'), 'autofocus', 'email'],
|
$this->t('Required'), 'autofocus', 'email'],
|
||||||
'$timezone' => Temporal::getTimezoneField('system-default_timezone',
|
'$timezone' => Temporal::getTimezoneField('system-default_timezone',
|
||||||
$this->t('Please select a default timezone for your website'),
|
$this->t('Please select a default timezone for your website'),
|
||||||
$configCache->get('system', 'default_timezone'),
|
$this->configCache->get('system', 'default_timezone'),
|
||||||
''),
|
''),
|
||||||
'$language' => ['system-language',
|
'$language' => ['system-language',
|
||||||
$this->t('System Language:'),
|
$this->t('System Language:'),
|
||||||
$configCache->get('system', 'language'),
|
$this->configCache->get('system', 'language'),
|
||||||
$this->t('Set the default language for your Friendica installation interface and to send emails.'),
|
$this->t('Set the default language for your Friendica installation interface and to send emails.'),
|
||||||
$lang_choices],
|
$lang_choices],
|
||||||
'$php_path' => $configCache->get('config', 'php_path'),
|
'$php_path' => $this->configCache->get('config', 'php_path'),
|
||||||
'$submit' => $this->t('Submit')
|
'$submit' => $this->t('Submit')
|
||||||
]);
|
]);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -8,7 +8,10 @@
|
||||||
namespace Friendica\Module\Item;
|
namespace Friendica\Module\Item;
|
||||||
|
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Page;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Content\Feature;
|
use Friendica\Content\Feature;
|
||||||
use Friendica\Core\ACL;
|
use Friendica\Core\ACL;
|
||||||
|
@ -41,7 +44,7 @@ class Compose extends BaseModule
|
||||||
/** @var ACLFormatter */
|
/** @var ACLFormatter */
|
||||||
private $ACLFormatter;
|
private $ACLFormatter;
|
||||||
|
|
||||||
/** @var App\Page */
|
/** @var Page */
|
||||||
private $page;
|
private $page;
|
||||||
|
|
||||||
/** @var IManagePersonalConfigValues */
|
/** @var IManagePersonalConfigValues */
|
||||||
|
@ -53,11 +56,11 @@ class Compose extends BaseModule
|
||||||
/** @var UserSession */
|
/** @var UserSession */
|
||||||
private $session;
|
private $session;
|
||||||
|
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
private $app;
|
private $appHelper;
|
||||||
|
|
||||||
|
|
||||||
public function __construct(App $app, UserSession $session, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, App\Page $page, ACLFormatter $ACLFormatter, SystemMessages $systemMessages, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
public function __construct(AppHelper $appHelper, UserSession $session, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, Page $page, ACLFormatter $ACLFormatter, SystemMessages $systemMessages, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
|
@ -67,7 +70,7 @@ class Compose extends BaseModule
|
||||||
$this->pConfig = $pConfig;
|
$this->pConfig = $pConfig;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function post(array $request = [])
|
protected function post(array $request = [])
|
||||||
|
@ -87,7 +90,7 @@ class Compose extends BaseModule
|
||||||
return Login::form('compose');
|
return Login::form('compose');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->app->getCurrentTheme() !== 'frio') {
|
if ($this->appHelper->getCurrentTheme() !== 'frio') {
|
||||||
throw new NotImplementedException($this->l10n->t('This feature is only available with the frio theme.'));
|
throw new NotImplementedException($this->l10n->t('This feature is only available with the frio theme.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +118,7 @@ class Compose extends BaseModule
|
||||||
$compose_title = $this->l10n->t('Compose new personal note');
|
$compose_title = $this->l10n->t('Compose new personal note');
|
||||||
$type = 'note';
|
$type = 'note';
|
||||||
$doesFederate = false;
|
$doesFederate = false;
|
||||||
$contact_allow_list = [$this->app->getContactId()];
|
$contact_allow_list = [$this->appHelper->getContactId()];
|
||||||
$circle_allow_list = [];
|
$circle_allow_list = [];
|
||||||
$contact_deny_list = [];
|
$contact_deny_list = [];
|
||||||
$circle_deny_list = [];
|
$circle_deny_list = [];
|
||||||
|
@ -158,12 +161,12 @@ class Compose extends BaseModule
|
||||||
$this->page->registerFooterScript(Theme::getPathForFile('js/linkPreview.js'));
|
$this->page->registerFooterScript(Theme::getPathForFile('js/linkPreview.js'));
|
||||||
$this->page->registerFooterScript(Theme::getPathForFile('js/compose.js'));
|
$this->page->registerFooterScript(Theme::getPathForFile('js/compose.js'));
|
||||||
|
|
||||||
$contact = Contact::getById($this->app->getContactId());
|
$contact = Contact::getById($this->appHelper->getContactId());
|
||||||
|
|
||||||
if ($this->pConfig->get($this->session->getLocalUserId(), 'system', 'set_creation_date')) {
|
if ($this->pConfig->get($this->session->getLocalUserId(), 'system', 'set_creation_date')) {
|
||||||
$created_at = Temporal::getDateTimeField(
|
$created_at = Temporal::getDateTimeField(
|
||||||
new \DateTime(DBA::NULL_DATETIME),
|
new DateTime(DBA::NULL_DATETIME),
|
||||||
new \DateTime('now'),
|
new DateTime('now'),
|
||||||
null,
|
null,
|
||||||
$this->l10n->t('Created at'),
|
$this->l10n->t('Created at'),
|
||||||
'created_at'
|
'created_at'
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
namespace Friendica\Module\Item;
|
namespace Friendica\Module\Item;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Content\Conversation;
|
use Friendica\Content\Conversation;
|
||||||
use Friendica\Content\Item as ContentItem;
|
use Friendica\Content\Item as ContentItem;
|
||||||
|
@ -46,8 +47,8 @@ class Display extends BaseModule
|
||||||
protected $pConfig;
|
protected $pConfig;
|
||||||
/** @var IHandleUserSessions */
|
/** @var IHandleUserSessions */
|
||||||
protected $session;
|
protected $session;
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
protected $app;
|
protected $appHelper;
|
||||||
/** @var ContentItem */
|
/** @var ContentItem */
|
||||||
protected $contentItem;
|
protected $contentItem;
|
||||||
/** @var Conversation */
|
/** @var Conversation */
|
||||||
|
@ -57,7 +58,7 @@ class Display extends BaseModule
|
||||||
/** @var Notify */
|
/** @var Notify */
|
||||||
protected $notify;
|
protected $notify;
|
||||||
|
|
||||||
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, IHandleUserSessions $session, App $app, App\Page $page, ContentItem $contentItem, Conversation $conversation, Notification $notification, Notify $notify, array $server, array $parameters = [])
|
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, IHandleUserSessions $session, AppHelper $appHelper, App\Page $page, ContentItem $contentItem, Conversation $conversation, Notification $notification, Notify $notify, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
|
@ -65,7 +66,7 @@ class Display extends BaseModule
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->pConfig = $pConfig;
|
$this->pConfig = $pConfig;
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
$this->contentItem = $contentItem;
|
$this->contentItem = $contentItem;
|
||||||
$this->conversation = $conversation;
|
$this->conversation = $conversation;
|
||||||
$this->notification = $notification;
|
$this->notification = $notification;
|
||||||
|
@ -176,12 +177,12 @@ class Display extends BaseModule
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->baseUrl->isLocalUrl($author['url'])) {
|
if ($this->baseUrl->isLocalUrl($author['url'])) {
|
||||||
Profile::load($this->app, $author['nick'], false);
|
Profile::load($this->appHelper, $author['nick'], false);
|
||||||
} else {
|
} else {
|
||||||
$this->page['aside'] = Widget\VCard::getHTML($author);
|
$this->page['aside'] = Widget\VCard::getHTML($author);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->app->setProfileOwner($item['uid']);
|
$this->appHelper->setProfileOwner($item['uid']);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getDisplayData(array $item, bool $update = false, int $updateUid = 0, bool $force = false): string
|
protected function getDisplayData(array $item, bool $update = false, int $updateUid = 0, bool $force = false): string
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Protocol;
|
use Friendica\Core\Protocol;
|
||||||
|
@ -35,8 +37,8 @@ use Psr\Log\LoggerInterface;
|
||||||
*/
|
*/
|
||||||
class Magic extends BaseModule
|
class Magic extends BaseModule
|
||||||
{
|
{
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
protected $app;
|
protected $appHelper;
|
||||||
/** @var Database */
|
/** @var Database */
|
||||||
protected $dba;
|
protected $dba;
|
||||||
/** @var ICanSendHttpRequests */
|
/** @var ICanSendHttpRequests */
|
||||||
|
@ -44,11 +46,11 @@ class Magic extends BaseModule
|
||||||
/** @var IHandleUserSessions */
|
/** @var IHandleUserSessions */
|
||||||
protected $userSession;
|
protected $userSession;
|
||||||
|
|
||||||
public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Database $dba, ICanSendHttpRequests $httpClient, IHandleUserSessions $userSession, $server, array $parameters = [])
|
public function __construct(AppHelper $appHelper, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Database $dba, ICanSendHttpRequests $httpClient, IHandleUserSessions $userSession, $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
$this->dba = $dba;
|
$this->dba = $dba;
|
||||||
$this->httpClient = $httpClient;
|
$this->httpClient = $httpClient;
|
||||||
$this->userSession = $userSession;
|
$this->userSession = $userSession;
|
||||||
|
@ -79,12 +81,12 @@ class Magic extends BaseModule
|
||||||
$contact = Contact::getByURL($addr ?: $dest);
|
$contact = Contact::getByURL($addr ?: $dest);
|
||||||
if ($contact === [] && $owa === 0) {
|
if ($contact === [] && $owa === 0) {
|
||||||
$this->logger->info('No contact record found, no oWA, redirecting to destination.', ['request' => $request, 'server' => $_SERVER, 'dest' => $dest]);
|
$this->logger->info('No contact record found, no oWA, redirecting to destination.', ['request' => $request, 'server' => $_SERVER, 'dest' => $dest]);
|
||||||
$this->app->redirect($dest);
|
$this->appHelper->redirect($dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($contact !== []) {
|
if ($contact !== []) {
|
||||||
// Redirect if the contact is already authenticated on this site.
|
// Redirect if the contact is already authenticated on this site.
|
||||||
if ($this->app->getContactId() && strpos($contact['nurl'], Strings::normaliseLink($this->baseUrl)) !== false) {
|
if ($this->appHelper->getContactId() && strpos($contact['nurl'], Strings::normaliseLink($this->baseUrl)) !== false) {
|
||||||
$this->logger->info('Contact is already authenticated, redirecting to destination.', ['dest' => $dest]);
|
$this->logger->info('Contact is already authenticated, redirecting to destination.', ['dest' => $dest]);
|
||||||
System::externalRedirect($dest);
|
System::externalRedirect($dest);
|
||||||
}
|
}
|
||||||
|
@ -94,7 +96,7 @@ class Magic extends BaseModule
|
||||||
|
|
||||||
if (!$this->userSession->getLocalUserId() || $owa === 0) {
|
if (!$this->userSession->getLocalUserId() || $owa === 0) {
|
||||||
$this->logger->notice('Not logged in or not OWA, redirecting to destination.', ['uid' => $this->userSession->getLocalUserId(), 'owa' => $owa, 'dest' => $dest]);
|
$this->logger->notice('Not logged in or not OWA, redirecting to destination.', ['uid' => $this->userSession->getLocalUserId(), 'owa' => $owa, 'dest' => $dest]);
|
||||||
$this->app->redirect($dest);
|
$this->appHelper->redirect($dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
$dest = Network::removeUrlParameter($dest, 'zid');
|
$dest = Network::removeUrlParameter($dest, 'zid');
|
||||||
|
@ -164,7 +166,7 @@ class Magic extends BaseModule
|
||||||
$j = json_decode($curlResult->getBodyString(), true);
|
$j = json_decode($curlResult->getBodyString(), true);
|
||||||
if (empty($j) || !$j['success']) {
|
if (empty($j) || !$j['success']) {
|
||||||
$this->logger->notice('Invalid JSON, redirecting to destination.', ['json' => $j, 'dest' => $dest]);
|
$this->logger->notice('Invalid JSON, redirecting to destination.', ['json' => $j, 'dest' => $dest]);
|
||||||
$this->app->redirect($dest);
|
$this->appHelper->redirect($dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($j['encrypted_token']) {
|
if ($j['encrypted_token']) {
|
||||||
|
|
|
@ -7,12 +7,13 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Media\Attachment;
|
namespace Friendica\Module\Media\Attachment;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
use Friendica\Core\System;
|
|
||||||
use Friendica\Model\Attach;
|
use Friendica\Model\Attach;
|
||||||
use Friendica\Module\Response;
|
use Friendica\Module\Response;
|
||||||
use Friendica\Network\HTTPException\UnauthorizedException;
|
use Friendica\Network\HTTPException\UnauthorizedException;
|
||||||
|
@ -27,15 +28,15 @@ class Browser extends BaseModule
|
||||||
{
|
{
|
||||||
/** @var IHandleUserSessions */
|
/** @var IHandleUserSessions */
|
||||||
protected $session;
|
protected $session;
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
protected $app;
|
protected $appHelper;
|
||||||
|
|
||||||
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, App $app, array $server, array $parameters = [])
|
public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, AppHelper $appHelper, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function content(array $request = []): string
|
protected function content(array $request = []): string
|
||||||
|
@ -47,7 +48,7 @@ class Browser extends BaseModule
|
||||||
// Needed to match the correct template in a module that uses a different theme than the user/site/default
|
// Needed to match the correct template in a module that uses a different theme than the user/site/default
|
||||||
$theme = Strings::sanitizeFilePathItem($request['theme'] ?? '');
|
$theme = Strings::sanitizeFilePathItem($request['theme'] ?? '');
|
||||||
if ($theme && is_file("view/theme/$theme/config.php")) {
|
if ($theme && is_file("view/theme/$theme/config.php")) {
|
||||||
$this->app->setCurrentTheme($theme);
|
$this->appHelper->setCurrentTheme($theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
$files = Attach::selectToArray(['id', 'filename', 'filetype'], ['uid' => $this->session->getLocalUserId()]);
|
$files = Attach::selectToArray(['id', 'filename', 'filetype'], ['uid' => $this->session->getLocalUserId()]);
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Media\Photo;
|
namespace Friendica\Module\Media\Photo;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
|
@ -28,15 +30,15 @@ class Browser extends BaseModule
|
||||||
{
|
{
|
||||||
/** @var IHandleUserSessions */
|
/** @var IHandleUserSessions */
|
||||||
protected $session;
|
protected $session;
|
||||||
/** @var App */
|
/** @var AppHelper */
|
||||||
protected $app;
|
protected $appHelper;
|
||||||
|
|
||||||
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, App $app, array $server, array $parameters = [])
|
public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, AppHelper $appHelper, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->session = $session;
|
$this->session = $session;
|
||||||
$this->app = $app;
|
$this->appHelper = $appHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function content(array $request = []): string
|
protected function content(array $request = []): string
|
||||||
|
@ -48,7 +50,7 @@ class Browser extends BaseModule
|
||||||
// Needed to match the correct template in a module that uses a different theme than the user/site/default
|
// Needed to match the correct template in a module that uses a different theme than the user/site/default
|
||||||
$theme = Strings::sanitizeFilePathItem($request['theme'] ?? '');
|
$theme = Strings::sanitizeFilePathItem($request['theme'] ?? '');
|
||||||
if ($theme && is_file("view/theme/$theme/config.php")) {
|
if ($theme && is_file("view/theme/$theme/config.php")) {
|
||||||
$this->app->setCurrentTheme($theme);
|
$this->appHelper->setCurrentTheme($theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
$album = $this->parameters['album'] ?? null;
|
$album = $this->parameters['album'] ?? null;
|
||||||
|
|
|
@ -7,13 +7,15 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Moderation;
|
namespace Friendica\Module\Moderation;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Page;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\Hook;
|
use Friendica\Core\Hook;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
use Friendica\Database\Database;
|
use Friendica\Database\Database;
|
||||||
use Friendica\DI;
|
|
||||||
use Friendica\Model\Register;
|
use Friendica\Model\Register;
|
||||||
use Friendica\Model\User;
|
use Friendica\Model\User;
|
||||||
use Friendica\Module\BaseModeration;
|
use Friendica\Module\BaseModeration;
|
||||||
|
@ -29,9 +31,9 @@ abstract class BaseUsers extends BaseModeration
|
||||||
/** @var Database */
|
/** @var Database */
|
||||||
protected $database;
|
protected $database;
|
||||||
|
|
||||||
public function __construct(Database $database, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
public function __construct(Database $database, Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->database = $database;
|
$this->database = $database;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Moderation\Blocklist;
|
namespace Friendica\Module\Moderation\Blocklist;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Page;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Content\Pager;
|
use Friendica\Content\Pager;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
|
@ -18,7 +21,6 @@ use Friendica\Model;
|
||||||
use Friendica\Module\BaseModeration;
|
use Friendica\Module\BaseModeration;
|
||||||
use Friendica\Module\Response;
|
use Friendica\Module\Response;
|
||||||
use Friendica\Navigation\SystemMessages;
|
use Friendica\Navigation\SystemMessages;
|
||||||
use Friendica\Util\Network;
|
|
||||||
use Friendica\Util\Profiler;
|
use Friendica\Util\Profiler;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
|
@ -27,9 +29,9 @@ class Contact extends BaseModeration
|
||||||
/** @var Database */
|
/** @var Database */
|
||||||
private $database;
|
private $database;
|
||||||
|
|
||||||
public function __construct(Database $database, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
public function __construct(Database $database, Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->database = $database;
|
$this->database = $database;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Moderation\Blocklist\Server;
|
namespace Friendica\Module\Moderation\Blocklist\Server;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Page;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Content\ContactSelector;
|
use Friendica\Content\ContactSelector;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
|
@ -29,7 +32,7 @@ class Add extends BaseModeration
|
||||||
/** @var DomainPatternBlocklist */
|
/** @var DomainPatternBlocklist */
|
||||||
private $blocklist;
|
private $blocklist;
|
||||||
|
|
||||||
public function __construct(DomainPatternBlocklist $blocklist, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
public function __construct(DomainPatternBlocklist $blocklist, Page $page, AppHelper $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Moderation\Blocklist\Server;
|
namespace Friendica\Module\Moderation\Blocklist\Server;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Page;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
|
@ -27,9 +30,9 @@ class Import extends \Friendica\Module\BaseModeration
|
||||||
/** @var array of blocked server domain patterns */
|
/** @var array of blocked server domain patterns */
|
||||||
private $blocklist = [];
|
private $blocklist = [];
|
||||||
|
|
||||||
public function __construct(DomainPatternBlocklist $localBlocklist, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
public function __construct(DomainPatternBlocklist $localBlocklist, Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->localBlocklist = $localBlocklist;
|
$this->localBlocklist = $localBlocklist;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Moderation\Blocklist\Server;
|
namespace Friendica\Module\Moderation\Blocklist\Server;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Page;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
|
@ -24,9 +27,9 @@ class Index extends BaseModeration
|
||||||
/** @var DomainPatternBlocklist */
|
/** @var DomainPatternBlocklist */
|
||||||
private $blocklist;
|
private $blocklist;
|
||||||
|
|
||||||
public function __construct(DomainPatternBlocklist $blocklist, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
public function __construct(DomainPatternBlocklist $blocklist, Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->blocklist = $blocklist;
|
$this->blocklist = $blocklist;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Moderation\Item;
|
namespace Friendica\Module\Moderation\Item;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Page;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
|
@ -24,9 +27,9 @@ class Source extends BaseModeration
|
||||||
/** @var IManageConfigValues */
|
/** @var IManageConfigValues */
|
||||||
private $config;
|
private $config;
|
||||||
|
|
||||||
public function __construct(IManageConfigValues $config, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
public function __construct(IManageConfigValues $config, Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Moderation;
|
namespace Friendica\Module\Moderation;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Page;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Content\Pager;
|
use Friendica\Content\Pager;
|
||||||
use Friendica\Content\Text\BBCode;
|
use Friendica\Content\Text\BBCode;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
|
@ -27,9 +30,9 @@ class Reports extends BaseModeration
|
||||||
/** @var Database */
|
/** @var Database */
|
||||||
private $database;
|
private $database;
|
||||||
|
|
||||||
public function __construct(Database $database, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
public function __construct(Database $database, Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->database = $database;
|
$this->database = $database;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
|
|
||||||
namespace Friendica\Module\Moderation;
|
namespace Friendica\Module\Moderation;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
|
use Friendica\App\Page;
|
||||||
|
use Friendica\AppHelper;
|
||||||
use Friendica\Core\L10n;
|
use Friendica\Core\L10n;
|
||||||
use Friendica\Core\Renderer;
|
use Friendica\Core\Renderer;
|
||||||
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
use Friendica\Core\Session\Capability\IHandleUserSessions;
|
||||||
|
@ -24,9 +27,9 @@ class Summary extends BaseModeration
|
||||||
/** @var Database */
|
/** @var Database */
|
||||||
private $database;
|
private $database;
|
||||||
|
|
||||||
public function __construct(Database $database, App\Page $page, App $app, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
public function __construct(Database $database, Page $page, AppHelper $appHelper, SystemMessages $systemMessages, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($page, $app, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($page, $appHelper, $systemMessages, $session, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
$this->database = $database;
|
$this->database = $database;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Capabilities\ICanCreateResponses;
|
use Friendica\Capabilities\ICanCreateResponses;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
|
@ -25,7 +27,7 @@ class NodeInfo110 extends BaseModule
|
||||||
/** @var IManageConfigValues */
|
/** @var IManageConfigValues */
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
|
public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Capabilities\ICanCreateResponses;
|
use Friendica\Capabilities\ICanCreateResponses;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
|
@ -25,7 +27,7 @@ class NodeInfo120 extends BaseModule
|
||||||
/** @var IManageConfigValues */
|
/** @var IManageConfigValues */
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
|
public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Capabilities\ICanCreateResponses;
|
use Friendica\Capabilities\ICanCreateResponses;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
|
@ -25,7 +27,7 @@ class NodeInfo121 extends BaseModule
|
||||||
/** @var IManageConfigValues */
|
/** @var IManageConfigValues */
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
|
public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Capabilities\ICanCreateResponses;
|
use Friendica\Capabilities\ICanCreateResponses;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
|
@ -25,7 +27,7 @@ class NodeInfo122 extends BaseModule
|
||||||
/** @var IManageConfigValues */
|
/** @var IManageConfigValues */
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
|
public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
namespace Friendica\Module;
|
namespace Friendica\Module;
|
||||||
|
|
||||||
use Friendica\App;
|
use Friendica\App;
|
||||||
|
use Friendica\App\Arguments;
|
||||||
|
use Friendica\App\BaseURL;
|
||||||
use Friendica\BaseModule;
|
use Friendica\BaseModule;
|
||||||
use Friendica\Capabilities\ICanCreateResponses;
|
use Friendica\Capabilities\ICanCreateResponses;
|
||||||
use Friendica\Core\Config\Capability\IManageConfigValues;
|
use Friendica\Core\Config\Capability\IManageConfigValues;
|
||||||
|
@ -25,7 +27,7 @@ class NodeInfo210 extends BaseModule
|
||||||
/** @var IManageConfigValues */
|
/** @var IManageConfigValues */
|
||||||
protected $config;
|
protected $config;
|
||||||
|
|
||||||
public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
|
public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = [])
|
||||||
{
|
{
|
||||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue