namespace Friendica\App;
use Friendica\App;
-use Friendica\BaseObject;
+use Friendica\BaseModule;
use Friendica\Core;
use Friendica\LegacyModule;
use Friendica\Module\Home;
private $module;
/**
- * @var BaseObject The module class
+ * @var BaseModule The module class
*/
private $module_class;
return $this->module_class;
}
+ /**
+ * @return array The module parameters extracted from the route
+ */
+ public function getParameters()
+ {
+ return $this->module_parameters;
+ }
+
/**
* @return bool True, if the current module is a backend module
* @see Module::BACKEND_MODULES for a list
*
* @param Arguments $args The Friendica execution arguments
* @param Router $router The Friendica routing instance
- * @param Core\Config\Configuration $config The Friendica Configuration
+ * @param Core\Config\IConfiguration $config The Friendica Configuration
*
* @return Module The determined module of this call
*
* @throws \Exception
*/
- public function determineClass(Arguments $args, Router $router, Core\Config\Configuration $config)
+ public function determineClass(Arguments $args, Router $router, Core\Config\IConfiguration $config)
{
$printNotAllowedAddon = false;
* Run the determined module class and calls all hooks applied to
*
* @param Core\L10n\L10n $l10n The L10n instance
- * @param App $app The whole Friendica app (for method arguments)
+ * @param App\BaseURL $baseUrl The Friendica Base URL
* @param LoggerInterface $logger The Friendica logger
* @param array $server The $_SERVER variable
* @param array $post The $_POST variables
*
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public function run(Core\L10n\L10n $l10n, App $app, LoggerInterface $logger, array $server, array $post)
+ public function run(Core\L10n\L10n $l10n, App\BaseURL $baseUrl, LoggerInterface $logger, array $server, array $post)
{
if ($this->printNotAllowedAddon) {
info($l10n->t("You must be logged in to use addons. "));
if (!empty($queryString) && ($queryString === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
$logger->info('index.php: dreamhost_error_hack invoked.', ['Original URI' => $server['REQUEST_URI']]);
- $app->internalRedirect($server['REQUEST_URI']);
+ $baseUrl->redirect($server['REQUEST_URI']);
}
$logger->debug('index.php: page not found.', ['request_uri' => $server['REQUEST_URI'], 'address' => $server['REMOTE_ADDR'], 'query' => $server['QUERY_STRING']]);
call_user_func([$this->module_class, 'init'], $this->module_parameters);
- // "rawContent" is especially meant for technical endpoints.
- // This endpoint doesn't need any theme initialization or other comparable stuff.
- call_user_func([$this->module_class, 'rawContent'], $this->module_parameters);
-
if ($server['REQUEST_METHOD'] === 'POST') {
Core\Hook::callAll($this->module . '_mod_post', $post);
call_user_func([$this->module_class, 'post'], $this->module_parameters);
Core\Hook::callAll($this->module . '_mod_afterpost', $placeholder);
call_user_func([$this->module_class, 'afterpost'], $this->module_parameters);
+
+ // "rawContent" is especially meant for technical endpoints.
+ // This endpoint doesn't need any theme initialization or other comparable stuff.
+ call_user_func([$this->module_class, 'rawContent'], $this->module_parameters);
}
}