use DOMXPath;
use Exception;
use Friendica\App\Arguments;
-use Friendica\App\Module;
use Friendica\Core\Config\Cache\ConfigCache;
use Friendica\Core\Config\Configuration;
use Friendica\Core\Config\PConfiguration;
*/
private $baseURL;
- /**
- * @var bool true, if the call is from an backend node (f.e. worker)
- */
- private $isBackend;
-
/**
* @var string The name of the current theme
*/
*/
private $args;
- /**
- * @var App\Module
- */
- private $moduleClass;
-
/**
* Returns the current config cache of this node
*
*
* @throws Exception if the Basepath is not usable
*/
- public function __construct(Database $database, Configuration $config, App\Mode $mode, App\Router $router, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args, Module $module)
+ public function __construct(Database $database, Configuration $config, App\Mode $mode, App\Router $router, BaseURL $baseURL, LoggerInterface $logger, Profiler $profiler, L10n $l10n, Arguments $args)
{
$this->database = $database;
$this->config = $config;
$this->logger = $logger;
$this->l10n = $l10n;
$this->args = $args;
- $this->isBackend = $this->checkBackend($module);
$this->profiler->reset();
$this->getBaseURL();
}
- /**
- * Checks if the site is called via a backend process
- *
- * @param Module $module The pre-loaded module (just name, not class!)
-
- * @return bool True, if the call is a backend call
- */
- private function checkBackend(Module $module)
- {
- return basename(($_SERVER['PHP_SELF'] ?? ''), '.php') !== 'index' ||
- $module->isBackend();
- }
-
/**
* Returns true, if the call is from a backend node (f.e. from a worker)
*
* @return bool Is it a known backend?
+ *
+ * @deprecated 2019.09 - use App\Mode->isBackend() instead
+ * @see App\Mode::isBackend()
*/
public function isBackend()
{
- return $this->isBackend;
+ return $this->mode->isBackend();
}
/**