asdasd
All checks were successful
Deploy / deploy-staging (push) Successful in 25s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-06-25 00:17:31 +02:00
parent 46111d8988
commit ac2d95fc56
140 changed files with 1168 additions and 1984 deletions

View File

@@ -0,0 +1,42 @@
<?php
declare(strict_types=1);
spl_autoload_register(static function (string $class): void {
$prefix = 'Modules\\FxRates\\';
if (!str_starts_with($class, $prefix)) {
return;
}
$relative = substr($class, strlen($prefix));
$path = __DIR__ . '/src/' . str_replace('\\', '/', $relative) . '.php';
if (is_file($path)) {
require_once $path;
}
});
$moduleName = 'fx-rates';
$moduleBasePath = __DIR__;
if (method_exists(modules(), 'registerFunction')) {
modules()->registerFunction($moduleName, 'service', static function () use ($moduleBasePath): \Modules\FxRates\Domain\FxRatesService {
static $service = null;
if ($service instanceof \Modules\FxRates\Domain\FxRatesService) {
return $service;
}
$moduleConfig = \Modules\FxRates\Infrastructure\ModuleConfig::load($moduleBasePath);
$settingsStore = new \Modules\FxRates\Infrastructure\SettingsStore($moduleConfig);
$settings = $settingsStore->load();
$pdo = \Modules\FxRates\Infrastructure\ConnectionFactory::make($settingsStore);
$repository = new \Modules\FxRates\Infrastructure\FxRatesRepository(
$pdo,
$moduleConfig->tablePrefix()
);
$repository->ensureSchema();
$service = new \Modules\FxRates\Domain\FxRatesService($repository, $settings);
return $service;
});
}