mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-24 12:45:05 +02:00
Reformat codebase v4 (#2872)
Reformat code base to PSR12 Co-authored-by: rssbridge <noreply@github.com>
This commit is contained in:
parent
66568e3a39
commit
4f75591060
398 changed files with 58607 additions and 56442 deletions
38
index.php
38
index.php
|
@ -7,32 +7,32 @@ Move the CLI arguments to the $_GET array, in order to be able to use
|
|||
rss-bridge from the command line
|
||||
*/
|
||||
if (isset($argv)) {
|
||||
parse_str(implode('&', array_slice($argv, 1)), $cliArgs);
|
||||
$params = array_merge($_GET, $cliArgs);
|
||||
parse_str(implode('&', array_slice($argv, 1)), $cliArgs);
|
||||
$params = array_merge($_GET, $cliArgs);
|
||||
} else {
|
||||
$params = $_GET;
|
||||
$params = $_GET;
|
||||
}
|
||||
|
||||
try {
|
||||
$actionFac = new ActionFactory();
|
||||
$actionFac = new ActionFactory();
|
||||
|
||||
if (array_key_exists('action', $params)) {
|
||||
$action = $actionFac->create($params['action']);
|
||||
$action->userData = $params;
|
||||
$action->execute();
|
||||
} else {
|
||||
$showInactive = filter_input(INPUT_GET, 'show_inactive', FILTER_VALIDATE_BOOLEAN);
|
||||
echo BridgeList::create($showInactive);
|
||||
}
|
||||
if (array_key_exists('action', $params)) {
|
||||
$action = $actionFac->create($params['action']);
|
||||
$action->userData = $params;
|
||||
$action->execute();
|
||||
} else {
|
||||
$showInactive = filter_input(INPUT_GET, 'show_inactive', FILTER_VALIDATE_BOOLEAN);
|
||||
echo BridgeList::create($showInactive);
|
||||
}
|
||||
} catch (\Throwable $e) {
|
||||
error_log($e);
|
||||
error_log($e);
|
||||
|
||||
$code = $e->getCode();
|
||||
if ($code !== -1) {
|
||||
header('Content-Type: text/plain', true, $code);
|
||||
}
|
||||
$code = $e->getCode();
|
||||
if ($code !== -1) {
|
||||
header('Content-Type: text/plain', true, $code);
|
||||
}
|
||||
|
||||
$message = sprintf("Uncaught Exception %s: '%s'\n", get_class($e), $e->getMessage());
|
||||
$message = sprintf("Uncaught Exception %s: '%s'\n", get_class($e), $e->getMessage());
|
||||
|
||||
print $message;
|
||||
print $message;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue