mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-20 07:11:43 +02:00
refactor: less reliance on super globals (#4228)
This commit is contained in:
10
index.php
10
index.php
@@ -76,9 +76,17 @@ $httpClient = new CurlHttpClient();
|
||||
|
||||
date_default_timezone_set(Configuration::getConfig('system', 'timezone'));
|
||||
|
||||
$argv = $argv ?? null;
|
||||
if ($argv) {
|
||||
parse_str(implode('&', array_slice($argv, 1)), $cliArgs);
|
||||
$request = Request::fromCli($cliArgs);
|
||||
} else {
|
||||
$request = Request::fromGlobals();
|
||||
}
|
||||
|
||||
try {
|
||||
$rssBridge = new RssBridge($logger, $cache, $httpClient);
|
||||
$response = $rssBridge->main($argv ?? []);
|
||||
$response = $rssBridge->main($request);
|
||||
$response->send();
|
||||
} catch (\Throwable $e) {
|
||||
// Probably an exception inside an action
|
||||
|
Reference in New Issue
Block a user