ILIAS  release_8 Revision v8.23
ilFileSystemComponentDataDirectoryCreatedObjective Class Reference
+ Inheritance diagram for ilFileSystemComponentDataDirectoryCreatedObjective:
+ Collaboration diagram for ilFileSystemComponentDataDirectoryCreatedObjective:

Public Member Functions

 __construct (string $component_dir, int $base_location=self::DATADIR)
 
 getHash ()
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 

Data Fields

const DATADIR = 1
 
const WEBDIR = 2
 

Protected Member Functions

 buildPath (Setup\Environment $environment)
 

Protected Attributes

string $component_dir
 
int $base_location
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilFileSystemComponentDataDirectoryCreatedObjective::__construct ( string  $component_dir,
int  $base_location = self::DATADIR 
)

Member Function Documentation

◆ achieve()

ilFileSystemComponentDataDirectoryCreatedObjective::achieve ( Setup\Environment  $environment)

Definition at line 89 of file class.ilFileSystemComponentDataDirectoryCreatedObjective.php.

References buildPath().

89  : Setup\Environment
90  {
91  $this->path = $this->buildPath($environment);
92  return parent::achieve($environment);
93  }
+ Here is the call graph for this function:

◆ buildPath()

ilFileSystemComponentDataDirectoryCreatedObjective::buildPath ( Setup\Environment  $environment)
protected

Definition at line 47 of file class.ilFileSystemComponentDataDirectoryCreatedObjective.php.

References $client_id, $component_dir, $data_dir, and $ini.

Referenced by achieve(), and isApplicable().

47  : ?string
48  {
49  $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
50  $client_id = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_ID);
51 
52  if ($ini === null || $client_id === null) {
53  return null;
54  }
55 
56  if ($this->base_location === self::DATADIR) {
57  $data_dir = $ini->readVariable('clients', 'datadir');
58  } elseif ($this->base_location === self::WEBDIR) {
59  $data_dir = dirname(__DIR__, 4) . "/data";
60  }
61  if (!isset($data_dir)) {
62  throw new LogicException('cannot determine base directory');
63  }
64 
65  $client_data_dir = $data_dir . '/' . $client_id;
66  $new_dir = $client_data_dir . '/' . $this->component_dir;
67  return $new_dir;
68  }
$client_id
Definition: ltiauth.php:68
$ini
Definition: raiseError.php:4
+ Here is the caller graph for this function:

◆ getHash()

ilFileSystemComponentDataDirectoryCreatedObjective::getHash ( )

Definition at line 42 of file class.ilFileSystemComponentDataDirectoryCreatedObjective.php.

42  : string
43  {
44  return hash("sha256", self::class . "::" . $this->component_dir . $this->base_location);
45  }

◆ getPreconditions()

ilFileSystemComponentDataDirectoryCreatedObjective::getPreconditions ( Setup\Environment  $environment)
Returns
[]|[]

Definition at line 73 of file class.ilFileSystemComponentDataDirectoryCreatedObjective.php.

References $config.

73  : array
74  {
75  // case if it is a fresh ILIAS installation
76  if ($environment->hasConfigFor("filesystem")) {
77  $config = $environment->getConfigFor("filesystem");
78  return [
80  ];
81  }
82 
83  // case if ILIAS is already installed
84  return [
86  ];
87  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85

◆ isApplicable()

ilFileSystemComponentDataDirectoryCreatedObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 98 of file class.ilFileSystemComponentDataDirectoryCreatedObjective.php.

References $path, and buildPath().

98  : bool
99  {
100  if (($path = $this->buildPath($environment)) === null) {
101  return false;
102  }
103  $this->path = $path;
104  return parent::isApplicable($environment);
105  }
$path
Definition: ltiservices.php:32
+ Here is the call graph for this function:

Field Documentation

◆ $base_location

int ilFileSystemComponentDataDirectoryCreatedObjective::$base_location
protected

◆ $component_dir

string ilFileSystemComponentDataDirectoryCreatedObjective::$component_dir
protected

◆ DATADIR

const ilFileSystemComponentDataDirectoryCreatedObjective::DATADIR = 1

◆ WEBDIR


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