19 declare(strict_types=1);
44 '.*ilPDExternalFeedBlockGUI.*',
54 $this->root = substr(__FILE__, 0, strpos(__FILE__, DIRECTORY_SEPARATOR .
"src"));
55 $external_classmap = include
"./libs/composer/vendor/composer/autoload_classmap.php";
56 $this->classmap = $external_classmap ?: null;
72 array $additional_ignore = [],
73 string $matching_path = null
75 foreach ($this->
getAllClassNames($additional_ignore, $matching_path) as $class_name) {
77 $r = new \ReflectionClass($class_name);
78 if ($r->isInstantiable() && $r->implementsInterface($interface)) {
92 $ignore = array_merge($this->ignore, $additional_ignore);
94 if (!is_array($this->classmap)) {
95 throw new \LogicException(
"Composer ClassMap not loaded");
102 fn ($v):
string =>
"(" . str_replace(
'/',
'(/|\\\\)', $v) .
")",
106 if ($matching_path) {
107 $matching_path = str_replace(
'/',
'(/|\\\\)', $matching_path);
111 foreach ($this->classmap as $class_name => $file_path) {
112 $real_path = realpath($file_path);
113 if ($real_path ===
false) {
114 throw new \RuntimeException(
115 "Could not find file for class $class_name (path: $file_path). " .
116 "Please check the composer classmap, maybe it is outdated. " .
117 "You can regenerate it by executing 'composer du' or 'composer install' " .
118 "(which also ensures dependencies are correctly installed) in the ILIAS root directory." 122 $path = str_replace($this->root,
"", $real_path);
123 if ($matching_path && !preg_match(
"#^" . $matching_path .
"$#",
$path)) {
126 if (!preg_match(
"#^" . $regexp .
"$#",
$path)) {
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getMatchingClassNames(string $interface, array $additional_ignore=[], string $matching_path=null)
The matcher finds the class names implementing the given interface, while ignoring paths in self::$ig...
getAllClassNames(array $additional_ignore, string $matching_path=null)