Skip to content

Commit 3260168

Browse files
committed
feat: Add an error for PHP versions below 7.1
1 parent 9602be2 commit 3260168

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bin/doctum.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#!/usr/bin/env php
22
<?php
33

4+
if (PHP_VERSION_ID <= 70100) {
5+
echo 'You need to use PHP 7.1 to run Doctum.' . PHP_EOL;
6+
$majorVersion = (int) (PHP_VERSION_ID / 10000);
7+
$minorVersion = (int) substr((string) PHP_VERSION_ID, -4, 2);
8+
echo 'Current detected version: (' . $majorVersion . '.' . $minorVersion . ') (' . PHP_VERSION_ID . ').' . PHP_EOL;
9+
exit(1);
10+
}
11+
412
// installed via composer?
513
$composerDir = __DIR__ . '/../../../autoload.php';
614
if (file_exists($composerDir)) {

0 commit comments

Comments
 (0)