Разделение по отдельным репозиториям

This commit is contained in:
2025-03-03 16:31:32 +08:00
commit a1f5154ce8
44 changed files with 4362 additions and 0 deletions

18
config/app.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
return [
'base_url' => env('APP_URL', 'http://localhost:8080'),
'debug' => bool(env('APP_DEBUG', false)),
'env' => env('APP_ENV', env('IPTV_ENV', 'prod')),
'title' => env('APP_TITLE', 'IPTV Плейлисты'),
'user_agent' => env('USER_AGENT'),
'page_size' => (int)env('PAGE_SIZE', 10),
'pls_encodings' => [
'UTF-8',
'CP1251',
// 'CP866',
// 'ISO-8859-5',
],
];

11
config/redis.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
return [
'host' => env('REDIS_HOST', 'keydb'),
'port' => (int)env('REDIS_PORT', 6379),
'password' => env('REDIS_PASSWORD'),
'db' => (int)env('REDIS_DB', 0),
'ttl_days' => (int)env('REDIS_TTL_DAYS', 14) * 60 * 60 * 24, // 2 недели
];

52
config/routes.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
use App\Controllers\ApiController;
use App\Controllers\BasicController;
use App\Controllers\WebController;
return [
[
'method' => 'GET',
'path' => '/[page/{page:[0-9]+}]',
'handler' => [WebController::class, 'home'],
'name' => 'home',
],
[
'method' => 'GET',
'path' => '/faq',
'handler' => [WebController::class, 'faq'],
'name' => 'faq',
],
[
'method' => 'GET',
'path' => '/logo',
'handler' => [WebController::class, 'logo'],
'name' => 'logo',
],
[
'method' => 'GET',
'path' => '/{code:[0-9a-zA-Z]+}',
'handler' => [WebController::class, 'redirect'],
'name' => 'redirect',
],
[
'method' => 'GET',
'path' => '/{code:[0-9a-zA-Z]+}/details',
'handler' => [WebController::class, 'details'],
'name' => 'details',
],
[
'method' => 'GET',
'path' => '/{code:[0-9a-zA-Z]+}/json',
'handler' => [ApiController::class, 'json'],
'name' => 'json',
],
[
'method' => '*',
'path' => '/{path:.*}',
'handler' => [BasicController::class, 'notFound'],
'name' => 'not-found',
],
// ...
];

8
config/twig.php Normal file
View File

@@ -0,0 +1,8 @@
<?php
declare(strict_types=1);
return [
'cache' => bool(env('TWIG_USE_CACHE', true)) ? cache_path() . '/views' : false,
'debug' => bool(env('TWIG_DEBUG', false)),
];