ILIAS  release_7 Revision v7.30-3-g800a261c036
ILIAS\Setup\Condition\CanCreateFilesInDirectoryCondition Class Reference
+ Inheritance diagram for ILIAS\Setup\Condition\CanCreateFilesInDirectoryCondition:
+ Collaboration diagram for ILIAS\Setup\Condition\CanCreateFilesInDirectoryCondition:

Public Member Functions

 __construct ($which)
 
- Public Member Functions inherited from ILIAS\Setup\Condition\ExternalConditionObjective
 __construct (string $label, callable $condition, string $message=null)
 
 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
 $label
 
 $condition
 
 $message
 

Detailed Description

Definition at line 9 of file CanCreateFilesInDirectoryCondition.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 13 of file CanCreateFilesInDirectoryCondition.php.

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

14  {
15  return parent::__construct(
16  "Can create files in '$which'",
17  function (Setup\Environment $env) use ($which) : bool {
18  $probe = $which . "/" . self::PROBE_NAME;
19  if (!@file_put_contents($probe, self::PROBE_NAME)) {
20  return false;
21  }
22  $success = @file_get_contents($probe) == self::PROBE_NAME;
23  unlink($probe);
24  return $success;
25  },
26  "ILIAS needs to be able to create files in '$which'."
27  );
28  }
$success
Definition: Utf8Test.php:86
__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 11 of file CanCreateFilesInDirectoryCondition.php.


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