The friendica constants have been moved to the app class

This commit is contained in:
Michael 2022-10-17 10:37:48 +00:00
parent 54951b7be6
commit 62a0d55fc8
22 changed files with 58 additions and 48 deletions

View file

@ -21,6 +21,7 @@
namespace Friendica\Module\Admin;
use Friendica\App;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
@ -202,7 +203,7 @@ class Federation extends BaseAdmin
'$page' => DI::l10n()->t('Federation Statistics'),
'$intro' => $intro,
'$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)),
]);
}

View file

@ -21,6 +21,7 @@
namespace Friendica\Module\Admin;
use Friendica\App;
use Friendica\Core\Addon;
use Friendica\Core\Config\ValueObject\Cache;
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
if (DI::config()->get('system', 'check_new_version_url', 'none') != 'none') {
$gitversion = DI::config()->get('system', 'git_friendica_version');
if (version_compare(FRIENDICA_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);
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', App::VERSION, $gitversion);
}
}
@ -236,9 +237,9 @@ class Summary extends BaseAdmin
'$users' => [DI::l10n()->t('Registered users'), $users],
'$accounts' => $accounts,
'$pending' => [DI::l10n()->t('Pending registrations'), $pending],
'$version' => [DI::l10n()->t('Version'), FRIENDICA_VERSION],
'$platform' => FRIENDICA_PLATFORM,
'$codename' => FRIENDICA_CODENAME,
'$version' => [DI::l10n()->t('Version'), App::VERSION],
'$platform' => App::PLATFORM,
'$codename' => App::CODENAME,
'$build' => DI::config()->get('system', 'build'),
'$addons' => [DI::l10n()->t('Active addons'), Addon::getEnabledList()],
'$serversettings' => $server_settings,

View file

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

View file

@ -21,6 +21,7 @@
namespace Friendica\Module;
use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\Addon;
use Friendica\Core\Hook;
@ -96,7 +97,7 @@ class Friendica extends BaseModule
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.',
'<strong>' . FRIENDICA_VERSION . '</strong>',
'<strong>' . App::VERSION . '</strong>',
DI::baseUrl()->get(),
'<strong>' . $config->get('system', 'build') . '/' . DB_UPDATE_VERSION . '</strong>',
'<strong>' . $config->get('system', 'post_update_version') . '/' . PostUpdate::VERSION . '</strong>'),
@ -169,7 +170,7 @@ class Friendica extends BaseModule
}
$data = [
'version' => FRIENDICA_VERSION,
'version' => App::VERSION,
'url' => DI::baseUrl()->get(),
'addons' => $visible_addons,
'locked_features' => $locked_features,
@ -178,7 +179,7 @@ class Friendica extends BaseModule
'register_policy' => $register_policy,
'admin' => $admin,
'site_name' => $config->get('config', 'sitename'),
'platform' => strtolower(FRIENDICA_PLATFORM),
'platform' => strtolower(App::PLATFORM),
'info' => $config->get('config', 'info'),
'no_scrape_url' => DI::baseUrl()->get() . '/noscrape',
];

View file

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

View file

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

View file

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

View file

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

View file

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