importer general
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Modules\MiningChecker\Infrastructure\ConnectionFactory;
|
||||
use Modules\MiningChecker\Infrastructure\ModuleConfig;
|
||||
|
||||
spl_autoload_register(static function (string $class): void {
|
||||
$prefix = 'Modules\\MiningChecker\\';
|
||||
if (!str_starts_with($class, $prefix)) {
|
||||
@@ -14,3 +17,14 @@ spl_autoload_register(static function (string $class): void {
|
||||
require_once $file;
|
||||
}
|
||||
});
|
||||
|
||||
$mm = isset($modules) && $modules instanceof App\ModuleManager ? $modules : modules();
|
||||
$mm->registerFunction('mining-checker', 'sql_import_target', static function (): array {
|
||||
$moduleBasePath = __DIR__;
|
||||
$config = ModuleConfig::load($moduleBasePath);
|
||||
|
||||
return [
|
||||
'pdo' => ConnectionFactory::make($config),
|
||||
'label' => 'Mining-Checker Projekt-Datenbank',
|
||||
];
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user