ILIAS  release_8 Revision v8.23
ILIAS\Setup\Condition\CanCreateFilesInDirectoryCondition Class Reference
+ Inheritance diagram for ILIAS\Setup\Condition\CanCreateFilesInDirectoryCondition:
+ Collaboration diagram for ILIAS\Setup\Condition\CanCreateFilesInDirectoryCondition:

Public Member Functions

 __construct (string $which)
 
- Public Member Functions inherited from ILIAS\Setup\Condition\ExternalConditionObjective
 __construct (string $label, \Closure $condition, string $message=null, bool $block_setup=false)
 
 getHash ()
 Get a hash for this objective.The hash of two objectives must be the same, if they are the same objective, with the same config on the same environment, i.e. if the one is achieved the other is achieved as well because they are the same. 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 (Setup\Environment $environment)
 
 achieve (Setup\Environment $environment)
 
 isApplicable (Setup\Environment $environment)
 
- Public Member Functions inherited from ILIAS\Setup\Objective
 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...
 

Data Fields

const PROBE_NAME = "probe_for_file_creation"
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\Setup\Condition\ExternalConditionObjective
string $label
 
Closure $condition
 
string $message
 
bool $block_setup
 

Detailed Description

Definition at line 25 of file CanCreateFilesInDirectoryCondition.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Setup\Condition\CanCreateFilesInDirectoryCondition::__construct ( string  $which)

Definition at line 29 of file CanCreateFilesInDirectoryCondition.php.

References ILIAS\GlobalScreen\Provider\__construct().

30  {
31  return parent::__construct(
32  "Can create files in '$which'",
33  function (Setup\Environment $env) use ($which): bool {
34  $probe = $which . "/" . self::PROBE_NAME;
35  if (!@file_put_contents($probe, self::PROBE_NAME)) {
36  return false;
37  }
38  $success = @file_get_contents($probe) == self::PROBE_NAME;
39  unlink($probe);
40  return $success;
41  },
42  "ILIAS needs to be able to create files in '$which'."
43  );
44  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Field Documentation

◆ PROBE_NAME

const ILIAS\Setup\Condition\CanCreateFilesInDirectoryCondition::PROBE_NAME = "probe_for_file_creation"

Definition at line 27 of file CanCreateFilesInDirectoryCondition.php.


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