Skip to content

Commit

Permalink
Updated the version regex to accept alpha, beta and RC suffixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Nov 9, 2016
1 parent e5824f1 commit e46e21c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion shell/bashrc
Expand Up @@ -47,7 +47,7 @@ fi

[[ -z "$PHPBREW_ROOT" ]] && export PHPBREW_ROOT="$HOME/.phpbrew"
[[ -z "$PHPBREW_BIN" ]] && export PHPBREW_BIN="$PHPBREW_HOME/bin"
[[ -z "$PHPBREW_VERSION_REGEX" ]] && export PHPBREW_VERSION_REGEX="^([[:digit:]]+\.){2}[[:digit:]]+$"
[[ -z "$PHPBREW_VERSION_REGEX" ]] && export PHPBREW_VERSION_REGEX="^([[:digit:]]+\.){2}[[:digit:]]+((alpha|beta|RC)[[:digit:]]+)?$"

[[ -e "$PHPBREW_ROOT" ]] || mkdir $PHPBREW_ROOT
[[ -e "$PHPBREW_HOME" ]] || mkdir $PHPBREW_HOME
Expand Down
2 changes: 1 addition & 1 deletion src/PhpBrew/BuildFinder.php
Expand Up @@ -24,7 +24,7 @@ public static function findInstalledBuilds($stripPrefix = true)

if ($stripPrefix) {
$names = array_map(function ($name) {
return preg_replace('/^php-(?=(\d+\.\d+\.\d+)$)/', '', $name);
return preg_replace('/^php-(?=(\d+\.\d+\.\d+((alpha|beta|RC)\d+)?)$)/', '', $name);
}, $names);
}
uasort($names, 'version_compare'); // ordering version name ascending... 5.5.17, 5.5.12
Expand Down

0 comments on commit e46e21c

Please sign in to comment.