return $this->config->getCache();
}
+ /**
+ * Returns the current config of this node
+ *
+ * @return Configuration
+ */
+ public function getConfig()
+ {
+ return $this->config;
+ }
+
/**
* The basepath of this app
*
$this->profiler = $profiler;
$this->logger = $logger;
- $this->checkBackend($isBackend);
$this->checkFriendicaApp();
$this->profiler->reset();
$this->module = 'home';
}
+ $this->isBackend = $isBackend || $this->checkBackend($this->module);
+
// Detect mobile devices
$mobile_detect = new MobileDetect();
* This isn't a perfect solution. But we need this check very early.
* So we cannot wait until the modules are loaded.
*
- * @param string $backend true, if the backend flag was set during App initialization
- *
+ * @param string $module
+ * @return bool
*/
- private function checkBackend($backend) {
+ private function checkBackend($module) {
static $backends = [
'_well_known',
'api',
'dfrn_notify',
+ 'feed',
'fetch',
+ 'followers',
+ 'following',
'hcard',
'hostxrd',
+ 'inbox',
'manifest',
'nodeinfo',
'noscrape',
- 'p',
+ 'objects',
+ 'outbox',
'poco',
'post',
'proxy',
];
// Check if current module is in backend or backend flag is set
- $this->isBackend = (in_array($this->module, $backends) || $backend || $this->isBackend);
+ return in_array($module, $backends);
}
/**
header($_SERVER["SERVER_PROTOCOL"] . ' 403 ' . Core\L10n::t('Permission denied.'));
}
- // Report anything which needs to be communicated in the notification area (before the main body)
- Core\Hook::callAll('page_end', $this->page['content']);
+ if (!$this->isAjax()) {
+ Core\Hook::callAll('page_end', $this->page['content']);
+ }
// Add the navigation (menu) template
if ($this->module != 'install' && $this->module != 'maintenance') {