Merge pull request #12007 from annando/more-constants

The friendica constants have been moved to the app class
This commit is contained in:
Philipp 2022-10-17 14:27:59 +02:00 committed by GitHub
commit 8c084fedad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 57 additions and 47 deletions

View File

@ -29,10 +29,6 @@
use Friendica\Model\Contact; use Friendica\Model\Contact;
define('FRIENDICA_PLATFORM', 'Friendica');
define('FRIENDICA_CODENAME', 'Giant Rhubarb');
define('FRIENDICA_VERSION', '2022.12-dev');
/** /**
* Constant with a HTML line break. * Constant with a HTML line break.
* *

View File

@ -58,6 +58,10 @@ use Psr\Log\LoggerInterface;
*/ */
class App class App
{ {
const PLATFORM = 'Friendica';
const CODENAME = 'Giant Rhubarb';
const VERSION = '2022.12-dev';
// Allow themes to control internal parameters // Allow themes to control internal parameters
// by changing App values in theme.php // by changing App values in theme.php
private $theme_info = [ private $theme_info = [

View File

@ -202,7 +202,7 @@ class Page implements ArrayAccess
*/ */
public function registerStylesheet(string $path, string $media = 'screen') public function registerStylesheet(string $path, string $media = 'screen')
{ {
$path = Network::appendQueryParam($path, ['v' => FRIENDICA_VERSION]); $path = Network::appendQueryParam($path, ['v' => App::VERSION]);
if (mb_strpos($path, $this->basePath . DIRECTORY_SEPARATOR) === 0) { if (mb_strpos($path, $this->basePath . DIRECTORY_SEPARATOR) === 0) {
$path = mb_substr($path, mb_strlen($this->basePath . DIRECTORY_SEPARATOR)); $path = mb_substr($path, mb_strlen($this->basePath . DIRECTORY_SEPARATOR));
@ -277,7 +277,7 @@ class Page implements ArrayAccess
*/ */
$this->page['htmlhead'] = Renderer::replaceMacros($tpl, [ $this->page['htmlhead'] = Renderer::replaceMacros($tpl, [
'$local_user' => local_user(), '$local_user' => local_user(),
'$generator' => 'Friendica' . ' ' . FRIENDICA_VERSION, '$generator' => 'Friendica' . ' ' . App::VERSION,
'$delitem' => $l10n->t('Delete this item?'), '$delitem' => $l10n->t('Delete this item?'),
'$blockAuthor' => $l10n->t('Block this author? They won\'t be able to follow you nor see your public posts, and you won\'t be able to see their posts and their notifications.'), '$blockAuthor' => $l10n->t('Block this author? They won\'t be able to follow you nor see your public posts, and you won\'t be able to see their posts and their notifications.'),
'$update_interval' => $interval, '$update_interval' => $interval,
@ -395,7 +395,7 @@ class Page implements ArrayAccess
*/ */
public function registerFooterScript($path) public function registerFooterScript($path)
{ {
$path = Network::appendQueryParam($path, ['v' => FRIENDICA_VERSION]); $path = Network::appendQueryParam($path, ['v' => App::VERSION]);
$url = str_replace($this->basePath . DIRECTORY_SEPARATOR, '', $path); $url = str_replace($this->basePath . DIRECTORY_SEPARATOR, '', $path);
@ -543,7 +543,7 @@ class Page implements ArrayAccess
$page = $this->page; $page = $this->page;
header("X-Friendica-Version: " . FRIENDICA_VERSION); header("X-Friendica-Version: " . App::VERSION);
header("Content-type: text/html; charset=utf-8"); header("Content-type: text/html; charset=utf-8");
if ($config->get('system', 'hsts') && ($baseURL->getSSLPolicy() == BaseURL::SSL_POLICY_FULL)) { if ($config->get('system', 'hsts') && ($baseURL->getSSLPolicy() == BaseURL::SSL_POLICY_FULL)) {

View File

@ -23,6 +23,7 @@ namespace Friendica\Core;
use Dice\Dice; use Dice\Dice;
use Friendica; use Friendica;
use Friendica\App;
/** /**
* Description of Console * Description of Console
@ -133,7 +134,7 @@ HELP;
$command = null; $command = null;
if ($this->getOption('version')) { if ($this->getOption('version')) {
$this->out('Friendica Console version ' . FRIENDICA_VERSION); $this->out('Friendica Console version ' . App::VERSION);
return 0; return 0;
} elseif ((count($this->options) === 0 || $this->getOption($this->customHelpOptions) === true || $this->getOption($this->customHelpOptions) === 1) && count($this->args) === 0 } elseif ((count($this->options) === 0 || $this->getOption($this->customHelpOptions) === true || $this->getOption($this->customHelpOptions) === 1) && count($this->args) === 0

View File

@ -21,6 +21,7 @@
namespace Friendica\Module\Admin; namespace Friendica\Module\Admin;
use Friendica\App;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Database\DBA; use Friendica\Database\DBA;
@ -202,7 +203,7 @@ class Federation extends BaseAdmin
'$page' => DI::l10n()->t('Federation Statistics'), '$page' => DI::l10n()->t('Federation Statistics'),
'$intro' => $intro, '$intro' => $intro,
'$counts' => $counts, '$counts' => $counts,
'$version' => FRIENDICA_VERSION, '$version' => App::VERSION,
'$legendtext' => DI::l10n()->tt('Currently this node is aware of %2$s node (%3$s active users last month, %4$s active users last six months, %5$s registered users in total) from the following platforms:', 'Currently this node is aware of %2$s nodes (%3$s active users last month, %4$s active users last six months, %5$s registered users in total) from the following platforms:', $total, number_format($total), number_format($month), number_format($halfyear), number_format($users)), '$legendtext' => DI::l10n()->tt('Currently this node is aware of %2$s node (%3$s active users last month, %4$s active users last six months, %5$s registered users in total) from the following platforms:', 'Currently this node is aware of %2$s nodes (%3$s active users last month, %4$s active users last six months, %5$s registered users in total) from the following platforms:', $total, number_format($total), number_format($month), number_format($halfyear), number_format($users)),
]); ]);
} }

View File

@ -21,6 +21,7 @@
namespace Friendica\Module\Admin; namespace Friendica\Module\Admin;
use Friendica\App;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Config\ValueObject\Cache;
use Friendica\Core\Logger; use Friendica\Core\Logger;
@ -79,8 +80,8 @@ class Summary extends BaseAdmin
// the local version of Friendica. Check is opt-in, source may be stable or develop branch // the local version of Friendica. Check is opt-in, source may be stable or develop branch
if (DI::config()->get('system', 'check_new_version_url', 'none') != 'none') { if (DI::config()->get('system', 'check_new_version_url', 'none') != 'none') {
$gitversion = DI::config()->get('system', 'git_friendica_version'); $gitversion = DI::config()->get('system', 'git_friendica_version');
if (version_compare(FRIENDICA_VERSION, $gitversion) < 0) { if (version_compare(App::VERSION, $gitversion) < 0) {
$warningtext[] = DI::l10n()->t('There is a new version of Friendica available for download. Your current version is %1$s, upstream version is %2$s', FRIENDICA_VERSION, $gitversion); $warningtext[] = DI::l10n()->t('There is a new version of Friendica available for download. Your current version is %1$s, upstream version is %2$s', App::VERSION, $gitversion);
} }
} }
@ -236,9 +237,9 @@ class Summary extends BaseAdmin
'$users' => [DI::l10n()->t('Registered users'), $users], '$users' => [DI::l10n()->t('Registered users'), $users],
'$accounts' => $accounts, '$accounts' => $accounts,
'$pending' => [DI::l10n()->t('Pending registrations'), $pending], '$pending' => [DI::l10n()->t('Pending registrations'), $pending],
'$version' => [DI::l10n()->t('Version'), FRIENDICA_VERSION], '$version' => [DI::l10n()->t('Version'), App::VERSION],
'$platform' => FRIENDICA_PLATFORM, '$platform' => App::PLATFORM,
'$codename' => FRIENDICA_CODENAME, '$codename' => App::CODENAME,
'$build' => DI::config()->get('system', 'build'), '$build' => DI::config()->get('system', 'build'),
'$addons' => [DI::l10n()->t('Active addons'), Addon::getEnabledList()], '$addons' => [DI::l10n()->t('Active addons'), Addon::getEnabledList()],
'$serversettings' => $server_settings, '$serversettings' => $server_settings,

View File

@ -53,8 +53,8 @@ class Config extends BaseApi
'sslserver' => null, 'sslserver' => null,
'ssl' => DI::config()->get('system', 'ssl_policy') == App\BaseURL::SSL_POLICY_FULL ? 'always' : '0', 'ssl' => DI::config()->get('system', 'ssl_policy') == App\BaseURL::SSL_POLICY_FULL ? 'always' : '0',
'friendica' => [ 'friendica' => [
'FRIENDICA_PLATFORM' => FRIENDICA_PLATFORM, 'FRIENDICA_PLATFORM' => App::PLATFORM,
'FRIENDICA_VERSION' => FRIENDICA_VERSION, 'FRIENDICA_VERSION' => App::VERSION,
'DB_UPDATE_VERSION' => DB_UPDATE_VERSION, 'DB_UPDATE_VERSION' => DB_UPDATE_VERSION,
] ]
], ],

View File

@ -21,6 +21,7 @@
namespace Friendica\Module; namespace Friendica\Module;
use Friendica\App;
use Friendica\BaseModule; use Friendica\BaseModule;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Hook; use Friendica\Core\Hook;
@ -96,7 +97,7 @@ class Friendica extends BaseModule
return Renderer::replaceMacros($tpl, [ return Renderer::replaceMacros($tpl, [
'about' => DI::l10n()->t('This is Friendica, version %s that is running at the web location %s. The database version is %s, the post update version is %s.', 'about' => DI::l10n()->t('This is Friendica, version %s that is running at the web location %s. The database version is %s, the post update version is %s.',
'<strong>' . FRIENDICA_VERSION . '</strong>', '<strong>' . App::VERSION . '</strong>',
DI::baseUrl()->get(), DI::baseUrl()->get(),
'<strong>' . $config->get('system', 'build') . '/' . DB_UPDATE_VERSION . '</strong>', '<strong>' . $config->get('system', 'build') . '/' . DB_UPDATE_VERSION . '</strong>',
'<strong>' . $config->get('system', 'post_update_version') . '/' . PostUpdate::VERSION . '</strong>'), '<strong>' . $config->get('system', 'post_update_version') . '/' . PostUpdate::VERSION . '</strong>'),
@ -169,7 +170,7 @@ class Friendica extends BaseModule
} }
$data = [ $data = [
'version' => FRIENDICA_VERSION, 'version' => App::VERSION,
'url' => DI::baseUrl()->get(), 'url' => DI::baseUrl()->get(),
'addons' => $visible_addons, 'addons' => $visible_addons,
'locked_features' => $locked_features, 'locked_features' => $locked_features,
@ -178,7 +179,7 @@ class Friendica extends BaseModule
'register_policy' => $register_policy, 'register_policy' => $register_policy,
'admin' => $admin, 'admin' => $admin,
'site_name' => $config->get('config', 'sitename'), 'site_name' => $config->get('config', 'sitename'),
'platform' => strtolower(FRIENDICA_PLATFORM), 'platform' => strtolower(App::PLATFORM),
'info' => $config->get('config', 'info'), 'info' => $config->get('config', 'info'),
'no_scrape_url' => DI::baseUrl()->get() . '/noscrape', 'no_scrape_url' => DI::baseUrl()->get() . '/noscrape',
]; ];

View File

@ -53,7 +53,7 @@ class NodeInfo110 extends BaseModule
'version' => '1.0', 'version' => '1.0',
'software' => [ 'software' => [
'name' => 'friendica', 'name' => 'friendica',
'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, 'version' => App::VERSION . '-' . DB_UPDATE_VERSION,
], ],
'protocols' => [ 'protocols' => [
'inbound' => [ 'inbound' => [

View File

@ -53,7 +53,7 @@ class NodeInfo120 extends BaseModule
'version' => '2.0', 'version' => '2.0',
'software' => [ 'software' => [
'name' => 'friendica', 'name' => 'friendica',
'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, 'version' => App::VERSION . '-' . DB_UPDATE_VERSION,
], ],
'protocols' => ['dfrn', 'activitypub'], 'protocols' => ['dfrn', 'activitypub'],
'services' => Nodeinfo::getServices(), 'services' => Nodeinfo::getServices(),

View File

@ -55,7 +55,7 @@ class NodeInfo210 extends BaseModule
'baseUrl' => $this->baseUrl->get(), 'baseUrl' => $this->baseUrl->get(),
'name' => $this->config->get('config', 'sitename'), 'name' => $this->config->get('config', 'sitename'),
'software' => 'friendica', 'software' => 'friendica',
'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, 'version' => App::VERSION . '-' . DB_UPDATE_VERSION,
], ],
'organization' => Nodeinfo::getOrganization($this->config), 'organization' => Nodeinfo::getOrganization($this->config),
'protocols' => ['dfrn', 'activitypub'], 'protocols' => ['dfrn', 'activitypub'],

View File

@ -21,11 +21,11 @@
namespace Friendica\Module\Settings; namespace Friendica\Module\Settings;
use Friendica\App;
use Friendica\Core\Hook; use Friendica\Core\Hook;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Database\DBStructure;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\Item; use Friendica\Model\Item;
use Friendica\Model\Post; use Friendica\Model\Post;
@ -253,7 +253,7 @@ class UserExport extends BaseSettings
); );
$output = [ $output = [
'version' => FRIENDICA_VERSION, 'version' => App::VERSION,
'schema' => DB_UPDATE_VERSION, 'schema' => DB_UPDATE_VERSION,
'baseurl' => DI::baseUrl(), 'baseurl' => DI::baseUrl(),
'user' => $user, 'user' => $user,

View File

@ -69,8 +69,8 @@ class Statistics extends BaseModule
$statistics = array_merge([ $statistics = array_merge([
'name' => $this->config->get('config', 'sitename'), 'name' => $this->config->get('config', 'sitename'),
'network' => FRIENDICA_PLATFORM, 'network' => App::PLATFORM,
'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, 'version' => App::VERSION . '-' . DB_UPDATE_VERSION,
'registrations_open' => $registration_open, 'registrations_open' => $registration_open,
'total_users' => $this->config->get('nodeinfo', 'total_users'), 'total_users' => $this->config->get('nodeinfo', 'total_users'),
'active_users_halfyear' => $this->config->get('nodeinfo', 'active_users_halfyear'), 'active_users_halfyear' => $this->config->get('nodeinfo', 'active_users_halfyear'),

View File

@ -86,9 +86,9 @@ class HttpClient extends BaseFactory
$logger->notice('Curl redirect.', ['url' => $request->getUri(), 'to' => $uri, 'method' => $request->getMethod()]); $logger->notice('Curl redirect.', ['url' => $request->getUri(), 'to' => $uri, 'method' => $request->getMethod()]);
}; };
$userAgent = FRIENDICA_PLATFORM . " '" . $userAgent = App::PLATFORM . " '" .
FRIENDICA_CODENAME . "' " . App::CODENAME . "' " .
FRIENDICA_VERSION . '-' . App::VERSION . '-' .
DB_UPDATE_VERSION . '; ' . DB_UPDATE_VERSION . '; ' .
$this->baseUrl->get(); $this->baseUrl->get();

View File

@ -21,11 +21,11 @@
namespace Friendica\Object\Api\Mastodon; namespace Friendica\Object\Api\Mastodon;
use Friendica\App;
use Friendica\App\BaseURL; use Friendica\App\BaseURL;
use Friendica\BaseDataTransferObject; use Friendica\BaseDataTransferObject;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Database\Database; use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\DI; use Friendica\DI;
use Friendica\Model\User; use Friendica\Model\User;
use Friendica\Module\Register; use Friendica\Module\Register;
@ -87,7 +87,7 @@ class Instance extends BaseDataTransferObject
$this->title = $config->get('config', 'sitename'); $this->title = $config->get('config', 'sitename');
$this->short_description = $this->description = $config->get('config', 'info'); $this->short_description = $this->description = $config->get('config', 'info');
$this->email = $config->get('config', 'admin_email'); $this->email = $config->get('config', 'admin_email');
$this->version = '2.8.0 (compatible; Friendica ' . FRIENDICA_VERSION . ')'; $this->version = '2.8.0 (compatible; Friendica ' . App::VERSION . ')';
$this->urls = null; // Not supported $this->urls = null; // Not supported
$this->stats = new Stats($config, $database); $this->stats = new Stats($config, $database);
$this->thumbnail = $baseUrl->get() . ($config->get('system', 'shortcut_icon') ?? 'images/friendica-32.png'); $this->thumbnail = $baseUrl->get() . ($config->get('system', 'shortcut_icon') ?? 'images/friendica-32.png');

View File

@ -21,6 +21,7 @@
namespace Friendica\Protocol\ActivityPub; namespace Friendica\Protocol\ActivityPub;
use Friendica\App;
use Friendica\Content\Feature; use Friendica\Content\Feature;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\Cache\Enum\Duration; use Friendica\Core\Cache\Enum\Duration;
@ -416,7 +417,7 @@ class Transmitter
{ {
return [ return [
'type' => 'Service', 'type' => 'Service',
'name' => FRIENDICA_PLATFORM . " '" . FRIENDICA_CODENAME . "' " . FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, 'name' => App::PLATFORM . " '" . App::CODENAME . "' " . App::VERSION . '-' . DB_UPDATE_VERSION,
'url' => DI::baseUrl()->get() 'url' => DI::baseUrl()->get()
]; ];
} }

View File

@ -25,6 +25,7 @@ use DOMDocument;
use DOMElement; use DOMElement;
use DOMNode; use DOMNode;
use DOMXPath; use DOMXPath;
use Friendica\App;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Core\Logger; use Friendica\Core\Logger;
use Friendica\Core\Protocol; use Friendica\Core\Protocol;
@ -369,8 +370,8 @@ class DFRN
XML::addElement($doc, $root, 'id', DI::baseUrl() . '/profile/' . $owner['nick']); XML::addElement($doc, $root, 'id', DI::baseUrl() . '/profile/' . $owner['nick']);
XML::addElement($doc, $root, 'title', $owner['name']); XML::addElement($doc, $root, 'title', $owner['name']);
$attributes = ['uri' => 'https://friendi.ca', 'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION]; $attributes = ['uri' => 'https://friendi.ca', 'version' => App::VERSION . '-' . DB_UPDATE_VERSION];
XML::addElement($doc, $root, 'generator', FRIENDICA_PLATFORM, $attributes); XML::addElement($doc, $root, 'generator', App::PLATFORM, $attributes);
$attributes = ['rel' => 'license', 'href' => 'http://creativecommons.org/licenses/by/3.0/']; $attributes = ['rel' => 'license', 'href' => 'http://creativecommons.org/licenses/by/3.0/'];
XML::addElement($doc, $root, 'link', '', $attributes); XML::addElement($doc, $root, 'link', '', $attributes);

View File

@ -24,6 +24,7 @@ namespace Friendica\Protocol;
use DOMDocument; use DOMDocument;
use DOMElement; use DOMElement;
use DOMXPath; use DOMXPath;
use Friendica\App;
use Friendica\Content\PageInfo; use Friendica\Content\PageInfo;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML; use Friendica\Content\Text\HTML;
@ -1035,8 +1036,8 @@ class Feed
break; break;
} }
$attributes = ['uri' => 'https://friendi.ca', 'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION]; $attributes = ['uri' => 'https://friendi.ca', 'version' => App::VERSION . '-' . DB_UPDATE_VERSION];
XML::addElement($doc, $root, 'generator', FRIENDICA_PLATFORM, $attributes); XML::addElement($doc, $root, 'generator', App::PLATFORM, $attributes);
XML::addElement($doc, $root, 'id', DI::baseUrl() . '/profile/' . $owner['nick']); XML::addElement($doc, $root, 'id', DI::baseUrl() . '/profile/' . $owner['nick']);
XML::addElement($doc, $root, 'title', $title); XML::addElement($doc, $root, 'title', $title);
XML::addElement($doc, $root, 'subtitle', sprintf("Updates from %s on %s", $owner['name'], DI::config()->get('config', 'sitename'))); XML::addElement($doc, $root, 'subtitle', sprintf("Updates from %s on %s", $owner['name'], DI::config()->get('config', 'sitename')));

View File

@ -24,6 +24,7 @@ namespace Friendica\Protocol;
use DOMDocument; use DOMDocument;
use DOMElement; use DOMElement;
use DOMXPath; use DOMXPath;
use Friendica\App;
use Friendica\Content\Text\BBCode; use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML; use Friendica\Content\Text\HTML;
use Friendica\Core\Cache\Enum\Duration; use Friendica\Core\Cache\Enum\Duration;
@ -1061,9 +1062,9 @@ class OStatus
$attributes = [ $attributes = [
'uri' => 'https://friendi.ca', 'uri' => 'https://friendi.ca',
'version' => FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, 'version' => App::VERSION . '-' . DB_UPDATE_VERSION,
]; ];
XML::addElement($doc, $root, 'generator', FRIENDICA_PLATFORM, $attributes); XML::addElement($doc, $root, 'generator', App::PLATFORM, $attributes);
XML::addElement($doc, $root, 'id', DI::baseUrl() . '/profile/' . $owner['nick']); XML::addElement($doc, $root, 'id', DI::baseUrl() . '/profile/' . $owner['nick']);
XML::addElement($doc, $root, 'title', $title); XML::addElement($doc, $root, 'title', $title);
XML::addElement($doc, $root, 'subtitle', sprintf("Updates from %s on %s", $owner['name'], DI::config()->get('config', 'sitename'))); XML::addElement($doc, $root, 'subtitle', sprintf("Updates from %s on %s", $owner['name'], DI::config()->get('config', 'sitename')));

View File

@ -22,6 +22,7 @@
namespace Friendica\Util\EMailer; namespace Friendica\Util\EMailer;
use Exception; use Exception;
use Friendica\App;
use Friendica\App\BaseURL; use Friendica\App\BaseURL;
use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\L10n; use Friendica\Core\L10n;
@ -79,8 +80,8 @@ abstract class MailBuilder
$this->headers = [ $this->headers = [
'Precedence' => ['list'], 'Precedence' => ['list'],
'X-Friendica-Host' => [$hostname], 'X-Friendica-Host' => [$hostname],
'X-Friendica-Platform' => [FRIENDICA_PLATFORM], 'X-Friendica-Platform' => [App::PLATFORM],
'X-Friendica-Version' => [FRIENDICA_VERSION], 'X-Friendica-Version' => [App::VERSION],
'List-ID' => ['<notification.' . $hostname . '>'], 'List-ID' => ['<notification.' . $hostname . '>'],
'List-Archive' => ['<' . $baseUrl->get() . '/notifications/system>'], 'List-Archive' => ['<' . $baseUrl->get() . '/notifications/system>'],
]; ];
@ -257,7 +258,7 @@ abstract class MailBuilder
$tpl = Renderer::getMarkupTemplate('email/html.tpl'); $tpl = Renderer::getMarkupTemplate('email/html.tpl');
$msgHtml = Renderer::replaceMacros($tpl, [ $msgHtml = Renderer::replaceMacros($tpl, [
'$title' => $this->l10n->t('Friendica Notification'), '$title' => $this->l10n->t('Friendica Notification'),
'$product' => FRIENDICA_PLATFORM, '$product' => App::PLATFORM,
'$htmlversion' => $msgHtml, '$htmlversion' => $msgHtml,
'$sitename' => $this->config->get('config', 'sitename'), '$sitename' => $this->config->get('config', 'sitename'),
'$banner' => $this->config->get('system', 'email_banner', '$banner' => $this->config->get('system', 'email_banner',

View File

@ -22,6 +22,7 @@
namespace Friendica\Util\Writer; namespace Friendica\Util\Writer;
use Exception; use Exception;
use Friendica\App;
use Friendica\Database\Definition\DbaDefinition; use Friendica\Database\Definition\DbaDefinition;
/** /**
@ -41,7 +42,7 @@ class DbaDefinitionSqlWriter
public static function create(DbaDefinition $definition): string public static function create(DbaDefinition $definition): string
{ {
$sqlString = "-- ------------------------------------------\n"; $sqlString = "-- ------------------------------------------\n";
$sqlString .= "-- " . FRIENDICA_PLATFORM . " " . FRIENDICA_VERSION . " (" . FRIENDICA_CODENAME . ")\n"; $sqlString .= "-- " . App::PLATFORM . " " . App::VERSION . " (" . App::CODENAME . ")\n";
$sqlString .= "-- DB_UPDATE_VERSION " . DB_UPDATE_VERSION . "\n"; $sqlString .= "-- DB_UPDATE_VERSION " . DB_UPDATE_VERSION . "\n";
$sqlString .= "-- ------------------------------------------\n\n\n"; $sqlString .= "-- ------------------------------------------\n\n\n";

View File

@ -21,12 +21,12 @@
namespace Friendica\Test\src\Module; namespace Friendica\Test\src\Module;
use Friendica\App;
use Friendica\Capabilities\ICanCreateResponses; use Friendica\Capabilities\ICanCreateResponses;
use Friendica\DI; use Friendica\DI;
use Friendica\Module\NodeInfo110; use Friendica\Module\NodeInfo110;
use Friendica\Module\NodeInfo120; use Friendica\Module\NodeInfo120;
use Friendica\Module\NodeInfo210; use Friendica\Module\NodeInfo210;
use Friendica\Module\Response;
use Friendica\Test\FixtureTest; use Friendica\Test\FixtureTest;
class NodeInfoTest extends FixtureTest class NodeInfoTest extends FixtureTest
@ -44,7 +44,7 @@ class NodeInfoTest extends FixtureTest
self::assertEquals('1.0', $json->version); self::assertEquals('1.0', $json->version);
self::assertEquals('friendica', $json->software->name); self::assertEquals('friendica', $json->software->name);
self::assertEquals(FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, $json->software->version); self::assertEquals(App::VERSION . '-' . DB_UPDATE_VERSION, $json->software->version);
self::assertIsArray($json->protocols->inbound); self::assertIsArray($json->protocols->inbound);
self::assertIsArray($json->protocols->outbound); self::assertIsArray($json->protocols->outbound);
@ -65,7 +65,7 @@ class NodeInfoTest extends FixtureTest
self::assertEquals('2.0', $json->version); self::assertEquals('2.0', $json->version);
self::assertEquals('friendica', $json->software->name); self::assertEquals('friendica', $json->software->name);
self::assertEquals(FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, $json->software->version); self::assertEquals(App::VERSION . '-' . DB_UPDATE_VERSION, $json->software->version);
self::assertIsArray($json->protocols); self::assertIsArray($json->protocols);
self::assertIsArray($json->services->inbound); self::assertIsArray($json->services->inbound);
@ -85,7 +85,7 @@ class NodeInfoTest extends FixtureTest
self::assertEquals('1.0', $json->version); self::assertEquals('1.0', $json->version);
self::assertEquals('friendica', $json->server->software); self::assertEquals('friendica', $json->server->software);
self::assertEquals(FRIENDICA_VERSION . '-' . DB_UPDATE_VERSION, $json->server->version); self::assertEquals(App::VERSION . '-' . DB_UPDATE_VERSION, $json->server->version);
self::assertIsArray($json->protocols); self::assertIsArray($json->protocols);
self::assertIsArray($json->services->inbound); self::assertIsArray($json->services->inbound);