Удалён мёртвый код

This commit is contained in:
2025-05-13 14:22:48 +08:00
parent 62d07ca2aa
commit f100d9ae72
8 changed files with 2 additions and 100 deletions

View File

@@ -10,9 +10,6 @@ APP_TITLE="IPTV Плейлисты"
APP_TIMEZONE=Europe/Moscow APP_TIMEZONE=Europe/Moscow
PAGE_SIZE=10 PAGE_SIZE=10
# config/http.php
USER_AGENT="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
# config/cache.php # config/cache.php
CACHE_HOST="keydb" CACHE_HOST="keydb"
CACHE_PORT=6379 CACHE_PORT=6379

View File

@@ -109,6 +109,7 @@ class WebController extends BasicController
* @throws LoaderError * @throws LoaderError
* @throws RuntimeError * @throws RuntimeError
* @throws SyntaxError * @throws SyntaxError
* @throws Exception
*/ */
public function details(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface public function details(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface
{ {

View File

@@ -17,11 +17,6 @@ use Exception;
*/ */
class IniFile class IniFile
{ {
/**
* @var array Считанное из файла содержимое ini-файла
*/
protected array $ini;
/** /**
* @var array[] Коллекция подгруженных плейлистов * @var array[] Коллекция подгруженных плейлистов
*/ */

View File

@@ -11,7 +11,6 @@ namespace App\Core;
use App\Core\TwigExtention as IptvTwigExtension; use App\Core\TwigExtention as IptvTwigExtension;
use Dotenv\Dotenv; use Dotenv\Dotenv;
use GuzzleHttp\Client;
use InvalidArgumentException; use InvalidArgumentException;
use Redis; use Redis;
use Slim\App; use Slim\App;
@@ -56,11 +55,6 @@ final class Kernel
*/ */
protected ?Redis $cache = null; protected ?Redis $cache = null;
/**
* @var Client|null
*/
protected ?Client $httpClient = null;
/** /**
* Закрытый конструктор * Закрытый конструктор
* *
@@ -198,16 +192,6 @@ final class Kernel
return $this->cache; return $this->cache;
} }
/**
* Возвращает объект http-клиента
*
* @return Client
*/
public function guzzle(): Client
{
return $this->httpClient ??= new Client($this->config['http']);
}
/** /**
* Возвращает значение из конфига * Возвращает значение из конфига
* *

View File

@@ -9,7 +9,6 @@ declare(strict_types=1);
namespace App\Core; namespace App\Core;
use Twig\Error\LoaderError;
use Twig\Extension\AbstractExtension; use Twig\Extension\AbstractExtension;
use Twig\TwigFunction; use Twig\TwigFunction;
@@ -20,6 +19,7 @@ class TwigExtention extends AbstractExtension
{ {
/** /**
* @inheritDoc * @inheritDoc
* @noinspection PhpUnused
*/ */
public function getFunctions(): array public function getFunctions(): array
{ {
@@ -38,7 +38,6 @@ class TwigExtention extends AbstractExtension
* @param string $key Ключ в формате "config.key" * @param string $key Ключ в формате "config.key"
* @param mixed|null $default Значение по умолчанию * @param mixed|null $default Значение по умолчанию
* @return mixed * @return mixed
* @throws LoaderError
*/ */
public function config(string $key, mixed $default = null): mixed public function config(string $key, mixed $default = null): mixed
{ {

View File

@@ -1,34 +0,0 @@
<?php
/*
* Copyright (c) 2025, Антон Аксенов
* This file is part of iptv.axenov.dev web interface
* MIT License: https://git.axenov.dev/IPTV/web/src/branch/master/LICENSE
*/
declare(strict_types=1);
namespace App\Middleware;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
/**
* Middleware для добавления запросу заголовка X-Request-ID
*/
class RequestId
{
/**
* Добавляет запросу заголовок X-Request-ID
*
* @param ServerRequestInterface $request
* @param RequestHandlerInterface $handler
* @return ResponseInterface
*/
public function __invoke(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$request = $request->withHeader('X-Request-ID', uniqid());
return $handler->handle($request);
}
}

View File

@@ -44,17 +44,6 @@ function cache_path(string $path = ''): string
return root_path("cache/$path"); return root_path("cache/$path");
} }
/**
* Returns path to app views
*
* @param string $path
* @return string
*/
function views_path(string $path = ''): string
{
return root_path("views/$path");
}
/** /**
* Returns base URL * Returns base URL
* *

View File

@@ -1,29 +0,0 @@
<?php
/*
* Copyright (c) 2025, Антон Аксенов
* This file is part of iptv.axenov.dev web interface
* MIT License: https://git.axenov.dev/IPTV/web/src/branch/master/LICENSE
*/
declare(strict_types=1);
/**
* @see https://docs.guzzlephp.org/en/stable/request-options.html
*/
return [
'base_url' => env('APP_URL', 'http://localhost:8080'),
'timeout' => 25,
'connect_timeout' => 7,
'http_errors' => true,
'synchronous' => false,
'headers' => [
'User-Agent' => env('USER_AGENT'),
],
'allow_redirects' => [
'max' => 5,
'strict' => false,
'referer' => false,
'protocols' => ['http', 'https'],
'track_redirects' => false
]
];