◆ addPlugin()
ilComponentBuildPluginInfoObjective::addPlugin |
( |
array & |
$data, |
|
|
string |
$type, |
|
|
string |
$component, |
|
|
string |
$slot, |
|
|
string |
$plugin |
|
) |
| |
|
protected |
Definition at line 57 of file class.ilComponentBuildPluginInfoObjective.php.
References $id, $ilias_max_version, $ilias_min_version, $learning_progress, XapiProxy\$plugin, $responsible, $responsible_mail, $supports_export, $type, $version, buildPluginPath(), and fileExists().
Referenced by build().
60 $plugin_php = $plugin_path . static::PLUGIN_PHP;
62 throw new \RuntimeException(
63 "Cannot read $plugin_php." 67 $plugin_class = $plugin_path . sprintf(static::PLUGIN_CLASS_FILE,
$plugin);
69 throw new \RuntimeException(
70 "Cannot read $plugin_class." 74 require_once($plugin_php);
76 throw new \InvalidArgumentException(
"$path does not define \$id");
79 throw new \InvalidArgumentException(
"$path does not define \$version");
82 throw new \InvalidArgumentException(
"$path does not define \$ilias_min_version");
85 throw new \InvalidArgumentException(
"$path does not define \$ilias_max_version");
89 throw new \RuntimeException(
90 "Plugin with id $id already exists." 106 $supports_cli_setup ?? null
buildPluginPath(string $type, string $component, string $slot, string $plugin)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
◆ build()
ilComponentBuildPluginInfoObjective::build |
( |
| ) |
|
Definition at line 33 of file class.ilComponentBuildPluginInfoObjective.php.
References $data, XapiProxy\$plugin, $type, addPlugin(), isDir(), isDotFile(), and scanDir().
36 foreach ([
"Modules",
"Services"] as
$type) {
37 $components = $this->
scanDir(static::BASE_PATH . $type);
38 foreach ($components as $component) {
40 || ! $this->
isDir(static::BASE_PATH .
"$type/$component"))
continue;
41 $slots = $this->
scanDir(static::BASE_PATH .
"$type/$component");
42 foreach ($slots as $slot) {
44 || ! $this->
isDir(static::BASE_PATH .
"$type/$component/$slot"))
continue;
45 $plugins = $this->
scanDir(static::BASE_PATH .
"$type/$component/$slot");
48 || ! $this->
isDir(static::BASE_PATH .
"$type/$component/$slot/$plugin"))
continue;
54 return new Setup\Artifact\ArrayArtifact(
$data);
addPlugin(array &$data, string $type, string $component, string $slot, string $plugin)
◆ buildPluginPath()
ilComponentBuildPluginInfoObjective::buildPluginPath |
( |
string |
$type, |
|
|
string |
$component, |
|
|
string |
$slot, |
|
|
string |
$plugin |
|
) |
| |
|
protected |
◆ fileExists()
ilComponentBuildPluginInfoObjective::fileExists |
( |
string |
$path | ) |
|
|
protected |
◆ getArtifactPath()
ilComponentBuildPluginInfoObjective::getArtifactPath |
( |
| ) |
|
◆ isDir()
ilComponentBuildPluginInfoObjective::isDir |
( |
string |
$dir | ) |
|
|
protected |
◆ isDotFile()
ilComponentBuildPluginInfoObjective::isDotFile |
( |
string |
$file | ) |
|
|
protected |
◆ scanDir()
ilComponentBuildPluginInfoObjective::scanDir |
( |
string |
$dir | ) |
|
|
protected |
◆ BASE_PATH
const ilComponentBuildPluginInfoObjective::BASE_PATH = "./Customizing/global/plugins/" |
|
protected |
◆ PLUGIN_CLASS_FILE
const ilComponentBuildPluginInfoObjective::PLUGIN_CLASS_FILE = "classes/class.il%sPlugin.php" |
|
protected |
◆ PLUGIN_PHP
const ilComponentBuildPluginInfoObjective::PLUGIN_PHP = "plugin.php" |
|
protected |
The documentation for this class was generated from the following file: