ILIAS  release_7 Revision v7.30-3-g800a261c036
ilFileSystemComponentDataDirectoryCreatedObjective Class Reference
+ Inheritance diagram for ilFileSystemComponentDataDirectoryCreatedObjective:
+ Collaboration diagram for ilFileSystemComponentDataDirectoryCreatedObjective:

Public Member Functions

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

Data Fields

const DATADIR = 1
 
const WEBDIR = 2
 

Protected Member Functions

 buildPath (Setup\Environment $environment)
 

Protected Attributes

 $path
 
 $component_dir
 
 $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 79 of file class.ilFileSystemComponentDataDirectoryCreatedObjective.php.

79 : Setup\Environment
80 {
81 $this->path = $this->buildPath($environment);
82 return parent::achieve($environment);
83 }

References buildPath().

+ Here is the call graph for this function:

◆ buildPath()

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

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

46 : string
47 {
48 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
49 $client_id = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_ID);
50
51 if ($this->base_location === self::DATADIR) {
52 $data_dir = $ini->readVariable('clients', 'datadir');
53 }
54 if ($this->base_location === self::WEBDIR) {
55 $data_dir = dirname(__DIR__, 4) . "/data";
56 }
57
58 $client_data_dir = $data_dir . '/' . $client_id;
59 $new_dir = $client_data_dir . '/' . $this->component_dir;
60 return $new_dir;
61 }
$ini
Definition: raiseError.php:4
$client_id
Definition: webdav.php:17

References $client_id, $component_dir, and $ini.

Referenced by achieve(), and isApplicable().

+ Here is the caller graph for this function:

◆ getHash()

ilFileSystemComponentDataDirectoryCreatedObjective::getHash ( )

@inheritdocs

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

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

◆ getPreconditions()

ilFileSystemComponentDataDirectoryCreatedObjective::getPreconditions ( Setup\Environment  $environment)

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

63 : array
64 {
65 // case if it is a fresh ILIAS installation
66 if ($environment->hasConfigFor("filesystem")) {
67 $config = $environment->getConfigFor("filesystem");
68 return [
70 ];
71 }
72
73 // case if ILIAS is already installed
74 return [
76 ];
77 }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68

References $config.

◆ isApplicable()

ilFileSystemComponentDataDirectoryCreatedObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

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

88 : bool
89 {
90 $this->path = $this->buildPath($environment);
91 return parent::isApplicable($environment);
92 }

References buildPath().

+ Here is the call graph for this function:

Field Documentation

◆ $base_location

ilFileSystemComponentDataDirectoryCreatedObjective::$base_location
protected

◆ $component_dir

ilFileSystemComponentDataDirectoryCreatedObjective::$component_dir
protected

◆ $path

ilFileSystemComponentDataDirectoryCreatedObjective::$path
protected

◆ DATADIR

const ilFileSystemComponentDataDirectoryCreatedObjective::DATADIR = 1

◆ WEBDIR


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