ILIAS  release_7 Revision v7.30-3-g800a261c036
AbstractProvider.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
21
24
29abstract class AbstractProvider implements Provider
30{
34 protected $dic;
39
43 public function __construct(Container $dic)
44 {
45 $this->dic = $dic;
46 }
47
51 protected function globalScreen() : Services
52 {
53 return $this->dic->globalScreen();
54 }
55
59 final public function getFullyQualifiedClassName() : string
60 {
61 return self::class;
62 }
63
68 public function getProviderNameForPresentation() : string
69 {
70 if ($this->provider_name_cache !== "" && is_string($this->provider_name_cache)) {
72 }
73 $reflector = new \ReflectionClass($this);
74
75 $re = "/.*[\\\|\\/](?P<provider>(Services|Modules)[\\\|\\/].*)[\\\|\\/]classes/m";
76
77 preg_match($re, str_replace("\\", "/", $reflector->getFileName()), $matches);
78
79 $this->provider_name_cache = isset($matches[1]) ? is_string($matches[1]) ? $matches[1] : self::class : self::class;
80
82 }
83}
An exception for terminatinating execution or to throw for unit testing.
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:19
Class ilAsqQuestionAuthoringFactory.