19 declare(strict_types=1);
36 '.*/components/ILIAS/Setup/',
37 '.*/components/ILIAS/GlobalScreen/',
39 '.*/components/ILIAS/App/tests/',
40 '.*/components/ILIAS/BackgroundTasks/tests/',
41 '.*/components/ILIAS/Cache/tests/',
42 '.*/components/ILIAS/Data/tests/',
43 '.*/components/ILIAS/FileUpload/tests/',
44 '.*/components/ILIAS/Filesystem/tests/',
45 '.*/components/ILIAS/GlobalCache/tests/',
46 '.*/components/ILIAS/HTTP/tests/',
47 '.*/components/ILIAS/KioskMode/tests/',
48 '.*/components/ILIAS/Language/tests/',
49 '.*/components/ILIAS/Refinery/tests/',
50 '.*/components/ILIAS/ResourceStorage/tests/',
51 '.*/components/ILIAS/Types/tests/',
52 '.*/components/ILIAS/UI/tests/',
53 '.*/components/ILIAS/VirusScanner/tests/',
54 '.*/components/ILIAS/setup_/',
58 '.*ilPDExternalFeedBlockGUI.*',
68 $this->root = substr(__FILE__, 0, strpos(__FILE__, DIRECTORY_SEPARATOR .
"components"));
69 $external_classmap = include(__DIR__ .
"/../../../../vendor/composer/vendor/composer/autoload_classmap.php");
70 $this->classmap = $external_classmap ?:
null;
87 callable $is_matching,
88 array $additional_ignore = [],
89 ?
string $matching_path =
null 91 foreach ($this->
getAllClassNames($additional_ignore, $matching_path) as $class_name) {
93 $reflection_class = new \ReflectionClass($class_name);
94 if ($is_matching($reflection_class)) {
108 $ignore = array_merge($this->ignore, $additional_ignore);
110 if (!is_array($this->classmap)) {
111 throw new \LogicException(
"Composer ClassMap not loaded");
118 fn($v):
string =>
"(" . str_replace(
'/',
'(/|\\\\)', $v) .
")",
122 if ($matching_path) {
123 $matching_path = str_replace(
'/',
'(/|\\\\)', $matching_path);
127 foreach ($this->classmap as $class_name => $file_path) {
128 $real_path = realpath($file_path);
129 if ($real_path ===
false) {
130 throw new \RuntimeException(
131 "Could not find file for class $class_name (path: $file_path). " .
132 "Please check the composer classmap, maybe it is outdated. " .
133 "You can regenerate it by executing 'composer du' or 'composer install' " .
134 "(which also ensures dependencies are correctly installed) in the ILIAS root directory." 138 $path = str_replace($this->root,
"", $real_path);
139 if ($matching_path && !preg_match(
"#^" . $matching_path .
"$#",
$path)) {
142 if (!preg_match(
"#^" . $regexp .
"$#",
$path)) {
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
genericGetMatchingClassNames(callable $is_matching, array $additional_ignore=[], ?string $matching_path=null)
The matcher finds the class names implementing the given interface, while ignoring paths in self::$ig...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getAllClassNames(array $additional_ignore, ?string $matching_path=null)