ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
PHPVersionCondition.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Setup\Condition;
22 
23 use ILIAS\Setup;
24 
26 {
27  public function __construct(
28  string $min_version,
29  ?string $max_version = null,
30  bool $block_setup = false
31  ) {
33  "PHP version >= $min_version and <= $max_version",
34  static function (Setup\Environment $env) use ($min_version, $max_version): bool {
35  return version_compare(phpversion(), $min_version, ">=")
36  && ($max_version !== null && version_compare(phpversion(), $max_version, "<="));
37  },
38  $max_version === null
39  ? "ILIAS " . ILIAS_VERSION_NUMERIC . " requires PHP $min_version - $max_version."
40  : "ILIAS " . ILIAS_VERSION_NUMERIC . " requires PHP $min_version or later.",
42  );
43  }
44 }
const ILIAS_VERSION_NUMERIC
__construct(string $min_version, ?string $max_version=null, bool $block_setup=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
An environment holds resources to be used in the setup process.
Definition: Environment.php:27
__construct(Container $dic, ilPlugin $plugin)
A condition that can&#39;t be met by ILIAS itself needs to be met by some external means.