ILIAS  trunk Revision v12.0_alpha-1613-gae4c99ebb18
SoapAuthEndpoint.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\AuthSOAP;
22
23final readonly class SoapAuthEndpoint
24{
25 private string $location;
26 private string $namespace;
27 private bool $use_dotnet;
28
29 public function __construct(\ilSetting $settings)
30 {
31 $this->namespace = (string) $settings->get('soap_auth_namespace', '');
32 $this->use_dotnet = (bool) $settings->get('soap_auth_use_dotnet', '0');
33 $this->location = $this->buildLocation(
34 (string) $settings->get('soap_auth_server', ''),
35 (int) $settings->get('soap_auth_port', '0'),
36 (string) $settings->get('soap_auth_uri', ''),
37 (bool) $settings->get('soap_auth_use_https', '0'),
38 );
39 }
40
41 public function getLocation(): string
42 {
43 return $this->location;
44 }
45
46 public function getNamespace(): string
47 {
48 return $this->namespace;
49 }
50
51 public function useDotnet(): bool
52 {
53 return $this->use_dotnet;
54 }
55
57 {
58 return new SessionValidationClient(
59 $this->location,
60 $this->namespace,
61 $this->use_dotnet,
62 );
63 }
64
65 private function buildLocation(
66 string $server_hostname,
67 int $server_port,
68 string $server_uri,
69 bool $use_https,
70 ): string {
71 $uri = $use_https ? 'https://' : 'http://';
72 $uri .= $server_hostname;
73
74 if ($server_port > 0) {
75 $uri .= ':' . $server_port;
76 }
77
78 if ($server_uri !== '') {
79 $uri .= '/' . $server_uri;
80 }
81
82 return $uri;
83 }
84}
__construct(\ilSetting $settings)
buildLocation(string $server_hostname, int $server_port, string $server_uri, bool $use_https,)
ILIAS Setting Class.
get(string $a_keyword, ?string $a_default_value=null)
get setting
get(string $class_name)