ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
Environment.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS;
22
35
36class Environment implements Component
37{
38 public function init(
39 array|\ArrayAccess &$define,
40 array|\ArrayAccess &$implement,
41 array|\ArrayAccess &$use,
42 array|\ArrayAccess &$contribute,
43 array|\ArrayAccess &$seek,
44 array|\ArrayAccess &$provide,
45 array|\ArrayAccess &$pull,
46 array|\ArrayAccess &$internal,
47 ): void {
48 $define[] = IliasIni::class;
49 $define[] = ClientIdProvider::class;
50 $define[] = ClientIni::class;
51 $define[] = ServerConfiguration::class;
52 $define[] = Directories::class;
53
54 $implement[IliasIni::class] = static fn() => new IliasIniFile(
55 __DIR__ . '/../../../ilias.ini.php'
56 );
57
58 $implement[ClientIdProvider::class] = static fn() => new DefaultClientIdProvider(
59 $use[IliasIni::class],
60 $use[GlobalHttpState::class],
61 );
62
63 // the clients live in public/ since ILIAS 10, older ini files still name the
64 // path without it, as ilInitialisation and DirectoryPathConfigFromIni expect
65 $implement[ClientIni::class] = static fn() => new ClientIniFile(
66 $use[IliasIni::class]->getAbsolutePath()
67 . '/public/' . str_replace('public/', '', $use[IliasIni::class]->getClientsPath())
68 . '/' . $use[ClientIdProvider::class]->getClientId()->toString()
69 . '/' . $use[IliasIni::class]->getClientIniFile()
70 );
71
72 $implement[ServerConfiguration::class] = static fn() => new PhpServerConfiguration();
73
74 $implement[Directories::class] = static fn() => new WorkingDirectories(
75 $use[IliasIni::class],
76 $use[ClientIdProvider::class],
77 );
78 }
79}
Determines the current client ID from the HTTP request context.
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: Environment.php:38
Typed read access to client.ini.php.
Definition: ClientIni.php:35
Typed read access to ilias.ini.php.
Definition: IliasIni.php:35
Read access to PHP runtime and server configuration.
Interface GlobalHttpState.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.