19 declare(strict_types=1);
37 '.*/src/GlobalScreen/',
38 '.*/Customizing/.*/src/',
46 '.*ilPDExternalFeedBlockGUI.*',
56 $this->root = substr(__FILE__, 0, strpos(__FILE__, DIRECTORY_SEPARATOR .
"src"));
57 $external_classmap = include
"./libs/composer/vendor/composer/autoload_classmap.php";
58 $this->classmap = $external_classmap ?: null;
75 callable $is_matching,
76 array $additional_ignore = [],
77 string $matching_path = null
79 foreach ($this->
getAllClassNames($additional_ignore, $matching_path) as $class_name) {
81 $reflection_class = new \ReflectionClass($class_name);
82 if ($is_matching($reflection_class)) {
96 $ignore = array_merge($this->ignore, $additional_ignore);
98 if (!is_array($this->classmap)) {
99 throw new \LogicException(
"Composer ClassMap not loaded");
106 fn($v):
string =>
"(" . str_replace(
'/',
'(/|\\\\)', $v) .
")",
110 if ($matching_path) {
111 $matching_path = str_replace(
'/',
'(/|\\\\)', $matching_path);
115 foreach ($this->classmap as $class_name => $file_path) {
116 $real_path = realpath($file_path);
117 if ($real_path ===
false) {
118 throw new \RuntimeException(
119 "Could not find file for class $class_name (path: $file_path). " .
120 "Please check the composer classmap, maybe it is outdated. " .
121 "You can regenerate it by executing 'composer du' or 'composer install' " .
122 "(which also ensures dependencies are correctly installed) in the ILIAS root directory." 126 $path = str_replace($this->root,
"", $real_path);
127 if ($matching_path && !preg_match(
"#^" . $matching_path .
"$#",
$path)) {
130 if (!preg_match(
"#^" . $regexp .
"$#",
$path)) {
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)
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...