ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
PHPVersionCondition.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Setup\Condition;
22
23use 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 fn (Setup\Environment $env): bool =>
35 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}
A condition that can't be met by ILIAS itself needs to be met by some external means.
__construct(string $min_version, ?string $max_version=null, bool $block_setup=false)
const ILIAS_VERSION_NUMERIC
An environment holds resources to be used in the setup process.
Definition: Environment.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...