Files
desktop/public/api/boersenchecker/index.php
Lars Gebhardt-Kusche ac2d95fc56
All checks were successful
Deploy / deploy-staging (push) Successful in 25s
Deploy / deploy-production (push) Has been skipped
asdasd
2026-06-25 00:17:31 +02:00

37 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
require_once dirname(__DIR__, 3) . '/src/App/bootstrap.php';
use App\AppPaths;
use App\CronAuth;
use ModulesCore\ModuleHttp;
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
$projectRoot = dirname(__DIR__, 3);
$requestUri = (string) ($_SERVER['REQUEST_URI'] ?? '');
$requestPath = (string) (parse_url($requestUri, PHP_URL_PATH) ?: '');
$prefix = '/api/boersenchecker/index.php/';
$relativePath = trim((string) ($_GET['path'] ?? ''), '/');
if ($relativePath === '') {
$relativePath = str_starts_with($requestPath, $prefix)
? substr($requestPath, strlen($prefix))
: ltrim((string) ($_SERVER['PATH_INFO'] ?? ''), '/');
}
$normalizedPath = strtolower(trim($relativePath, '/'));
$cronPaths = [
'v1/cron/refresh-quotes',
];
if (!(in_array($normalizedPath, $cronPaths, true) && CronAuth::isAuthorizedRequest($projectRoot))) {
ModuleHttp::requireDesktopAccess($projectRoot, true);
}
require AppPaths::customAppPath(dirname(__DIR__, 3), 'boersenchecker') . '/api/index.php';