44 return hash(
"sha256", self::class .
"::" . $this->component_dir . (
string) $this->base_location);
53 if ($this->base_location === self::DATADIR) {
56 if ($this->base_location === self::WEBDIR) {
60 return "Create $dir directory in component directory $this->component_dir";
73 $config = $environment->getConfigFor(
"filesystem");
83 if (!file_exists($path)) {
84 mkdir($path, $this->permissions);
88 "Could not create directory '{$path}'"
96 $common_config = $environment->getConfigFor(
"common");
97 $fs_config = $environment->getConfigFor(
"filesystem");
99 if ($this->base_location === self::DATADIR) {
100 $data_dir = $fs_config->getDataDir();
103 if ($this->base_location === self::WEBDIR) {
104 $data_dir = $fs_config->getWebDir();
107 $client_data_dir = $data_dir .
'/' . $common_config->getClientId();
An exception for terminatinating execution or to throw for unit testing.
Signals that some goal won't be achievable by actions of the system ever.
__construct(string $component_dir, int $base_location=self::DATADIR, int $permissions=self::DEFAULT_DIRECTORY_PERMISSIONS)
achieve(Setup\Environment $environment)
getPreconditions(Setup\Environment $environment)
const DEFAULT_DIRECTORY_PERMISSIONS
buildPath(Setup\Environment $environment)
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.