19declare(strict_types=1);
32 protected static function saveName(
string $name): string
34 return strtolower((
string) preg_replace(
'/[^a-zA-Z0-9_]/',
'_', $name));
37 final public static function PATH(): string
39 return realpath(__DIR__ .
'/../../../../../public/data/')
49 return $this->
build();
72 final protected function getPath(): string
74 return static::PATH();
79 $artifact = $this->
buildIn($environment);
85 file_put_contents(
$path, $artifact->serialize());
97 $dir = pathinfo(
$path)[
"dirname"];
98 if (!file_exists($dir) && (!mkdir($dir, 0755,
true) && !is_dir($dir))) {
99 throw new \RuntimeException(sprintf(
'Directory "%s" was not created', $dir));
getHash()
Get a hash for this objective.
isNotable()
Get to know if this is an interesting objective for a human.
static saveName(string $name)
makeDirectoryFor(string $path)
isApplicable(Environment $environment)
Get to know whether the objective is applicable.
getPreconditions(Environment $environment)
Objectives might depend on other objectives.
getLabel()
Get a label that describes this objective.
achieve(Environment $environment)
Objectives can be achieved.
buildIn(Environment $env)
An artifact is some file that is build on demand per installation and is not shipped with the ILIAS s...
An environment holds resources to be used in the setup process.
An objective is a desired state of the system that is supposed to be created by the setup.