ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Init.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\StaticURL;
22 
30 
34 final 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 }
static init(Container $c)
Definition: Init.php:36
$c
Definition: deliver.php:25
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance()
get singleton instance
$handler
Definition: oai.php:30