ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 function (Container $c): RequestBuilder {
39  return new BundledRequestBuilder();
40  };
41 
42  $c['static_url.context'] = static function (Container $c): Context {
43  return new Context($c);
44  };
45 
46  $c['static_url.handler'] = static function (Container $c): HandlerService {
47  $handlers = (require ArtifactObjective::PATH() ?? []);
48  $handlers = array_map(static function (string $handler): Handler {
49  return new $handler();
50  }, $handlers);
51 
52  return new HandlerService(
53  $c['static_url.request_builder'],
54  $c['static_url.context'],
55  ...$handlers
56  );
57  };
58 
59  $c['static_url.uri_builder'] = static function (Container $c): URIBuilder {
60  return new StandardURIBuilder(
61  ILIAS_HTTP_PATH,
62  \ilRobotSettings::getInstance()?->robotSupportEnabled() ?? false
63  );
64  };
65 
66  $c['static_url'] = static function (Container $c): \ILIAS\StaticURL\Services {
67  return new Services(
68  $c['static_url.handler'],
69  $c['static_url.uri_builder'],
70  $c['static_url.context']
71  );
72  };
73  }
74 
75 }
Interface Observer Contains several chained tasks and infos about them.
static init(Container $c)
Definition: Init.php:36
$c
Definition: deliver.php:9
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:14