ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
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)
 @inheritdocs More...
 
 isApplicable (Setup\Environment $environment)
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\Setup\Objective\DirectoryCreatedObjective
 __construct (string $path, int $permissions=self::DEFAULT_DIRECTORY_PERMISSIONS)
 
 getHash ()
 Uses hashed Path. More...
 
 getLabel ()
 Defaults to "Build $this->getArtifactPath()". More...
 
 isNotable ()
 Defaults to 'true'. More...
 
 getPreconditions (Setup\Environment $environment)
 @inheritdocs More...
 
 achieve (Setup\Environment $environment)
 @inheritdocs More...
 
 isApplicable (Setup\Environment $environment)
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\Setup\Objective
 getHash ()
 Get a hash for this objective. More...
 
 getLabel ()
 Get a label that describes this objective. More...
 
 isNotable ()
 Get to know if this is an interesting objective for a human. More...
 
 getPreconditions (Environment $environment)
 Objectives might depend on other objectives. More...
 
 achieve (Environment $environment)
 Objectives can be achieved. More...
 
 isApplicable (Environment $environment)
 Get to know whether the objective is applicable. More...
 

Protected Member Functions

 buildStorageBasePath (Setup\Environment $environment)
 

Protected Attributes

string $base_dir = StorageHandlerFactory::BASE_DIRECTORY
 
array $storage_handler_ids
 
- Protected Attributes inherited from ILIAS\Setup\Objective\DirectoryCreatedObjective
string $path
 
int $permissions
 

Additional Inherited Members

- Data Fields inherited from ILIAS\Setup\Objective\DirectoryCreatedObjective
const DEFAULT_DIRECTORY_PERMISSIONS = 0755
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilStorageContainersExistingObjective::__construct ( array  $storage_handler_ids = null)

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

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)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ achieve()

ilStorageContainersExistingObjective::achieve ( Setup\Environment  $environment)

@inheritdocs

Reimplemented from ILIAS\Setup\Objective\DirectoryCreatedObjective.

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

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 }

References buildStorageBasePath().

+ Here is the call graph for this function:

◆ buildStorageBasePath()

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

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

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

References $base_dir, $client_id, and $ini.

Referenced by achieve(), and isApplicable().

+ Here is the caller graph for this function:

◆ getPreconditions()

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

Reimplemented from ILIAS\Setup\Objective\DirectoryCreatedObjective.

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

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

References $config.

◆ isApplicable()

ilStorageContainersExistingObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

Reimplemented from ILIAS\Setup\Objective\DirectoryCreatedObjective.

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

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 }

References buildStorageBasePath().

+ 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: