Skip to content

Commit

Permalink
Merge pull request #1148 from phpbrew/1.25
Browse files Browse the repository at this point in the history
Merge branch '1.25'
  • Loading branch information
morozov committed Jan 8, 2020
2 parents fdb3cc9 + 1b84bd9 commit 5ec78e0
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 30 deletions.
Binary file modified phpbrew
Binary file not shown.
26 changes: 13 additions & 13 deletions phpbrew.asc
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAABAgAGBQJeC3MWAAoJEDdOra9UOumVb78P/3NmeIih+EGMYhIUvJhasT12
VssX9lChbsLIw/W7ZLGn1dUat8aTLozaOyZJEZXTLd8zmCipx8einlsF133/XcvA
jIMUHgqsZ7Gvl/HEJ1MP8lJ7bRZGbtTsk4tOYDtk69Bm1plGWeh1R23cxC4iGh6G
62JRAtOLdUkN3x6ya2Vckh0icxxgzPDAN5Wv0MW+Gg73jcFPbGMjy9Ega3zQIVUI
Hxa1Jej8fczGvPTzlr5uBWJXi9FUuIaD29SCyl1oC4gGpCgR0AMA/eQNzDYmBGmf
seX9r2n/DcGjm+T5AnIyYoqb/gqf6xmfYwpWrGKJQI47aWbK1rb95L2bTBJixouz
wExGHxpYXrBFzxq1JN3fhHPzUQpmXQQyjun+rQUMq0EzA5zNPTWRFq25SPB8NxJ3
jTG9xOUv1SYVhonI94h4Nl3zBRZzCJn+jOQzUlGBPUBnSsXYD6vFMk1IiRm1N3jy
kedoMJYuDI1pcq1I7Q1fcz2St8T4RM+uAkwPhm9SLNNtZ9a4WyZE64itNbAHHMRg
JUq+LAoYM9rKPIoldqACruvGfxqg8MOv+wlGgA00pRuSIxHWFV8lHpg606df8Uwt
qOtlZfi0b4LdFro/gqquL6LatI3WqrY4ddEJwzRsN8uKw2h+C5cCuvMBcK3CaxeF
YqAWqqQgSiJOUgwj95XH
=iklF
iQIcBAABAgAGBQJeFVI9AAoJEDdOra9UOumVGXwP/ji4sozHdyswlNmyQ9NHqvrC
PlfgQ1tUb7/ETkW1IvcgMNhoBFICSm7GKpRYFzQxCJCl1+HtV0adYKCSbzuNOw9g
UGbn0ZIIS57yanYdPJLejQ1yO8ISkIEHawTAIUQONbpPIP9rb3QP0jQ9E4wM+oGs
VE2uG/xAcLPNPThCdKkc5pGlgd2xq3iiwcHSpymToITIYojzMgam2LR43CafNh11
H7yoFDKnfOZT2RWOqklA5pcEby9z9mPfhDR3TbxZR/hLRvAAC/nSj93rfU7P9Y5M
LIBGhiOBdLV9rl7IGdXIZxlYoHKqbp8W+2AQOZHzZ4gOoH85DjPcvtO3IZo5b/Vh
lZzhrosmucy1F3sjaGzlO7sGFbsf0xoJ10OEtFnEphbLQwhM3A+Mve3TMmR13r6A
aYBvFlVctmxg728E/tsyJq2r18JXkaftzpb3ZFcvuBKVC6WBy2vkQyW+1C71eEa8
rqIYInyMlXKJrx1U9kjyvJBbTWXGyuh27ko2bs+s8NZoyRqJwQws21oHTq1VmzTH
BEGBxgbmvZWJdW4LVXh5zam5IJiyzalTYXhpG/jGBvzAyoFMlddrU6OCPmA+XSB1
ILpcgnHR1ezJ4q+7SMbHrRWnou4SBzPEU55tH5mOgmSRt+A301FZl3Mo1O0Hw9xO
zGfc7S4goBH52v7ZRjnI
=C5JH
-----END PGP SIGNATURE-----
25 changes: 12 additions & 13 deletions shell/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@
# PHPBREW_PATH: the bin path of the current php.
# PHPBREW_SYSTEM_PHP: the path to the system php binary.

[[ -z "$PHPBREW_ROOT" ]] && export PHPBREW_ROOT="$HOME/.phpbrew"
[[ -z "$PHPBREW_HOME" ]] && export PHPBREW_HOME="$HOME/.phpbrew"

# The minimal PHP version that PhpBrew supports as interpreter
MIN_PHP_VERSION="7.2.0"
MIN_PHP_VERSION_ID=70200

# Returns the absolute path corresponding to the command excluding the alias
function __phpbrew_which()
{
command which "$1"
}

# Executes the given command via the PHP implementation
function __phpbrew_php_exec()
{
Expand All @@ -27,13 +34,7 @@ function __phpbrew_php_exec()
if [[ -e bin/phpbrew ]] ; then
cmd=bin/phpbrew
else
# If in Zsh, use the `whence' builtin instead of `which' to avoid
# the resolution of `phpbrew' to the function declared in this file
if command -v whence > /dev/null ; then
cmd=$(whence -p phpbrew)
else
cmd=$(which phpbrew)
fi
cmd="$(__phpbrew_which phpbrew)"
fi

# Force the usage of the system PHP interpreter if it's set
Expand Down Expand Up @@ -113,11 +114,9 @@ function __phpbrew_can_use_build()

function __phpbrew_set_path()
{
[[ -n $(alias php 2>/dev/null) ]] && unalias php 2> /dev/null

local PATH_WITHOUT_PHPBREW

if [[ -n $PHPBREW_ROOT ]] ; then
if [[ -n "$PHPBREW_ROOT" ]] ; then
PATH_WITHOUT_PHPBREW=$(p=$(echo $PATH | tr ":" "\n" | grep -v "^$PHPBREW_ROOT" | tr "\n" ":"); echo ${p%:})
else
PATH_WITHOUT_PHPBREW=$PATH
Expand All @@ -144,8 +143,8 @@ if [[ -z "$PHPBREW_SKIP_INIT" ]]; then
__phpbrew_load_user_config
fi

[[ -e "$PHPBREW_ROOT" ]] || mkdir $PHPBREW_ROOT
[[ -e "$PHPBREW_HOME" ]] || mkdir $PHPBREW_HOME
[[ -e "$PHPBREW_ROOT" ]] || mkdir "$PHPBREW_ROOT"
[[ -e "$PHPBREW_HOME" ]] || mkdir "$PHPBREW_HOME"

# When setting lookup prefix, the alias name will be translated into the real
# path.
Expand Down Expand Up @@ -408,7 +407,7 @@ function phpbrew ()
fi
;;
system-off)
__phpbrew_validate_interpreter "$(which php)"
__phpbrew_validate_interpreter "$(__phpbrew_which php)"

if [[ $? -ne 0 ]] ; then
echo "The currently used PHP build $PHPBREW_PHP cannot be used as PhpBrew interpreter"
Expand Down
10 changes: 8 additions & 2 deletions shell/phpbrew.fish
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ end
set MIN_PHP_VERSION "7.2.0"
set MIN_PHP_VERSION_ID 70200

# Returns the absolute path corresponding to the command excluding the alias
function __phpbrew_which
command which $argv
end

# Executes the given command via the PHP implementation
function __phpbrew_php_exec
# Force the usage of the system PHP interpreter if it's set
Expand All @@ -78,7 +83,7 @@ function __phpbrew_php_exec
if [ -e bin/phpbrew ]
set -a cmd bin/phpbrew
else
set -a cmd (which phpbrew)
set -a cmd (__phpbrew_which phpbrew)
end

command $cmd $argv
Expand Down Expand Up @@ -359,7 +364,7 @@ function phpbrew
end

case system-off
if not __phpbrew_validate_interpreter (which php)
if not __phpbrew_validate_interpreter (__phpbrew_which php)
echo "The currently used PHP build $PHPBREW_PHP cannot be used as PhpBrew interpreter"
echo "Please execute `phpbrew switch` using PHP $MIN_PHP_VERSION or newer before switching the system interpreter off"
return 1
Expand Down Expand Up @@ -606,6 +611,7 @@ function __fish_phpbrew_arg_meta
__phpbrew_php_exec meta --flat $argv[1] arg $argv[2] $argv[3] | grep -v "^#"
end

[ -z "$PHPBREW_ROOT" ]; and set -gx PHPBREW_ROOT "$HOME/.phpbrew"
[ -z "$PHPBREW_HOME" ]; and set -gx PHPBREW_HOME "$HOME/.phpbrew"

if [ -z "$PHPBREW_SKIP_INIT" ]
Expand Down
2 changes: 1 addition & 1 deletion src/PhpBrew/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class Console extends Application
{
const NAME = 'phpbrew';
const VERSION = '1.25.2';
const VERSION = '1.25.3';

public function options($opts)
{
Expand Down
2 changes: 1 addition & 1 deletion src/PhpBrew/VariantBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public function __construct()
));

if ($prefix !== null) {
$params = $params->withOption('--with-onig', $prefix);
$params = $params->withPkgConfigPath($prefix . '/lib/pkgconfig');
}
}

Expand Down

0 comments on commit 5ec78e0

Please sign in to comment.