|
| __construct () |
|
| 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::$ignore and and the additional patterns provided. More...
|
|
◆ __construct()
ILIAS\Setup\ImplementationOfInterfaceFinder::__construct |
( |
| ) |
|
Definition at line 52 of file ImplementationOfInterfaceFinder.php.
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;
◆ getAllClassNames()
ILIAS\Setup\ImplementationOfInterfaceFinder::getAllClassNames |
( |
array |
$additional_ignore, |
|
|
string |
$matching_path = null |
|
) |
| |
|
protected |
- Parameters
-
string[] | $additional_ignore |
Definition at line 90 of file ImplementationOfInterfaceFinder.php.
References $path.
Referenced by ILIAS\Setup\ImplementationOfInterfaceFinder\getMatchingClassNames().
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)) {
◆ getMatchingClassNames()
ILIAS\Setup\ImplementationOfInterfaceFinder::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::$ignore and and the additional patterns provided.
Patterns are regexps (without delimiters) to define complete paths on the filesystem to be ignored or selected.
- Parameters
-
string | $interface | |
| string[] | $additional_ignore |
string | null | $matching_path | |
Definition at line 70 of file ImplementationOfInterfaceFinder.php.
References Vendor\Package\$e, and ILIAS\Setup\ImplementationOfInterfaceFinder\getAllClassNames().
75 foreach ($this->
getAllClassNames($additional_ignore, $matching_path) as $class_name) {
77 $r = new \ReflectionClass($class_name);
78 if ($r->isInstantiable() && $r->implementsInterface($interface)) {
getAllClassNames(array $additional_ignore, string $matching_path=null)
◆ $classmap
array ILIAS\Setup\ImplementationOfInterfaceFinder::$classmap = null |
|
protected |
◆ $ignore
array ILIAS\Setup\ImplementationOfInterfaceFinder::$ignore |
|
protected |
Initial value:= [
'.*/src/',
'.*/libs/',
'.*/test/',
'.*/tests/',
'.*/setup/',
'.*ilSOAPAuth.*',
'.*ilPDExternalFeedBlockGUI.*',
]
Definition at line 35 of file ImplementationOfInterfaceFinder.php.
◆ $root
string ILIAS\Setup\ImplementationOfInterfaceFinder::$root |
|
protected |
The documentation for this class was generated from the following file: