ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
KeyValueStorage.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS;
22
25use ILIAS\Refinery\Factory as Refinery;
27
28class KeyValueStorage implements Component
29{
30 public function init(
31 array | \ArrayAccess &$define,
32 array | \ArrayAccess &$implement,
33 array | \ArrayAccess &$use,
34 array | \ArrayAccess &$contribute,
35 array | \ArrayAccess &$seek,
36 array | \ArrayAccess &$provide,
37 array | \ArrayAccess &$pull,
38 array | \ArrayAccess &$internal,
39 ): void {
40 $define[] = KeyValueStorage\Services::class;
41
42 // the session belongs to Authentication, so the session scope is the
43 // only one this component cannot store by itself.
44 $define[] = KeyValueStorage\SessionRepository::class;
45
46 $implement[KeyValueStorage\Services::class] = static fn() =>
48 $use[KeyValueStorage\SessionRepository::class],
49 $internal[KeyValueStorage\Internal\DatabaseRepository::class],
50 $internal[KeyValueStorage\Internal\DatabaseRepository::class],
51 $internal[KeyValueStorage\Internal\SubjectProviders::class],
52 $pull[Refinery::class]
53 );
54
55 $contribute[Agent::class] = static fn(): Agent =>
57 $pull[Refinery::class]
58 );
59
60 // components naming subjects contribute themselves as provider, see Subject\SubjectProvider
61 $internal[KeyValueStorage\Internal\SubjectProviders::class] = static fn() =>
63 $seek[KeyValueStorage\Subject\SubjectProvider::class]
64 );
65
66 $internal[KeyValueStorage\Internal\DatabaseRepository::class] = static fn() =>
68 $pull[Connection::class]
69 );
70 }
71}
Builds data types.
Definition: Factory.php:36
Persistent storage in the table owned by this component.
The contributed subject providers, keyed by their name.
init(array|\ArrayAccess &$define, array|\ArrayAccess &$implement, array|\ArrayAccess &$use, array|\ArrayAccess &$contribute, array|\ArrayAccess &$seek, array|\ArrayAccess &$provide, array|\ArrayAccess &$pull, array|\ArrayAccess &$internal,)
Wrapper for the Setup to work, as they require a namespace.
Definition: Connection.php:27
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.