Backup #1421

ID1421
Dateipfad/var/www/dev.campus.systemische-tools.de/src/ServiceProvider/ContentServiceProvider.php
Version1
Typ modified
Größe4.8 KB
Hash2a78dd4c6584ef54cc4e1e5a73642fd9384e9d049cb0ee9ea60f9b2c4a2c489a
Datum2025-12-25 16:59:14
Geändert vonclaude-code-hook
GrundClaude Code Pre-Hook Backup vor Edit-Operation
Datei existiert Ja

Dateiinhalt

<?php

declare(strict_types=1);

// @responsibility: Register Content bounded context services in DI container

namespace ServiceProvider;

use Application\ContentCollectionService;
use Application\PipelineStepService;
use Domain\Repository\CollectionRepositoryInterface;
use Domain\Repository\ContentRepositoryInterface;
use Domain\Repository\DocumentRepositoryInterface;
use Domain\Repository\ChunkRepositoryInterface;
use Domain\Repository\EntityRepositoryInterface;
use Domain\Repository\OntologyRepositoryInterface;
use Domain\Repository\PipelineRepositoryInterface;
use Domain\Repository\RelationRepositoryInterface;
use Domain\Repository\SemanticSearchRepositoryInterface;
use Domain\Repository\TaxonomyRepositoryInterface;
use Framework\Container;
use Infrastructure\Docs\ChunkAnalysisService;
use Infrastructure\Docs\ChunkingService;
use Infrastructure\Docs\ChunkSearchService;
use Infrastructure\Docs\ChunkSyncService;
use Infrastructure\Docs\HybridSearchService;
use Infrastructure\Persistence\ChunkRepository;
use Infrastructure\Persistence\CollectionRepository;
use Infrastructure\Persistence\ContentRepository;
use Infrastructure\Persistence\DocumentRepository;
use Infrastructure\Persistence\EntityRepository;
use Infrastructure\Persistence\OntologyRepository;
use Infrastructure\Persistence\PipelineRepository;
use Infrastructure\Persistence\RelationRepository;
use Infrastructure\Persistence\SemanticSearchRepository;
use Infrastructure\Persistence\TaxonomyRepository;
use Infrastructure\Validation\CollectionValidator;

/**
 * ContentServiceProvider registers all content management services.
 */
final class ContentServiceProvider implements ServiceProviderInterface
{
    public function register(Container $container): void
    {
        // Repositories
        $container->set(CollectionRepository::class, fn (Container $c) => new CollectionRepository($c->get('pdo.dev'), $c->get('pdo.content')));
        $container->set(PipelineRepository::class, fn (Container $c) => new PipelineRepository($c->get('pdo.content')));
        $container->set(ContentRepository::class, fn (Container $c) => new ContentRepository($c->get('pdo.content')));
        $container->set(TaxonomyRepository::class, fn (Container $c) => new TaxonomyRepository($c->get('pdo.content')));
        $container->set(OntologyRepository::class, fn (Container $c) => new OntologyRepository($c->get('pdo.content')));
        $container->set(DocumentRepository::class, fn (Container $c) => new DocumentRepository($c->get('pdo.content')));
        $container->set(ChunkRepository::class, fn (Container $c) => new ChunkRepository($c->get('pdo.content')));
        $container->set(RelationRepository::class, fn (Container $c) => new RelationRepository($c->get('pdo.content')));
        $container->set(EntityRepository::class, fn (Container $c) => new EntityRepository($c->get('pdo.content')));
        $container->set(SemanticSearchRepository::class, fn (Container $c) => new SemanticSearchRepository($c->get('pdo.content')));

        // Interface aliases
        $container->set(CollectionRepositoryInterface::class, fn (Container $c) => $c->get(CollectionRepository::class));
        $container->set(PipelineRepositoryInterface::class, fn (Container $c) => $c->get(PipelineRepository::class));
        $container->set(ContentRepositoryInterface::class, fn (Container $c) => $c->get(ContentRepository::class));
        $container->set(TaxonomyRepositoryInterface::class, fn (Container $c) => $c->get(TaxonomyRepository::class));
        $container->set(OntologyRepositoryInterface::class, fn (Container $c) => $c->get(OntologyRepository::class));
        $container->set(DocumentRepositoryInterface::class, fn (Container $c) => $c->get(DocumentRepository::class));
        $container->set(ChunkRepositoryInterface::class, fn (Container $c) => $c->get(ChunkRepository::class));
        $container->set(RelationRepositoryInterface::class, fn (Container $c) => $c->get(RelationRepository::class));
        $container->set(EntityRepositoryInterface::class, fn (Container $c) => $c->get(EntityRepository::class));
        $container->set(SemanticSearchRepositoryInterface::class, fn (Container $c) => $c->get(SemanticSearchRepository::class));

        // Services
        $container->set(CollectionValidator::class, function (Container $c) {
            return new CollectionValidator($c->get(CollectionRepository::class));
        });

        $container->set(ContentCollectionService::class, function (Container $c) {
            return new ContentCollectionService(
                $c->get(CollectionRepository::class),
                $c->get(CollectionValidator::class)
            );
        });

        $container->set(PipelineStepService::class, function (Container $c) {
            return new PipelineStepService(
                $c->get(PipelineRepository::class),
                $c->get(\Infrastructure\AI\ModelRegistry::class)
            );
        });
    }
}

Vollständig herunterladen

Aktionen

Herunterladen

Andere Versionen dieser Datei

ID Version Typ Größe Datum
1803 22 modified 8.0 KB 2025-12-27 14:12
1802 21 modified 8.0 KB 2025-12-27 14:12
1801 20 modified 8.1 KB 2025-12-27 14:12
1800 19 modified 8.0 KB 2025-12-27 14:12
1799 18 modified 8.0 KB 2025-12-27 14:11
1798 17 modified 8.1 KB 2025-12-27 14:11
1797 16 modified 7.8 KB 2025-12-27 14:11
1796 15 modified 7.6 KB 2025-12-27 14:10
1795 14 modified 7.5 KB 2025-12-27 14:10
1794 13 modified 7.4 KB 2025-12-27 14:10
1600 12 modified 7.2 KB 2025-12-27 00:16
1599 11 modified 7.1 KB 2025-12-27 00:16
1598 10 modified 7.1 KB 2025-12-27 00:16
1597 9 modified 7.0 KB 2025-12-27 00:16
1455 8 modified 7.0 KB 2025-12-25 17:01
1450 7 modified 6.6 KB 2025-12-25 17:00
1449 6 modified 6.0 KB 2025-12-25 17:00
1448 5 modified 5.9 KB 2025-12-25 17:00
1447 4 modified 5.7 KB 2025-12-25 17:00
1431 3 modified 5.2 KB 2025-12-25 16:59
1424 2 modified 5.0 KB 2025-12-25 16:59
1421 1 modified 4.8 KB 2025-12-25 16:59

← Zurück zur Übersicht