ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
AbstractProvider.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
29abstract class AbstractProvider implements Provider
30{
31 private string $provider_name_cache = "";
32
33 public function __construct(protected Container $dic)
34 {
35 }
36
37
38 protected function globalScreen(): Services
39 {
40 return $this->dic->globalScreen();
41 }
42
43
44 final public function getFullyQualifiedClassName(): string
45 {
46 return self::class;
47 }
48
52 public function getProviderNameForPresentation(): string
53 {
54 if ($this->provider_name_cache !== "" && is_string($this->provider_name_cache)) {
56 }
57
58 $reflector = new \ReflectionClass($this);
59
60 $dirname = dirname($reflector->getFileName());
61 $after_components = substr($dirname, strpos($dirname, '/components/') + strlen('/components/'));
62 $parts = explode(
63 DIRECTORY_SEPARATOR,
64 $after_components
65 );
66
67 $parts = array_filter($parts, static function ($part): bool {
68 $ignore = ['GlobalScreen', 'Provider', 'classes', 'GS'];
69 return $part !== '' && !in_array($part, $ignore, true);
70 });
71
72 return $this->provider_name_cache = implode('/', $parts);
73 }
74}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
$dic
Definition: ltiresult.php:33
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61