-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
PhpVersion.php
36 lines (28 loc) · 917 Bytes
/
PhpVersion.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
/*
* This file is part of Flarum.
*
* For detailed copyright and license information, please view the
* LICENSE file that was distributed with this source code.
*/
namespace Flarum\Install\Prerequisite;
use Illuminate\Support\Collection;
class PhpVersion implements PrerequisiteInterface
{
protected $minVersion;
public function __construct($minVersion)
{
$this->minVersion = $minVersion;
}
public function problems(): Collection
{
$collection = new Collection;
if (version_compare(PHP_VERSION, $this->minVersion, '<')) {
$collection->push([
'message' => "PHP $this->minVersion is required.",
'detail' => 'You are running version '.PHP_VERSION.'. You might want to talk to your system administrator about upgrading to the latest PHP version.',
]);
}
return $collection;
}
}