ILIAS  release_8 Revision v8.24
AbstractProvider.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
21
24
29abstract class AbstractProvider implements Provider
30{
31 protected Container $dic;
32 private string $provider_name_cache = "";
33
37 public function __construct(Container $dic)
38 {
39 $this->dic = $dic;
40 }
41
45 protected function globalScreen(): Services
46 {
47 return $this->dic->globalScreen();
48 }
49
53 final public function getFullyQualifiedClassName(): string
54 {
55 return self::class;
56 }
57
62 public function getProviderNameForPresentation(): string
63 {
64 if ($this->provider_name_cache !== "" && is_string($this->provider_name_cache)) {
66 }
67 $reflector = new \ReflectionClass($this);
68
69 $re = "/.*[\\\|\\/](?P<provider>(Services|Modules)[\\\|\\/].*)[\\\|\\/]classes/m";
70
71 preg_match($re, str_replace("\\", "/", $reflector->getFileName()), $matches);
72
73 $this->provider_name_cache = isset($matches[1]) ? is_string($matches[1]) ? $matches[1] : self::class : self::class;
74
76 }
77}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...