feat: wire file transport services

This commit is contained in:
Keith Solomon
2026-04-26 20:37:35 -05:00
parent 76b614e9e3
commit 90b56e13bb
4 changed files with 86 additions and 0 deletions
+34
View File
@@ -8,9 +8,13 @@
namespace WPContentSync;
use WPContentSync\Admin\AdminPage;
use WPContentSync\Admin\FileImportController;
use WPContentSync\Logging\LoggerInterface;
use WPContentSync\Logging\OptionLogger;
use WPContentSync\Package\PackageValidator;
use WPContentSync\Settings\SettingsRepository;
use WPContentSync\Transport\FileTransportInterface;
use WPContentSync\Transport\JsonFileTransport;
use WPContentSync\Url\MetadataUrlTransformer;
use WPContentSync\Url\UrlTransformer;
@@ -54,6 +58,32 @@ final class Plugin {
}
);
$container->factory(
PackageValidator::class,
static function (): PackageValidator {
return new PackageValidator();
}
);
$container->factory(
FileTransportInterface::class,
static function () use ( $container ): FileTransportInterface {
return new JsonFileTransport(
$container->get( PackageValidator::class )
);
}
);
$container->factory(
FileImportController::class,
static function () use ( $container ): FileImportController {
return new FileImportController(
$container->get( FileTransportInterface::class ),
$container->get( LoggerInterface::class )
);
}
);
$container->factory(
AdminPage::class,
static function () use ( $container ): AdminPage {
@@ -71,6 +101,10 @@ final class Plugin {
/** @var AdminPage $admin_page */
$admin_page = $this->container->get( AdminPage::class );
/** @var FileImportController $file_import_controller */
$file_import_controller = $this->container->get( FileImportController::class );
$admin_page->register();
$file_import_controller->register();
}
}