ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
InitHttpServices.php
Go to the documentation of this file.
1 <?php
2 
27 
32 {
33  public function init(Container $container): void
34  {
35  $container['http.request_factory'] = static function (Container $c): RequestFactoryImpl {
36  $header = null;
37  $value = null;
38 
39  if (
40  isset($c['ilIliasIniFile'])
41  && (bool) $c->iliasIni()->readVariable('https', 'auto_https_detect_enabled')
42  ) {
43  $header = (string) $c->iliasIni()->readVariable('https', 'auto_https_detect_header_name');
44  $value = (string) $c->iliasIni()->readVariable('https', 'auto_https_detect_header_value');
45  $header = $header === '' ? null : $header;
46  $value = $value === '' ? null : $value;
47  }
48 
49  return new RequestFactoryImpl($header, $value);
50  };
51 
52  $container['http.response_factory'] = static fn($c): ResponseFactoryImpl => new ResponseFactoryImpl();
53 
54  $container['http.cookie_jar_factory'] = static fn($c): CookieJarFactoryImpl => new CookieJarFactoryImpl();
55 
56  $container['http.response_sender_strategy'] = static fn(
57  $c
59 
60  $container['http.duration_factory'] = static fn($c): DurationFactory => new DurationFactory(
61  new IncrementFactory()
62  );
63 
64  $container['http.security'] = static function ($c): void {
65  throw new OutOfBoundsException('TODO');
66  };
67 
68  $container['http'] = static fn($c): Services => new Services($c);
69  }
70 }
$c
Definition: deliver.php:25
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
$container
Definition: wac.php:36
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
init(Container $container)
Responsible for loading the HTTP Service into the dependency injection container of ILIAS...