Compare commits

..

2 Commits

Author SHA1 Message Date
66040d69db
use IRouteCollection for HttpResponse
All checks were successful
soko-web/pipeline/head This commit looks good
2024-10-18 18:18:13 +02:00
fc2de8e1ab
do not use $_ENV vars for mail template 2024-10-18 18:05:53 +02:00
2 changed files with 3 additions and 10 deletions

View File

@ -29,13 +29,6 @@ class Mail
{ {
$this->body = file_get_contents(ROOT . '/mail/' . $template . '.html'); $this->body = file_get_contents(ROOT . '/mail/' . $template . '.html');
$baseParameters = [
'APP_NAME' => $_ENV['APP_NAME'],
'BASE_URL' => $_ENV['APP_URL'],
];
$params = array_merge($baseParameters, $params);
foreach ($params as $key => $param) { foreach ($params as $key => $param) {
$this->body = str_replace('{{' . $key . '}}', $param, $this->body); $this->body = str_replace('{{' . $key . '}}', $param, $this->body);
} }

View File

@ -6,12 +6,12 @@ use SokoWeb\Interfaces\Response\IRedirect;
use SokoWeb\Interfaces\Response\IContent; use SokoWeb\Interfaces\Response\IContent;
use SokoWeb\Interfaces\Authentication\IAuthenticationRequired; use SokoWeb\Interfaces\Authentication\IAuthenticationRequired;
use SokoWeb\Interfaces\Authorization\ISecured; use SokoWeb\Interfaces\Authorization\ISecured;
use SokoWeb\Interfaces\Routing\IRouteCollection;
use SokoWeb\Interfaces\Database\IConnection; use SokoWeb\Interfaces\Database\IConnection;
use SokoWeb\Interfaces\Request\IRequest; use SokoWeb\Interfaces\Request\IRequest;
use SokoWeb\Response\Redirect; use SokoWeb\Response\Redirect;
use SokoWeb\Response\HtmlContent; use SokoWeb\Response\HtmlContent;
use SokoWeb\Response\JsonContent; use SokoWeb\Response\JsonContent;
use SokoWeb\Routing\RouteCollection;
class HttpResponse class HttpResponse
{ {
@ -19,7 +19,7 @@ class HttpResponse
private IConnection $dbConnection; private IConnection $dbConnection;
private RouteCollection $routeCollection; private IRouteCollection $routeCollection;
private array $appConfig; private array $appConfig;
@ -32,7 +32,7 @@ class HttpResponse
public function __construct( public function __construct(
IRequest $request, IRequest $request,
IConnection $dbConnection, IConnection $dbConnection,
RouteCollection $routeCollection, IRouteCollection $routeCollection,
array $appConfig, array $appConfig,
string $requestMethod, string $requestMethod,
string $requestUrl string $requestUrl