return $this->config->getCache();
}
- /**
- * Returns the current config of this node
- *
- * @return Configuration
- */
- public function getConfig()
- {
- return $this->config;
- }
-
/**
* The basepath of this app
*
*/
public static function getContactsFromGlobalDirectory($search, $type = self::TYPE_ALL, $page = 1)
{
- $config = DI::app()->getConfig();
- $server = $config->get('system', 'directory', self::DEFAULT_DIRECTORY);
+ $server = DI::config()->get('system', 'directory', self::DEFAULT_DIRECTORY);
$searchUrl = $server . '/search';
*/
public static function getContactsFromLocalDirectory($search, $type = self::TYPE_ALL, $start = 0, $itemPage = 80)
{
- $config = DI::app()->getConfig();
+ $config = DI::config();
$diaspora = $config->get('system', 'diaspora_enabled') ? Protocol::DIASPORA : Protocol::DFRN;
$ostatus = !$config->get('system', 'ostatus_disabled') ? Protocol::OSTATUS : Protocol::DFRN;
$args = ['no_cron' => !$do_cron];
$a = get_app();
- $process = new Core\Process($a->getLogger(), $a->getMode(), $a->getConfig(), $a->getBasePath());
+ $process = new Core\Process($a->getLogger(), $a->getMode(), DI::config(), $a->getBasePath());
$process->run($command, $args);
// after spawning we have to remove the flag.
public static function update()
{
$app = DI::app();
- $config = $app->getConfig();
+ $config = DI::config();
$logger = $app->getLogger();
// If the addon 'statistics_json' is enabled then disable it and activate nodeinfo.
$configCache = new Config\Cache\ConfigCache();
$configLoader->setupCache($configCache);
$confBasepath = $configCache->get('system', 'basepath');
- $currBasepath = $a->getConfig()->get('system', 'basepath');
+ $currBasepath = DI::config()->get('system', 'basepath');
if ($confBasepath !== $currBasepath || !is_dir($currBasepath)) {
if (is_dir($confBasepath) && Config::set('system', 'basepath', $confBasepath)) {
$a->getLogger()->info('Friendica\'s system.basepath was updated successfully.', [
public static function performContactSearch($search, $prefix = '')
{
$a = DI::app();
- $config = $a->getConfig();
+ $config = DI::config();
$type = Search::TYPE_ALL;
$_GET['mode'] = 'minimal';
$app = DI::app();
- $config = $app->getConfig();
+ $config = DI::config();
if (!local_user()) {
$output = '<h2>' . L10n::t('Login') . '</h2>';
public static function content(array $parameters = [])
{
$app = DI::app();
- $config = $app->getConfig();
+ $config = DI::config();
if (($config->get('system', 'block_public') && !Session::isAuthenticated()) ||
($config->get('system', 'block_local_dir') && !Session::isAuthenticated())) {
public static function content(array $parameters = [])
{
$app = DI::app();
- $config = $app->getConfig();
+ $config = DI::config();
$visibleAddonList = Addon::getVisibleList();
if (!empty($visibleAddonList)) {
return;
}
- $config = $app->getConfig();
+ $config = DI::config();
$register_policies = [
Register::CLOSED => 'REGISTER_CLOSED',
$filename = '';
$a = DI::app();
- $config = $a->getConfig();
+ $config = DI::config();
$lang = $config->get('system', 'language');
// @TODO: Replace with parameter from router
public static function content(array $parameters = [])
{
$app = DI::app();
- $config = $app->getConfig();
+ $config = DI::config();
// currently no returned data is used
$ret = [];
self::checkFormSecurityTokenRedirectOnError('/', 'send_invite');
$app = DI::app();
- $config = $app->getConfig();
+ $config = DI::config();
$max_invites = intval($config->get('system', 'max_invites'));
if (!$max_invites) {
}
$app = DI::app();
- $config = $app->getConfig();
+ $config = DI::config();
$inviteOnly = false;
{
public static function content(array $parameters = [])
{
- $config = DI::app()->getConfig();
-
- $reason = $config->get('system', 'maintenance_reason');
+ $reason = DI::config()->get('system', 'maintenance_reason');
if ((substr(Strings::normaliseLink($reason), 0, 7) === 'http://') ||
(substr(Strings::normaliseLink($reason), 0, 8) === 'https://')) {
{
public static function rawContent(array $parameters = [])
{
- $app = DI::app();
- $config = $app->getConfig();
+ $config = DI::config();
$tpl = Renderer::getMarkupTemplate('manifest.tpl');
namespace Friendica\Module;
-use Friendica\App;
use Friendica\BaseModule;
use Friendica\Core\Addon;
-use Friendica\Core\System;
use Friendica\DI;
/**
{
public static function rawContent(array $parameters = [])
{
- $app = DI::app();
-
if ($parameters['version'] == '1.0') {
- self::printNodeInfo1($app);
+ self::printNodeInfo1();
} elseif ($parameters['version'] == '2.0') {
- self::printNodeInfo2($app);
+ self::printNodeInfo2();
} else {
throw new \Friendica\Network\HTTPException\NotFoundException();
}
/**
* Return the supported services
*
- * @param App $app
- *
* @return array with supported services
*/
- private static function getUsage(App $app)
+ private static function getUsage()
{
- $config = $app->getConfig();
+ $config = DI::config();
$usage = [];
/**
* Return the supported services
*
- * @param App $app
- *
* @return array with supported services
*/
- private static function getServices(App $app)
+ private static function getServices()
{
$services = [
'inbound' => [],
/**
* Print the nodeinfo version 1
- *
- * @param App $app
*/
- private static function printNodeInfo1(App $app)
+ private static function printNodeInfo1()
{
- $config = $app->getConfig();
+ $config = DI::config();
$nodeinfo = [
'version' => '1.0',
$nodeinfo['protocols']['outbound'][] = 'gnusocial';
}
- $nodeinfo['usage'] = self::getUsage($app);
+ $nodeinfo['usage'] = self::getUsage();
- $nodeinfo['services'] = self::getServices($app);
+ $nodeinfo['services'] = self::getServices();
$nodeinfo['metadata']['protocols'] = $nodeinfo['protocols'];
$nodeinfo['metadata']['protocols']['outbound'][] = 'atom1.0';
/**
* Print the nodeinfo version 2
- *
- * @param App $app
*/
- private static function printNodeInfo2(App $app)
+ private static function printNodeInfo2()
{
- $config = $app->getConfig();
+ $config = DI::config();
$imap = (function_exists('imap_open') && !$config->get('system', 'imap_disabled') && !$config->get('system', 'dfrn_only'));
$nodeinfo['protocols'][] = 'ostatus';
}
- $nodeinfo['usage'] = self::getUsage($app);
+ $nodeinfo['usage'] = self::getUsage();
- $nodeinfo['services'] = self::getServices($app);
+ $nodeinfo['services'] = self::getServices();
if (Addon::isEnabled('twitter')) {
$nodeinfo['services']['inbound'][] = 'twitter';
$arr['blocked'] = $blocked;
$arr['verified'] = $verified;
- $arr['language'] = L10nClass::detectLanguage($_SERVER, $_GET, $a->getConfig()->get('system', 'language'));
+ $arr['language'] = L10nClass::detectLanguage($_SERVER, $_GET, DI::config()->get('system', 'language'));
try {
$result = Model\User::create($arr);
}
$reg = false;
- if ($register && intval($a->getConfig()->get('config', 'register_policy')) !== Register::CLOSED) {
+ if ($register && intval(DI::config()->get('config', 'register_policy')) !== Register::CLOSED) {
$reg = [
'title' => L10n::t('Create a New Account'),
'desc' => L10n::t('Register'),
use Friendica\BaseModule;
use Friendica\Core\Addon;
-use Friendica\Core\System;
use Friendica\DI;
+use Friendica\Network\HTTPException\NotFoundException;
class Statistics extends BaseModule
{
public static function init(array $parameters = [])
{
- $config = DI::app()->getConfig();
-
- if (!$config->get("system", "nodeinfo")) {
- throw new \Friendica\Network\HTTPException\NotFoundException();
+ if (!DI::config()->get("system", "nodeinfo")) {
+ throw new NotFoundException();
}
}
public static function rawContent(array $parameters = [])
{
- $config = DI::app()->getConfig();
+ $config = DI::config();
$logger = DI::app()->getLogger();
$registration_open =
{
public static function content(array $parameters = [])
{
- $config = DI::app()->getConfig();
+ $config = DI::config();
$mail_disabled = ((function_exists('imap_open') &&
(!$config->get('system', 'imap_disabled'))));
public static function rawContent(array $parameters = [])
{
$app = DI::app();
- $config = $app->getConfig();
+ $config = DI::config();
header('Content-type: text/xml');
public static function rawContent(array $parameters = [])
{
$app = DI::app();
- $config = $app->getConfig();
+ $config = DI::config();
$subscribe = $config->get('system', 'relay_subscribe', false);