FX Modul
This commit is contained in:
@@ -224,6 +224,13 @@ $mm->registerFunction($moduleName, 'ensure_schema', function () use ($moduleName
|
||||
});
|
||||
|
||||
$mm->registerFunction($moduleName, 'fx_service', static function (): ?object {
|
||||
if (modules()->isEnabled('fx-rates') && modules()->hasFunction('fx-rates', 'service')) {
|
||||
try {
|
||||
return module_fn('fx-rates', 'service');
|
||||
} catch (\Throwable) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_dir(dirname(__DIR__) . '/mining-checker')) {
|
||||
return null;
|
||||
}
|
||||
@@ -256,7 +263,7 @@ $mm->registerFunction($moduleName, 'fx_refresh', static function (string $baseCu
|
||||
if (!$service || !method_exists($service, 'ensureFreshLatestRates')) {
|
||||
return [
|
||||
'ok' => false,
|
||||
'message' => 'Mining-Checker FX-Service ist aktuell nicht verfuegbar.',
|
||||
'message' => 'FX-Service ist aktuell nicht verfuegbar.',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -266,7 +273,7 @@ $mm->registerFunction($moduleName, 'fx_refresh', static function (string $baseCu
|
||||
'ok' => true,
|
||||
'message' => !empty($result['reused'])
|
||||
? 'Vorhandene FX-Daten weiterverwendet.'
|
||||
: 'FX-Daten aus dem Mining-Checker aktualisiert.',
|
||||
: 'FX-Daten aktualisiert.',
|
||||
'result' => $result,
|
||||
];
|
||||
} catch (\Throwable $e) {
|
||||
|
||||
Reference in New Issue
Block a user