5 declare(strict_types=1);
73 $plugins = $this->plugin_raw_reader->getPluginNames();
75 foreach ($plugins as $plugin_name) {
76 $agents = $agents->withAdditionalAgent(
77 strtolower($plugin_name),
94 $this->predefined_agents
98 $agent_classes = $this->interface_finder->getMatchingClassNames(
100 [
"[/]Customizing/.*"]
102 foreach ($agent_classes as $class_name) {
103 $agents = $agents->withAdditionalAgent(
126 if (!$this->plugin_raw_reader->hasPlugin($name)) {
127 throw new \InvalidArgumentException(
128 "Cannot find plugin with name '$name'" 135 $path =
"[/]Customizing/global/plugins/.*/.*/" . $name .
"/.*";
136 $agent_classes = iterator_to_array($this->interface_finder->getMatchingClassNames(
142 if (count($agent_classes) === 0) {
148 foreach ($agent_classes as $class_name) {
149 $agents[] =
new $class_name(
156 if (count($agents) === 1) {
168 if (!class_exists($class_name)) {
169 throw new \InvalidArgumentException(
"Class '" . $class_name .
"' not found.");
172 return new $class_name(
187 if (preg_match(
"/il(\w+)SetupAgent/", $class_name, $match)) {
188 return strtolower($match[1]);
An agent that is just a collection of some other agents.
getCoreAgents()
Collect core agents from the system bundled in a collection.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A agent is some component that performs part of the setup process.
getPluginAgent(string $name)
Get a agent from a specific plugin.
__construct(Refinery $refinery, Data\Factory $data_factory, \ilSetupLanguage $lng, ImplementationOfInterfaceFinder $interface_finder, \ilPluginRawReader $plugin_raw_reader, array $predefined_agents=[])
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...
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.