ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
WebDAV.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS;
22
29use Psr\Http\Message\ServerRequestInterface;
45
46class WebDAV implements Component
47{
48 public function init(
49 array|\ArrayAccess &$define,
50 array|\ArrayAccess &$implement,
51 array|\ArrayAccess &$use,
52 array|\ArrayAccess &$contribute,
53 array|\ArrayAccess &$seek,
54 array|\ArrayAccess &$provide,
55 array|\ArrayAccess &$pull,
56 array|\ArrayAccess &$internal,
57 ): void {
58 // TODO remove after HTTP service implements this
59 $define[] = ServerRequestInterface::class;
60
61 $implement[ServerRequestInterface::class] = fn(): ServerRequestInterface => new LegacyRequestProxy();
62 $internal[Config::class] = static fn(): Config => new Config();
63 $internal[RequestTranslation::class] = static fn(): RequestTranslation => new RequestTranslation(
64 $internal[Config::class],
65 $use[ServerRequestInterface::class]
66 );
67
68 $internal[AccessCheck::class] = static fn(): AccessCheck => new RBACAccessCheckLegacyProxy();
69
70 $internal[Filter::class] = static fn(): Filter => new Collection(
72 $internal[Config::class],
73 ),
74 new RBACFilter(
75 $internal[AccessCheck::class]
76 )
77 );
78
79 $internal[ProxyRepository::class] = static fn(): ProxyRepository => new TreeProxyRepository(
80 $internal[Config::class],
81 $internal[Filter::class],
82 );
83
84 $internal[Factory::class] = static fn(): Factory => new Factory(
85 $internal[RequestTranslation::class],
86 $internal[ProxyRepository::class]
87 );
88
89 $contribute[PublicAsset::class] = fn(): Endpoint => new Endpoint(
90 $this,
91 $internal[Config::class]->getEndpoint()
92 );
93
94 $internal[SecretKeyRotation::class] = static fn() => SecretKeyRotation::fromArtefact(
95 KeyRotationObjective::PATH()
96 );
97
98 $internal[UriBuilder::class] = static fn(): UriBuilder => new UriBuilder(
99 $use[ServerRequestInterface::class],
100 $internal[Config::class]
101 );
102
103 $provide[Environment::class] = static fn(
104 ): Environment => new Environment(
105 $internal[Config::class],
106 $internal[UriBuilder::class]
107 );
108
109 $contribute[EntryPoint::class] = static fn(): Entrypoint => new \ILIAS\WebDAV\Entrypoint(
110 $internal[Factory::class],
111 $internal[RequestTranslation::class],
112 $internal[SecretKeyRotation::class],
113 $internal[Config::class]
114 );
115
116 $contribute[Agent::class] = static fn(): Agent
117 => new \ILIAS\WebDAV\Setup\Agent();
118 }
119}
An endpoint is a PHP file that produces output via HTTP.
Definition: Endpoint.php:29
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
Key rotation can provide an extra layer of mitigation against an attacker discovering a secret key.
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,)
Definition: WebDAV.php:48
An public asset is a file or folder that should be served via the web.
Definition: PublicAsset.php:27
A configuration for the setup.
Definition: Config.php:27
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.