Skip to content

Commit 847bb2c

Browse files
committed
Turned the interpreter version restriction into a deprecation
1 parent 1a6d5d0 commit 847bb2c

File tree

3 files changed

+4
-22
lines changed

3 files changed

+4
-22
lines changed

bin/phpbrew

+4-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
#!/usr/bin/env php
22
<?php
33

4-
if (PHP_VERSION_ID < 70200) {
5-
fwrite(
6-
STDERR,
7-
sprintf(
8-
'This version of PHPBrew is supported on PHP 7.2.0 or newer' . PHP_EOL .
9-
'You are using PHP %s (%s).' . PHP_EOL,
10-
PHP_VERSION,
11-
PHP_BINARY
12-
)
13-
);
14-
15-
die(1);
4+
if (PHP_VERSION_ID < 70200 && function_exists('posix_isatty') && posix_isatty(STDOUT)) {
5+
fwrite(STDOUT, "\033[33mWarning! The usage of PHP older than 7.2.0 as the interpreter is deprecated.\n");
6+
fwrite(STDOUT, "Please set the system interpreter using \033[0m'phpbrew system <version>'\033[33m.\n");
7+
fwrite(STDOUT, "See https://github.com/phpbrew/phpbrew/wiki/System-Interpreter for details.\033[0m\n");
168
}
179

1810
$includeIfExists = function($file)

shell/bashrc

-4
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,6 @@ function phpbrew ()
205205
else
206206
local PHP_BUILD=$(__phpbrew_normalize_build $2)
207207

208-
__phpbrew_can_use_build $PHP_BUILD || return 1
209-
210208
# checking if php source exists
211209
NEW_PHPBREW_PHP_PATH="$PHPBREW_ROOT/php/$PHP_BUILD"
212210
if [ -d $NEW_PHPBREW_PHP_PATH ]; then
@@ -236,8 +234,6 @@ function phpbrew ()
236234
else
237235
local PHP_BUILD=$(__phpbrew_normalize_build $2)
238236

239-
__phpbrew_can_use_build $PHP_BUILD || return 1
240-
241237
__phpbrew_reinit $PHP_BUILD
242238
fi
243239
;;

shell/phpbrew.fish

-6
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,6 @@ function phpbrew
183183
else
184184
set PHP_BUILD (__phpbrew_normalize_build $argv[2])
185185

186-
__phpbrew_can_use_build $PHP_BUILD
187-
or return 1
188-
189186
# checking if php source exists
190187
set NEW_PHPBREW_PHP_PATH "$PHPBREW_ROOT/php/$PHP_BUILD"
191188
if [ -d $NEW_PHPBREW_PHP_PATH ]
@@ -213,9 +210,6 @@ function phpbrew
213210
else
214211
set -l build (__phpbrew_normalize_build $argv[2])
215212

216-
__phpbrew_can_use_build $build
217-
or return 1
218-
219213
__phpbrew_reinit $build
220214
end
221215
case lookup-prefix

0 commit comments

Comments
 (0)