ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Init.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\StaticURL;
22
30
34final class Init
35{
36 public static function init(Container $c): void
37 {
38 $c['static_url.request_builder'] = (static fn(Container $c): RequestBuilder => new BundledRequestBuilder());
39
40 $c['static_url.context'] = (static fn(Container $c): Context => new Context($c));
41
42 $c['static_url.handler'] = static function (Container $c): HandlerService {
43 $handlers = (require ArtifactObjective::PATH() ?? []);
44 $handlers = array_map(static fn(string $handler): Handler => new $handler(), $handlers);
45
46 return new HandlerService(
47 $c['static_url.request_builder'],
48 $c['static_url.context'],
49 ...$handlers
50 );
51 };
52
53 $c['static_url.uri_builder'] = (static fn(Container $c): URIBuilder => new StandardURIBuilder(
54 ILIAS_HTTP_PATH,
55 \ilRobotSettings::getInstance()?->robotSupportEnabled() ?? false
56 ));
57
58 $c['static_url'] = (static fn(Container $c): Services => new Services(
59 $c['static_url.handler'],
60 $c['static_url.uri_builder'],
61 $c['static_url.context']
62 ));
63 }
64
65}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
Class Services.
Definition: Services.php:38
static init(Container $c)
Definition: Init.php:36
static getInstance()
get singleton instance
$c
Definition: deliver.php:25
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$handler
Definition: oai.php:29