ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
CanCreateFilesInDirectoryCondition.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
5namespace ILIAS\Setup;
6
8{
9 const PROBE_NAME = "probe_for_file_creation";
10
11 public function __construct($which)
12 {
14 "Can create files in '$which'",
15 function (Environment $env) use ($which) : bool {
16 $probe = $which . "/" . self::PROBE_NAME;
17 if (!@file_put_contents($probe, self::PROBE_NAME)) {
18 return false;
19 }
20 $success = @file_get_contents($probe) == self::PROBE_NAME;
21 unlink($probe);
22 return $success;
23 },
24 "ILIAS needs to be able to create files in '$which'."
25 );
26 }
27}
$success
Definition: Utf8Test.php:86
An exception for terminatinating execution or to throw for unit testing.
A condition that can'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:12
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc