ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\FileDelivery\Setup\BaseDirObjective Class Reference
+ Inheritance diagram for ILIAS\FileDelivery\Setup\BaseDirObjective:
+ Collaboration diagram for ILIAS\FileDelivery\Setup\BaseDirObjective:

Public Member Functions

 getArtifactPath ()
 
 buildIn (Environment $env)
 
 getArtifactName ()
 
 build ()
 
 getPreconditions (Environment $environment)
 Objectives might depend on other objectives. More...
 
- Public Member Functions inherited from ILIAS\Setup\Artifact\BuildArtifactObjective
 getArtifactName ()
 Get the filename where the builder wants to put its artifact. More...
 
 build ()
 Build the artifact based. More...
 
 buildIn (Setup\Environment $env)
 Builds an artifact in some given Environment. More...
 
 getPreconditions (Setup\Environment $environment)
 Defaults to no preconditions. More...
 
 getHash ()
 Uses hashed Path. More...
 
 getLabel ()
 Defaults to 'Build ' . More...
 
 isNotable ()
 Defaults to 'true'. More...
 
 achieve (Setup\Environment $environment)
 Builds the artifact and puts it in its location. More...
 
 isApplicable (Setup\Environment $environment)
 
- Public Member Functions inherited from ILIAS\Setup\Objective
 achieve (Environment $environment)
 Objectives can be achieved. More...
 
 isApplicable (Environment $environment)
 Get to know whether the objective is applicable. More...
 

Static Public Member Functions

static get ()
 
- Static Public Member Functions inherited from ILIAS\Setup\Artifact\BuildArtifactObjective
static PATH ()
 

Data Fields

const BASE_DIR = './src/FileDelivery/artifacts/base_dir.php'
 

Protected Attributes

array $data = []
 
- Protected Attributes inherited from ILIAS\Setup\Artifact\BuildArtifactObjective
const ARTIFACTS = __DIR__ . "/../../../../../artifacts"
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\Setup\Artifact\BuildArtifactObjective
 getPath ()
 
 makeDirectoryFor (string $path)
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 31 of file BaseDirObjective.php.

Member Function Documentation

◆ build()

ILIAS\FileDelivery\Setup\BaseDirObjective::build ( )

Definition at line 61 of file BaseDirObjective.php.

Referenced by ILIAS\FileDelivery\Setup\BaseDirObjective\buildIn().

61  : Artifact
62  {
63  return new ArrayArtifact($this->data);
64  }
+ Here is the caller graph for this function:

◆ buildIn()

ILIAS\FileDelivery\Setup\BaseDirObjective::buildIn ( Environment  $env)

Definition at line 43 of file BaseDirObjective.php.

References ILIAS\$client_id, ILIAS\FileDelivery\Setup\BaseDirObjective\build(), ILIAS\Setup\Environment\getResource(), and ILIAS\Setup\Environment\RESOURCE_ILIAS_INI.

43  : Artifact
44  {
45  $ilias_ini = $env->getResource(Environment::RESOURCE_ILIAS_INI);
46  if ($ilias_ini instanceof \ilIniFile) {
47  $base_dir = $ilias_ini->readVariable('clients', 'datadir');
48  $client_id = $ilias_ini->readVariable('clients', 'default');
49  if (!empty($base_dir) && !empty($client_id)) {
50  $this->data['base_dir'] = rtrim(rtrim($base_dir, '/') . '/' . $client_id, '/') . '/';
51  }
52  }
53  return $this->build();
54  }
string $client_id
Definition: class.ilias.php:36
+ Here is the call graph for this function:

◆ get()

static ILIAS\FileDelivery\Setup\BaseDirObjective::get ( )
static

Definition at line 74 of file BaseDirObjective.php.

References null.

Referenced by ILIAS\FileDelivery\Token\Signer\Payload\ShortFilePayload\__construct(), and ILIAS\FileDelivery\Token\Signer\Payload\ShortFilePayload\getUri().

74  : ?string
75  {
76  static $base;
77 
78  if ($base !== null) {
79  return $base;
80  }
81 
82  if (is_readable(self::PATH())) {
83  $data = require self::PATH();
84  }
85 
86  return $base = $data['base_dir'] ?? null;
87  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ getArtifactName()

ILIAS\FileDelivery\Setup\BaseDirObjective::getArtifactName ( )

Definition at line 56 of file BaseDirObjective.php.

56  : string
57  {
58  return 'base_dir';
59  }

◆ getArtifactPath()

ILIAS\FileDelivery\Setup\BaseDirObjective::getArtifactPath ( )

Definition at line 37 of file BaseDirObjective.php.

37  : string
38  {
39  return self::BASE_DIR;
40  }

◆ getPreconditions()

ILIAS\FileDelivery\Setup\BaseDirObjective::getPreconditions ( Environment  $environment)

Objectives might depend on other objectives.

Exceptions
UnachievableExceptionif the objective is not achievable
Returns
Objective[]

Implements ILIAS\Setup\Objective.

Definition at line 67 of file BaseDirObjective.php.

67  : array
68  {
69  return [
70  new \ilIniFilesLoadedObjective(),
71  ];
72  }

Field Documentation

◆ $data

array ILIAS\FileDelivery\Setup\BaseDirObjective::$data = []
protected

Definition at line 35 of file BaseDirObjective.php.

◆ BASE_DIR

const ILIAS\FileDelivery\Setup\BaseDirObjective::BASE_DIR = './src/FileDelivery/artifacts/base_dir.php'

Definition at line 33 of file BaseDirObjective.php.


The documentation for this class was generated from the following file: