mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-09 06:24:27 +02:00
Make BaseModule
a real entity
- Add all dependencies, necessary to run the content (baseUrl, Arguments) - Encapsulate all POST/GET/DELETE/PATCH/PUT methods as protected methods inside the BaseModule - Return Module content ONLY per `BaseModule::run()` (including the Hook logic there as well)
This commit is contained in:
parent
238613fd01
commit
8bdd90066f
252 changed files with 615 additions and 623 deletions
|
@ -31,6 +31,7 @@ use Friendica\Model\User;
|
|||
use Friendica\Network\HTTPClient\Capability\ICanSendHttpRequests;
|
||||
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
|
||||
use Friendica\Util\HTTPSignature;
|
||||
use Friendica\Util\Profiler;
|
||||
use Friendica\Util\Strings;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
|
@ -43,26 +44,21 @@ class Magic extends BaseModule
|
|||
{
|
||||
/** @var App */
|
||||
protected $app;
|
||||
/** @var LoggerInterface */
|
||||
protected $logger;
|
||||
/** @var Database */
|
||||
protected $dba;
|
||||
/** @var ICanSendHttpRequests */
|
||||
protected $httpClient;
|
||||
protected $baseUrl;
|
||||
|
||||
public function __construct(App $app, App\BaseURL $baseUrl, LoggerInterface $logger, Database $dba, ICanSendHttpRequests $httpClient, L10n $l10n, array $parameters = [])
|
||||
public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Database $dba, ICanSendHttpRequests $httpClient, array $server, array $parameters = [])
|
||||
{
|
||||
parent::__construct($l10n, $parameters);
|
||||
parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $server, $parameters);
|
||||
|
||||
$this->app = $app;
|
||||
$this->logger = $logger;
|
||||
$this->dba = $dba;
|
||||
$this->httpClient = $httpClient;
|
||||
$this->baseUrl = $baseUrl;
|
||||
}
|
||||
|
||||
public function rawContent()
|
||||
protected function rawContent(array $request = [])
|
||||
{
|
||||
$this->logger->info('magic module: invoked');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue