ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilStorageContainersExistingObjective Class Reference

Class ilStorageContainersExistingObjective. More...

+ Inheritance diagram for ilStorageContainersExistingObjective:
+ Collaboration diagram for ilStorageContainersExistingObjective:

Public Member Functions

 __construct (array $storage_handler_ids=null)
 
 getPreconditions (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 

Protected Member Functions

 buildStorageBasePath (Setup\Environment $environment)
 

Protected Attributes

string $base_dir = StorageHandlerFactory::BASE_DIRECTORY
 
array $storage_handler_ids
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilStorageContainersExistingObjective::__construct ( array  $storage_handler_ids = null)

Definition at line 40 of file class.ilStorageContainersExistingObjective.php.

References $storage_handler_ids, and ILIAS\GlobalScreen\Provider\__construct().

41  {
42  parent::__construct(StorageHandlerFactory::BASE_DIRECTORY);
43  $this->storage_handler_ids = $storage_handler_ids ?? $this->storage_handler_ids;
44  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ achieve()

ilStorageContainersExistingObjective::achieve ( Setup\Environment  $environment)

Definition at line 75 of file class.ilStorageContainersExistingObjective.php.

References buildStorageBasePath().

75  : Setup\Environment
76  {
77  $base_path = $this->buildStorageBasePath($environment);
78  $this->path = $base_path;
79  $environment = parent::achieve($environment);
80 
81  foreach ($this->storage_handler_ids as $storage_handler_id) {
82  $this->path = $base_path . '/' . $storage_handler_id;
83  $environment = parent::achieve($environment);
84  }
85  return $environment;
86  }
+ Here is the call graph for this function:

◆ buildStorageBasePath()

ilStorageContainersExistingObjective::buildStorageBasePath ( Setup\Environment  $environment)
protected

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

References $base_dir, $client_id, and $ini.

Referenced by achieve(), and isApplicable().

46  : string
47  {
48  $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
49  $client_id = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_ID);
50  return $ini->readVariable(
51  'clients',
52  'datadir'
53  ) . '/' . $client_id . '/' . $this->base_dir;
54  }
$client_id
Definition: ltiauth.php:68
$ini
Definition: raiseError.php:4
+ Here is the caller graph for this function:

◆ getPreconditions()

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

Definition at line 59 of file class.ilStorageContainersExistingObjective.php.

References $config.

59  : array
60  {
61  // case if it is a fresh ILIAS installation
62  if ($environment->hasConfigFor("filesystem")) {
63  $config = $environment->getConfigFor("filesystem");
64  return [
65  new \ilFileSystemDirectoriesCreatedObjective($config)
66  ];
67  }
68 
69  // case if ILIAS is already installed
70  return [
71  new \ilIniFilesLoadedObjective()
72  ];
73  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:85

◆ isApplicable()

ilStorageContainersExistingObjective::isApplicable ( Setup\Environment  $environment)

Definition at line 91 of file class.ilStorageContainersExistingObjective.php.

References buildStorageBasePath().

91  : bool
92  {
93  $base_path = $this->buildStorageBasePath($environment);
94  $this->path = $base_path;
95  if (parent::isApplicable($environment)) {
96  return true;
97  }
98 
99  foreach ($this->storage_handler_ids as $storage_handler_id) {
100  $this->path = $base_path . '/' . $storage_handler_id;
101  if (parent::isApplicable($environment)) {
102  return true;
103  }
104  }
105  return false;
106  }
+ Here is the call graph for this function:

Field Documentation

◆ $base_dir

string ilStorageContainersExistingObjective::$base_dir = StorageHandlerFactory::BASE_DIRECTORY
protected

Definition at line 31 of file class.ilStorageContainersExistingObjective.php.

Referenced by buildStorageBasePath().

◆ $storage_handler_ids

array ilStorageContainersExistingObjective::$storage_handler_ids
protected
Initial value:
= [
'fsv2'
]

Definition at line 36 of file class.ilStorageContainersExistingObjective.php.

Referenced by __construct().


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