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->appHelper->getBasePath() . DIRECTORY_SEPARATOR . 'include' . PATH_SEPARATOR
+ . $this->appHelper->getBasePath() . DIRECTORY_SEPARATOR . 'library' . PATH_SEPARATOR
+ . $this->appHelper->getBasePath());
$this->profiler->reset();
if ($this->mode->has(Mode::DBAVAILABLE)) {
Core\Hook::loadHooks();
- $loader = (new Config())->createConfigFileManager($this->getBasePath(), $_SERVER);
+ $loader = (new Config())->createConfigFileManager($this->appHelper->getBasePath(), $_SERVER);
Core\Hook::callAll('load_config', $loader);
// Hooks are now working, reload the whole definitions with hook enabled
if ($this->mode->isInstall() && $moduleName !== 'install') {
$this->baseURL->redirect('install');
} else {
- Core\Update::check($this->getBasePath(), false);
+ Core\Update::check($this->appHelper->getBasePath(), false);
Core\Addon::loadAddons();
Core\Hook::loadHooks();
}
use Friendica\App;
use Friendica\App\Mode;
+use Friendica\AppHelper;
use Friendica\Content\Text\BBCode;
use Friendica\Content\Widget\ContactBlock;
use Friendica\Core\Cache\Enum\Duration;
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
- public static function load(App $a, string $nickname, bool $show_contacts = true): array
+ public static function load(AppHelper $appHelper, string $nickname, bool $show_contacts = true): array
{
$profile = User::getOwnerDataByNick($nickname);
if (!isset($profile['account_removed']) || $profile['account_removed']) {
throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
}
- $a->setProfileOwner($profile['uid']);
+ $appHelper->setProfileOwner($profile['uid']);
DI::page()['title'] = $profile['name'] . ' @ ' . DI::config()->get('config', 'sitename');
if (!DI::userSession()->getLocalUserId()) {
- $a->setCurrentTheme($profile['theme']);
- $a->setCurrentMobileTheme(DI::pConfig()->get($a->getProfileOwner(), 'system', 'mobile_theme') ?? '');
+ $appHelper->setCurrentTheme($profile['theme']);
+ $appHelper->setCurrentMobileTheme(DI::pConfig()->get($appHelper->getProfileOwner(), 'system', 'mobile_theme') ?? '');
}
/*
Renderer::setActiveTemplateEngine(); // reset the template engine to the default in case the user's theme doesn't specify one
- $theme_info_file = 'view/theme/' . $a->getCurrentTheme() . '/theme.php';
+ $theme_info_file = 'view/theme/' . $appHelper->getCurrentTheme() . '/theme.php';
if (file_exists($theme_info_file)) {
require_once $theme_info_file;
}
namespace Friendica\Module\Item;
use Friendica\App;
+use Friendica\AppHelper;
use Friendica\BaseModule;
use Friendica\Content\Conversation;
use Friendica\Content\Item as ContentItem;
protected $pConfig;
/** @var IHandleUserSessions */
protected $session;
- /** @var App */
- protected $app;
+ /** @var AppHelper */
+ protected $appHelper;
/** @var ContentItem */
protected $contentItem;
/** @var Conversation */
/** @var Notify */
protected $notify;
- public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, IHandleUserSessions $session, App $app, App\Page $page, ContentItem $contentItem, Conversation $conversation, Notification $notification, Notify $notify, array $server, array $parameters = [])
+ public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, IManagePersonalConfigValues $pConfig, IHandleUserSessions $session, AppHelper $appHelper, App\Page $page, ContentItem $contentItem, Conversation $conversation, Notification $notification, Notify $notify, array $server, array $parameters = [])
{
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->config = $config;
$this->pConfig = $pConfig;
$this->session = $session;
- $this->app = $app;
+ $this->appHelper = $appHelper;
$this->contentItem = $contentItem;
$this->conversation = $conversation;
$this->notification = $notification;
}
if ($this->baseUrl->isLocalUrl($author['url'])) {
- Profile::load($this->app, $author['nick'], false);
+ Profile::load($this->appHelper, $author['nick'], false);
} else {
$this->page['aside'] = Widget\VCard::getHTML($author);
}
- $this->app->setProfileOwner($item['uid']);
+ $this->appHelper->setProfileOwner($item['uid']);
}
protected function getDisplayData(array $item, bool $update = false, int $updateUid = 0, bool $force = false): string
throw new HTTPException\NotFoundException($this->t('The requested item doesn\'t exist or has been deleted.'));
}
- $this->app->setProfileOwner($item['uid'] ?: $profileUid);
+ $this->appHelper->setProfileOwner($item['uid'] ?: $profileUid);
$parentUriId = $item['parent-uri-id'];
if (empty($force)) {
{
protected function rawContent(array $request = [])
{
- $a = DI::app();
+ $appHelper = DI::apphelper();
// Ensure we've got a profile owner if updating.
- $a->setProfileOwner((int)($request['p'] ?? 0));
+ $appHelper->setProfileOwner((int)($request['p'] ?? 0));
- if (DI::config()->get('system', 'block_public') && !DI::userSession()->getLocalUserId() && !DI::userSession()->getRemoteContactID($a->getProfileOwner())) {
+ if (DI::config()->get('system', 'block_public') && !DI::userSession()->getLocalUserId() && !DI::userSession()->getRemoteContactID($appHelper->getProfileOwner())) {
throw new ForbiddenException();
}
- $remote_contact = DI::userSession()->getRemoteContactID($a->getProfileOwner());
- $is_owner = DI::userSession()->getLocalUserId() == $a->getProfileOwner();
- $last_updated_key = "profile:" . $a->getProfileOwner() . ":" . DI::userSession()->getLocalUserId() . ":" . $remote_contact;
+ $remote_contact = DI::userSession()->getRemoteContactID($appHelper->getProfileOwner());
+ $is_owner = DI::userSession()->getLocalUserId() == $appHelper->getProfileOwner();
+ $last_updated_key = "profile:" . $appHelper->getProfileOwner() . ":" . DI::userSession()->getLocalUserId() . ":" . $remote_contact;
if (!DI::userSession()->isAuthenticated()) {
- $user = User::getById($a->getProfileOwner(), ['hidewall']);
+ $user = User::getById($appHelper->getProfileOwner(), ['hidewall']);
if ($user['hidewall']) {
throw new ForbiddenException(DI::l10n()->t('Access to this profile has been restricted.'));
}
}
// Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched their circles
- $sql_extra = Item::getPermissionsSQLByUserId($a->getProfileOwner());
+ $sql_extra = Item::getPermissionsSQLByUserId($appHelper->getProfileOwner());
$last_updated_array = DI::session()->get('last_updated', []);
$condition = ["`uid` = ? AND NOT `contact-blocked` AND NOT `contact-pending`
AND `visible` AND (NOT `deleted` OR `gravity` = ?)
- AND `wall` " . $sql_extra, $a->getProfileOwner(), Item::GRAVITY_ACTIVITY];
+ AND `wall` " . $sql_extra, $appHelper->getProfileOwner(), Item::GRAVITY_ACTIVITY];
if ($request['force'] && !empty($request['item'])) {
// When the parent is provided, we only fetch this
$last_updated_array[$last_updated_key] = time();
DI::session()->set('last_updated', $last_updated_array);
- if ($is_owner && !$a->getProfileOwner() && ProfileModel::shouldDisplayEventList(DI::userSession()->getLocalUserId(), DI::mode())) {
+ if ($is_owner && !$appHelper->getProfileOwner() && ProfileModel::shouldDisplayEventList(DI::userSession()->getLocalUserId(), DI::mode())) {
$o .= ProfileModel::getBirthdays(DI::userSession()->getLocalUserId());
$o .= ProfileModel::getEventsReminderHTML(DI::userSession()->getLocalUserId(), DI::userSession()->getPublicContactId());
}
}
}
- $o .= DI::conversation()->render($items, Conversation::MODE_PROFILE, $a->getProfileOwner(), false, 'received', $a->getProfileOwner());
+ $o .= DI::conversation()->render($items, Conversation::MODE_PROFILE, $appHelper->getProfileOwner(), false, 'received', $appHelper->getProfileOwner());
System::htmlUpdateExit($o);
}