Backup #850
| ID | 850 |
| Dateipfad | /var/www/dev.campus.systemische-tools.de/src/services.php |
| Version | 15 |
| Typ |
modified |
| Größe | 12.3 KB |
| Hash | eb2c99d93bf14efd6c47ef1ecd11ed3a2caca0cbd93da5ce18e4cd7ccc65da30 |
| Datum | 2025-12-23 08:30:48 |
| Geändert von | claude-code-hook |
| Grund | Claude Code Pre-Hook Backup vor Edit-Operation |
| Datei existiert |
Ja
|
Dateiinhalt
<?php
/**
* Service Definitions for DI Container.
*
* All repositories and services are explicitly registered to ensure
* proper database connections and avoid instantiation in controllers.
*
* @param Framework\Container $container
*/
use Application\ContentCollectionService;
use Application\PipelineStepService;
use Framework\Container;
use Infrastructure\AI\AIConfig;
use Infrastructure\AI\ChatService;
use Infrastructure\AI\OllamaService;
use Infrastructure\AI\QdrantService;
use Infrastructure\AI\VectorSearchService;
use Infrastructure\Config\DatabaseFactory;
use Infrastructure\Docs\ChunkSyncService;
use Infrastructure\Docs\HybridSearchService;
use Infrastructure\Formatter\ApiResponseFormatter;
use Infrastructure\Formatting\ChatMessageFormatter;
use Infrastructure\Logging\AuditLogger;
use Infrastructure\Persistence\ChatMessageRepository;
use Infrastructure\Persistence\ChatSessionRepository;
use Infrastructure\Persistence\CollectionRepository;
use Infrastructure\Persistence\ContentConfigRepository;
use Infrastructure\Persistence\ContentRepository;
use Infrastructure\Persistence\ContractRepository;
use Infrastructure\Persistence\CriticsRepository;
use Infrastructure\Persistence\DokumentationRepository;
use Infrastructure\Persistence\FileBackupRepository;
use Infrastructure\Persistence\KiProtokollRepository;
use Infrastructure\Persistence\PipelineRepository;
use Infrastructure\Persistence\PromptsRepository;
use Infrastructure\Persistence\SystemExplorerRepository;
use Infrastructure\Persistence\TaskAssignmentRepository;
use Infrastructure\Persistence\TaskCommentRepository;
use Infrastructure\Persistence\TaskRepository;
use Infrastructure\Persistence\TaskResultRepository;
use Infrastructure\SemanticExplorerRepository;
use Infrastructure\Validation\CollectionValidator;
use Domain\Repository\ChatMessageRepositoryInterface;
use Domain\Repository\ChatSessionRepositoryInterface;
use Domain\Repository\CollectionRepositoryInterface;
use Domain\Repository\TaskRepositoryInterface;
use Infrastructure\AI\ContentQualityValidator;
// NOTE: UseCases are NOT explicitly registered here.
// They are resolved via Container::autowire() automatically.
// Only register: Interfaces, Services with special config, Repositories.
return function (Container $container): void {
// =========================================================================
// DATABASE CONNECTIONS
// =========================================================================
// ki_dev database connection
$container->set('pdo.dev', fn () => DatabaseFactory::dev());
// ki_content database connection
$container->set('pdo.content', fn () => DatabaseFactory::content());
// =========================================================================
// REPOSITORIES - ki_dev database
// =========================================================================
$container->set(SystemExplorerRepository::class, fn () => new SystemExplorerRepository());
$container->set(DokumentationRepository::class, fn () => new DokumentationRepository());
$container->set(FileBackupRepository::class, fn () => new FileBackupRepository());
$container->set(ContractRepository::class, fn () => new ContractRepository());
$container->set(TaskRepository::class, fn () => new TaskRepository());
$container->set(TaskAssignmentRepository::class, fn () => new TaskAssignmentRepository());
$container->set(TaskResultRepository::class, fn () => new TaskResultRepository());
$container->set(TaskCommentRepository::class, fn () => new TaskCommentRepository());
$container->set(KiProtokollRepository::class, fn () => new KiProtokollRepository());
$container->set(CollectionRepository::class, fn () => new CollectionRepository());
$container->set(PipelineRepository::class, fn () => new PipelineRepository());
// =========================================================================
// REPOSITORIES - ki_content database
// =========================================================================
$container->set(ContentRepository::class, fn () => new ContentRepository());
$container->set(SemanticExplorerRepository::class, fn () => new SemanticExplorerRepository());
$container->set(ChatSessionRepository::class, fn () => new ChatSessionRepository());
$container->set(ChatMessageRepository::class, fn () => new ChatMessageRepository());
$container->set(PromptsRepository::class, fn () => new PromptsRepository());
$container->set(CriticsRepository::class, fn () => new CriticsRepository());
$container->set(ContentConfigRepository::class, fn () => new ContentConfigRepository());
// =========================================================================
// INTERFACE ALIASES (Domain → Infrastructure)
// =========================================================================
$container->set(TaskRepositoryInterface::class, fn (Container $c) => $c->get(TaskRepository::class));
$container->set(ChatSessionRepositoryInterface::class, fn (Container $c) => $c->get(ChatSessionRepository::class));
$container->set(ChatMessageRepositoryInterface::class, fn (Container $c) => $c->get(ChatMessageRepository::class));
$container->set(CollectionRepositoryInterface::class, fn (Container $c) => $c->get(CollectionRepository::class));
// =========================================================================
// AI SERVICES
// =========================================================================
$container->set(AIConfig::class, fn () => AIConfig::fromCredentialsFile());
$container->set(ChatService::class, function (Container $c) {
return $c->get(AIConfig::class)->createChatService();
});
$container->set(OllamaService::class, function (Container $c) {
return $c->get(AIConfig::class)->createOllamaService();
});
$container->set(QdrantService::class, function (Container $c) {
return $c->get(AIConfig::class)->createQdrantService();
});
$container->set(VectorSearchService::class, fn () => new VectorSearchService());
$container->set(ContentQualityValidator::class, function (Container $c) {
return new ContentQualityValidator($c->get(OllamaService::class));
});
// =========================================================================
// APPLICATION SERVICES
// =========================================================================
$container->set(AuditLogger::class, fn () => new AuditLogger());
$container->set(ChunkSyncService::class, fn () => new ChunkSyncService());
$container->set(HybridSearchService::class, fn () => new HybridSearchService());
$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));
});
// =========================================================================
// USE CASES
// =========================================================================
$container->set(DocumentationChatUseCase::class, function (Container $c) {
return new DocumentationChatUseCase(
$c->get(ChunkSyncService::class),
$c->get(OllamaService::class)
);
});
$container->set(RunPipelineUseCase::class, function (Container $c) {
return new RunPipelineUseCase($c->get(PipelineRepository::class));
});
$container->set(PipelineRunStatusUseCase::class, function (Container $c) {
return new PipelineRunStatusUseCase($c->get(PipelineRepository::class));
});
$container->set(UpdatePipelineConfigUseCase::class, function (Container $c) {
return new UpdatePipelineConfigUseCase($c->get(PipelineRepository::class));
});
// =========================================================================
// FORMATTERS
// =========================================================================
$container->set(ApiResponseFormatter::class, fn () => new ApiResponseFormatter());
$container->set(ChatMessageFormatter::class, fn () => new ChatMessageFormatter());
// =========================================================================
// ADDITIONAL USE CASES
// =========================================================================
$container->set(ManageCriticsUseCase::class, function (Container $c) {
return new ManageCriticsUseCase($c->get(CriticsRepository::class));
});
$container->set(ManagePromptsUseCase::class, function (Container $c) {
return new ManagePromptsUseCase($c->get(PromptsRepository::class));
});
$container->set(ManageConfigUseCase::class, function (Container $c) {
return new ManageConfigUseCase($c->get(ContentConfigRepository::class));
});
$container->set(GenerateContentUseCase::class, fn () => new GenerateContentUseCase());
$container->set(ManageChatSessionsUseCase::class, function (Container $c) {
return new ManageChatSessionsUseCase(
$c->get(ChatSessionRepositoryInterface::class),
$c->get(ChatMessageRepositoryInterface::class),
$c->get(ContentConfigRepository::class),
$c->get(CollectionRepositoryInterface::class),
$c->get(CollectionValidator::class)
);
});
$container->set(SendChatMessageUseCase::class, function (Container $c) {
return new SendChatMessageUseCase(
$c->get(ChatService::class),
$c->get(ChatSessionRepositoryInterface::class),
$c->get(ChatMessageRepositoryInterface::class),
$c->get(ContentConfigRepository::class),
$c->get(ContentQualityValidator::class)
);
});
$container->set(ExportChatSessionUseCase::class, function (Container $c) {
return new ExportChatSessionUseCase(
$c->get(ChatSessionRepositoryInterface::class),
$c->get(ChatMessageRepositoryInterface::class)
);
});
$container->set(ViewProtokollUseCase::class, function (Container $c) {
return new ViewProtokollUseCase($c->get(KiProtokollRepository::class));
});
// =========================================================================
// TASK USE CASES
// =========================================================================
$container->set(GetTasksUseCase::class, function (Container $c) {
return new GetTasksUseCase(
$c->get(TaskRepositoryInterface::class),
$c->get(TaskAssignmentRepository::class),
$c->get(TaskResultRepository::class)
);
});
$container->set(CreateTaskUseCase::class, function (Container $c) {
return new CreateTaskUseCase(
$c->get(TaskRepositoryInterface::class),
$c->get(TaskCommentRepository::class)
);
});
$container->set(DeleteTaskUseCase::class, function (Container $c) {
return new DeleteTaskUseCase($c->get(TaskRepositoryInterface::class));
});
$container->set(AssignTaskUseCase::class, function (Container $c) {
return new AssignTaskUseCase(
$c->get(TaskRepositoryInterface::class),
$c->get(TaskAssignmentRepository::class),
$c->get(TaskCommentRepository::class)
);
});
$container->set(UpdateTaskStatusUseCase::class, function (Container $c) {
return new UpdateTaskStatusUseCase(
$c->get(TaskRepositoryInterface::class),
$c->get(TaskCommentRepository::class)
);
});
$container->set(SaveTaskResultUseCase::class, function (Container $c) {
return new SaveTaskResultUseCase(
$c->get(TaskRepositoryInterface::class),
$c->get(TaskResultRepository::class),
$c->get(TaskCommentRepository::class)
);
});
$container->set(ExecuteAITaskUseCase::class, function (Container $c) {
return new ExecuteAITaskUseCase(
$c->get(TaskRepositoryInterface::class),
$c->get(SaveTaskResultUseCase::class),
$c->get(UpdateTaskStatusUseCase::class)
);
});
};
Vollständig herunterladen
Aktionen
Andere Versionen dieser Datei
| ID |
Version |
Typ |
Größe |
Datum |
| 1446 |
93 |
modified |
20.7 KB |
2025-12-25 17:00 |
| 1444 |
92 |
modified |
20.6 KB |
2025-12-25 17:00 |
| 1437 |
91 |
modified |
20.2 KB |
2025-12-25 16:59 |
| 1435 |
90 |
modified |
19.7 KB |
2025-12-25 16:59 |
| 1434 |
89 |
modified |
19.5 KB |
2025-12-25 16:59 |
| 1432 |
88 |
modified |
19.3 KB |
2025-12-25 16:59 |
| 1428 |
87 |
modified |
19.2 KB |
2025-12-25 16:59 |
| 1423 |
86 |
modified |
18.8 KB |
2025-12-25 16:59 |
| 1417 |
85 |
modified |
18.7 KB |
2025-12-25 16:59 |
| 1411 |
84 |
modified |
18.3 KB |
2025-12-25 16:58 |
| 1408 |
83 |
modified |
17.9 KB |
2025-12-25 16:58 |
| 1404 |
82 |
modified |
17.8 KB |
2025-12-25 16:58 |
| 1402 |
81 |
modified |
17.6 KB |
2025-12-25 16:58 |
| 1307 |
80 |
modified |
17.6 KB |
2025-12-25 13:31 |
| 1306 |
79 |
modified |
17.5 KB |
2025-12-25 13:31 |
| 1288 |
78 |
modified |
17.2 KB |
2025-12-25 13:02 |
| 1287 |
77 |
modified |
17.1 KB |
2025-12-25 13:02 |
| 1286 |
76 |
modified |
17.1 KB |
2025-12-25 13:02 |
| 1278 |
75 |
modified |
16.3 KB |
2025-12-25 12:53 |
| 1277 |
74 |
modified |
15.9 KB |
2025-12-25 12:53 |
| 1259 |
73 |
modified |
16.0 KB |
2025-12-25 12:46 |
| 1258 |
72 |
modified |
16.2 KB |
2025-12-25 12:46 |
| 1257 |
71 |
modified |
16.2 KB |
2025-12-25 12:46 |
| 1256 |
70 |
modified |
16.3 KB |
2025-12-25 12:46 |
| 1253 |
69 |
modified |
16.2 KB |
2025-12-25 12:45 |
| 1252 |
68 |
modified |
15.8 KB |
2025-12-25 12:45 |
| 1251 |
67 |
modified |
15.5 KB |
2025-12-25 12:45 |
| 1250 |
66 |
modified |
15.3 KB |
2025-12-25 12:45 |
| 1249 |
65 |
modified |
15.1 KB |
2025-12-25 12:45 |
| 1230 |
64 |
modified |
14.8 KB |
2025-12-25 12:31 |
| 1229 |
63 |
modified |
14.5 KB |
2025-12-25 12:31 |
| 1228 |
62 |
modified |
14.4 KB |
2025-12-25 12:31 |
| 1227 |
61 |
modified |
14.3 KB |
2025-12-25 12:31 |
| 1216 |
60 |
modified |
13.9 KB |
2025-12-25 10:41 |
| 1213 |
59 |
modified |
13.9 KB |
2025-12-25 10:40 |
| 1212 |
58 |
modified |
13.8 KB |
2025-12-25 10:40 |
| 1209 |
57 |
modified |
13.5 KB |
2025-12-25 10:36 |
| 1208 |
56 |
modified |
13.3 KB |
2025-12-25 10:36 |
| 1171 |
55 |
modified |
13.1 KB |
2025-12-25 10:29 |
| 1112 |
54 |
modified |
12.9 KB |
2025-12-25 09:23 |
| 1111 |
53 |
modified |
12.8 KB |
2025-12-25 09:23 |
| 1110 |
52 |
modified |
12.9 KB |
2025-12-25 09:23 |
| 1109 |
51 |
modified |
12.9 KB |
2025-12-25 09:23 |
| 1108 |
50 |
modified |
12.9 KB |
2025-12-25 09:23 |
| 1103 |
49 |
modified |
12.8 KB |
2025-12-25 09:20 |
| 1102 |
48 |
modified |
12.7 KB |
2025-12-25 09:20 |
| 1101 |
47 |
modified |
12.6 KB |
2025-12-25 09:20 |
| 1100 |
46 |
modified |
12.6 KB |
2025-12-25 09:20 |
| 1086 |
45 |
modified |
12.5 KB |
2025-12-25 02:29 |
| 1085 |
44 |
modified |
12.4 KB |
2025-12-25 02:29 |
| 1084 |
43 |
modified |
12.3 KB |
2025-12-25 02:29 |
| 1083 |
42 |
modified |
12.3 KB |
2025-12-25 02:29 |
| 1075 |
41 |
modified |
12.1 KB |
2025-12-25 02:27 |
| 1074 |
40 |
modified |
11.9 KB |
2025-12-25 02:27 |
| 1073 |
39 |
modified |
11.8 KB |
2025-12-25 02:26 |
| 1072 |
38 |
modified |
11.7 KB |
2025-12-25 02:26 |
| 1062 |
37 |
modified |
11.6 KB |
2025-12-25 02:23 |
| 1061 |
36 |
modified |
11.5 KB |
2025-12-25 02:23 |
| 1060 |
35 |
modified |
11.5 KB |
2025-12-25 02:23 |
| 1059 |
34 |
modified |
11.4 KB |
2025-12-25 02:23 |
| 1051 |
33 |
modified |
11.3 KB |
2025-12-25 02:20 |
| 1050 |
32 |
modified |
11.2 KB |
2025-12-25 02:20 |
| 1049 |
31 |
modified |
11.2 KB |
2025-12-25 02:20 |
| 1048 |
30 |
modified |
11.1 KB |
2025-12-25 02:20 |
| 1026 |
29 |
modified |
11.0 KB |
2025-12-24 20:20 |
| 934 |
28 |
modified |
10.8 KB |
2025-12-23 21:45 |
| 933 |
27 |
modified |
10.8 KB |
2025-12-23 21:45 |
| 920 |
26 |
modified |
10.6 KB |
2025-12-23 21:05 |
| 919 |
25 |
modified |
10.5 KB |
2025-12-23 21:04 |
| 874 |
24 |
modified |
9.8 KB |
2025-12-23 09:29 |
| 873 |
23 |
modified |
9.6 KB |
2025-12-23 09:29 |
| 872 |
22 |
modified |
9.4 KB |
2025-12-23 09:29 |
| 869 |
21 |
modified |
9.2 KB |
2025-12-23 09:00 |
| 868 |
20 |
modified |
9.1 KB |
2025-12-23 09:00 |
| 867 |
19 |
modified |
8.9 KB |
2025-12-23 08:58 |
| 866 |
18 |
modified |
8.9 KB |
2025-12-23 08:58 |
| 861 |
17 |
modified |
8.1 KB |
2025-12-23 08:47 |
| 860 |
16 |
modified |
8.0 KB |
2025-12-23 08:47 |
| 850 |
15 |
modified |
12.3 KB |
2025-12-23 08:30 |
| 849 |
14 |
modified |
12.9 KB |
2025-12-23 08:30 |
| 848 |
13 |
modified |
11.7 KB |
2025-12-23 08:23 |
| 847 |
12 |
modified |
10.5 KB |
2025-12-23 08:22 |
| 846 |
11 |
modified |
10.3 KB |
2025-12-23 08:22 |
| 845 |
10 |
modified |
9.6 KB |
2025-12-23 08:22 |
| 844 |
9 |
modified |
9.3 KB |
2025-12-23 08:22 |
| 645 |
8 |
modified |
8.5 KB |
2025-12-23 04:47 |
| 644 |
7 |
modified |
8.1 KB |
2025-12-23 04:47 |
| 610 |
6 |
modified |
7.2 KB |
2025-12-23 04:41 |
| 609 |
5 |
modified |
6.8 KB |
2025-12-23 04:41 |
| 604 |
4 |
modified |
1.1 KB |
2025-12-23 04:38 |
| 584 |
3 |
modified |
1.1 KB |
2025-12-23 04:23 |
| 583 |
2 |
modified |
1.1 KB |
2025-12-23 04:23 |
| 526 |
1 |
modified |
1.0 KB |
2025-12-22 16:47 |
← Zurück zur Übersicht