ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PublicAssetsBuildObjective.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use ILIAS\Setup;
25
27{
28 public function __construct(
29 protected PublicAssetManager $public_asset_manager,
30 protected array $public_assets
31 ) {
32 }
33
34 public function getHash(): string
35 {
36 return hash("sha256", self::class);
37 }
38
39 public function getLabel(): string
40 {
41 return "The public folder is populated with all required assets.";
42 }
43
44 public function isNotable(): bool
45 {
46 return true;
47 }
48
49 public function getPreconditions(Setup\Environment $environment): array
50 {
51 return [];
52 }
53
54 public function achieve(Setup\Environment $environment): Setup\Environment
55 {
56 $base_dir = realpath(__DIR__ . "/../../../../../");
57 $target = realpath($base_dir) . "/public";
58
59 $this->public_asset_manager->addAssets(...$this->public_assets);
60 $this->public_asset_manager->buildPublicFolder($base_dir, $target);
61
62 return $environment;
63 }
64
65 public function isApplicable(Setup\Environment $environment): bool
66 {
67 return true;
68 }
69
70}
Will take care of the public assets, just like a good manager does.
isNotable()
Get to know if this is an interesting objective for a human.
getLabel()
Get a label that describes this objective.
__construct(protected PublicAssetManager $public_asset_manager, protected array $public_assets)
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
An objective is a desired state of the system that is supposed to be created by the setup.
Definition: Objective.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...