ILIAS  release_7 Revision v7.30-3-g800a261c036
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)
 @inheritdocs More...
 
 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

 $base_dir
 
 $storage_handler_ids
 
- Protected Attributes inherited from ILIAS\Setup\Objective\DirectoryCreatedObjective
 $path
 
 $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 22 of file class.ilStorageContainersExistingObjective.php.

23 {
24 parent::__construct(StorageHandlerFactory::BASE_DIRECTORY);
25 $this->storage_handler_ids = $storage_handler_ids ?? $this->storage_handler_ids;
26 $this->base_dir = StorageHandlerFactory::BASE_DIRECTORY;
27 }
__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 55 of file class.ilStorageContainersExistingObjective.php.

55 : Setup\Environment
56 {
57 $base_path = $this->buildStorageBasePath($environment);
58 $this->path = $base_path;
59 $environment = parent::achieve($environment);
60
61 foreach ($this->storage_handler_ids as $storage_handler_id) {
62 $this->path = $base_path . '/' . $storage_handler_id;
63 $environment = parent::achieve($environment);
64 }
65 return $environment;
66 }

References buildStorageBasePath().

+ Here is the call graph for this function:

◆ buildStorageBasePath()

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

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

29 : string
30 {
31 $ini = $environment->getResource(Setup\Environment::RESOURCE_ILIAS_INI);
32 $client_id = $environment->getResource(Setup\Environment::RESOURCE_CLIENT_ID);
33
34 $storage_directory_full_path = $ini->readVariable('clients',
35 'datadir') . '/' . $client_id . '/' . $this->base_dir;
36 return $storage_directory_full_path;
37 }
$ini
Definition: raiseError.php:4
$client_id
Definition: webdav.php:17

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)

@inheritdocs

Reimplemented from ILIAS\Setup\Objective\DirectoryCreatedObjective.

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

39 : array
40 {
41 // case if it is a fresh ILIAS installation
42 if ($environment->hasConfigFor("filesystem")) {
43 $config = $environment->getConfigFor("filesystem");
44 return [
45 new \ilFileSystemDirectoriesCreatedObjective($config)
46 ];
47 }
48
49 // case if ILIAS is already installed
50 return [
51 new \ilIniFilesLoadedObjective()
52 ];
53 }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68

References $config.

◆ isApplicable()

ilStorageContainersExistingObjective::isApplicable ( Setup\Environment  $environment)

@inheritDoc

Reimplemented from ILIAS\Setup\Objective\DirectoryCreatedObjective.

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

71 : bool
72 {
73 $base_path = $this->buildStorageBasePath($environment);
74 $this->path = $base_path;
75 if (parent::isApplicable($environment)) {
76 return true;
77 }
78
79 foreach ($this->storage_handler_ids as $storage_handler_id) {
80 $this->path = $base_path . '/' . $storage_handler_id;
81 if (parent::isApplicable($environment)) {
82 return true;
83 }
84 }
85 return false;
86 }

References buildStorageBasePath().

+ Here is the call graph for this function:

Field Documentation

◆ $base_dir

ilStorageContainersExistingObjective::$base_dir
protected

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

Referenced by buildStorageBasePath().

◆ $storage_handler_ids

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

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

Referenced by __construct().


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