1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-06 00:27:27 +02:00

refactor: inject the action params via its execute method (#2907)

This commit is contained in:
Dag
2022-07-08 21:06:14 +02:00
committed by GitHub
parent 22c10941dc
commit a966213cd7
7 changed files with 32 additions and 35 deletions

View File

@@ -8,18 +8,18 @@ rss-bridge from the command line
*/
if (isset($argv)) {
parse_str(implode('&', array_slice($argv, 1)), $cliArgs);
$params = array_merge($_GET, $cliArgs);
$request = array_merge($_GET, $cliArgs);
} else {
$params = $_GET;
$request = $_GET;
}
try {
$actionFactory = new ActionFactory();
if (array_key_exists('action', $params)) {
$action = $actionFactory->create($params['action']);
$action->userData = $params;
$action->execute();
if (array_key_exists('action', $request)) {
$action = $actionFactory->create($request['action']);
$action->execute($request);
} else {
$showInactive = filter_input(INPUT_GET, 'show_inactive', FILTER_VALIDATE_BOOLEAN);
echo BridgeList::create($showInactive);