19 declare(strict_types=1);
58 foreach ($plugins as $plugin_name) {
59 $agents = $agents->withAdditionalAgent(
74 if ($this->component_agents instanceof AgentCollection) {
78 $agents =
new AgentCollection($this->
refinery, []);
80 foreach ($this->component_agents as $agent) {
81 $agents = $agents->withAdditionalAgent(
87 $this->component_agents = $agents;
104 $path =
"[/]public/Customizing/global/plugins/.*/.*/" . $name .
"/.*";
105 $agent_classes = iterator_to_array($this->interface_finder->getMatchingClassNames(
111 if ($agent_classes === []) {
117 foreach ($agent_classes as $class_name) {
118 $agents[] =
new $class_name(
125 if (count($agents) === 1) {
129 return new AgentCollection(
137 if (!class_exists($class_name)) {
138 throw new \InvalidArgumentException(
"Class '" . $class_name .
"' not found.");
141 return new $class_name(
156 if (preg_match(
"/il(\w+)SetupAgent/", $class_name, $match)) {
157 return strtolower($match[1]);
168 new \RecursiveIteratorIterator(
172 foreach ($directories as $dir) {
174 if (preg_match(
"%^" . __DIR__ .
"/[.][.]/[.][.]/[.][.]/[.][.]/public/Customizing/global/plugins/(Services|Modules)/((\\w+/){2})([^/\.]+)(/|$)%", (
string) $dir, $groups)) {
176 if (isset($names[$name])) {
179 $names[$name] =
true;
192 return 'Agent Finder Adapter';
203 $DIC[
'setup.agentfinder'] = fn() => $this;
enter()
Using the AgentFinder as EntryPoint is an exception/abomination for 10 only.
Interface Observer Contains several chained tasks and infos about them.
__construct(protected Refinery $refinery, protected Data\Factory $data_factory, protected \ILIAS\Language\Language $lng, protected ImplementationOfInterfaceFinder $interface_finder, $component_agents)
getPluginAgent(string $name)
Get a agent from a specific plugin.
getName()
Using the AgentFinder as EntryPoint is an exception/abomination for 10 only.
array AgentCollection $component_agents
Using the AgentFinder as EntryPoint is an exception/abomination for 10 only.
An entrypoint is where the programm execution starts.
getAgentByClassName(string $class_name)
Get an agent by class name.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getComponentAgents()
Collect core agents from the system bundled in a collection.
getAgents()
Collect all agents from the system, core and plugin, bundled in a collection.
getAgentNameByClassName(string $class_name)
Derive a name for the agent based on a class name.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...