ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
CanCreateDirectoriesInDirectoryCondition.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 2019 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4 
5 namespace ILIAS\Setup;
6 
8 {
9  const PROBE_NAME = "probe_for_directory_creation";
10 
11  public function __construct($which)
12  {
13  return parent::__construct(
14  "Can create directories in '$which'",
15  function (Environment $env) use ($which) : bool {
16  $probe = $which . "/" . self::PROBE_NAME;
17  if (!@mkdir($probe, 0774)) {
18  return false;
19  }
20  rmdir($probe);
21  return true;
22  },
23  "ILIAS needs to be able to create directories in '$which'."
24  );
25  }
26 }
A condition that can&#39;t be met by ILIAS itself needs to be met by some external means.
An environment holds resources to be used in the setup process.
Definition: Environment.php:11
__construct(Container $dic, ilPlugin $plugin)