Skip to content

Commit

Permalink
Merge branch 'release/v1.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
midnight-coding committed May 8, 2020
2 parents bfd27d9 + 62a64fe commit b388bc8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a

## [Unreleased]

## [1.2.2] - 2020-05-09

### Changed
- Updated readme.md reflecting transfer of repo to Github username custom-dev-tools.
- Updated version number.

## [1.2.1] - 2019-05-20

### Changed
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# WampServer PHP CLI Version Changer

[![GitHub version](https://img.shields.io/github/tag/midnight-coding/WampServer-PHP-CLI-Version-Changer.svg?label=WampServer-PHP-CLI-Version-Changer&logo=github)](https://github.com/midnight-coding/WampServer-PHP-CLI-Version-Changer/releases) ![Maintained](https://img.shields.io/static/v1.svg?label=maintened&message=yes&color=informational&logo=github) [![Stars](https://img.shields.io/github/stars/midnight-coding/WampServer-PHP-CLI-Version-Changer.svg?color=brightgreen&logo=github)](https://github.com/midnight-coding/WampServer-PHP-CLI-Version-Changer/stargazers)
[![GitHub version](https://img.shields.io/github/tag/custom-dev-tools/WampServer-PHP-CLI-Version-Changer.svg?label=WampServer-PHP-CLI-Version-Changer&logo=github)](https://github.com/custom-dev-tools/WampServer-PHP-CLI-Version-Changer/releases) ![Maintained](https://img.shields.io/static/v1.svg?label=maintened&message=yes&color=informational&logo=github) [![Stars](https://img.shields.io/github/stars/custom-dev-tools/WampServer-PHP-CLI-Version-Changer.svg?color=brightgreen&logo=github)](https://github.com/custom-dev-tools/WampServer-PHP-CLI-Version-Changer/stargazers)

[![GitHub License](https://img.shields.io/github/license/midnight-coding/WampServer-PHP-CLI-Version-Changer.svg?color=informational&logo=github)](https://github.com/midnight-coding/WampServer-PHP-CLI-Version-Changer/blob/master/LICENSE-MIT) [![GitHub last commit](https://img.shields.io/github/last-commit/midnight-coding/WampServer-PHP-CLI-Version-Changer.svg?logo=github)](https://github.com/midnight-coding/grunt-cache-killer/commits/master) [![GitHub open issues](https://img.shields.io/github/issues-raw/midnight-coding/WampServer-PHP-CLI-Version-Changer.svg?color=brightgreen&logo=github)](https://github.com/midnight-coding/WampServer-PHP-CLI-Version-Changer/issues?q=is%3Aopen+is%3Aissue) [![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/midnight-coding/WampServer-PHP-CLI-Version-Changer.svg?color=brightgreen&logo=github)](https://github.com/midnight-coding/WampServer-PHP-CLI-Version-Changer/issues?q=is%3Aissue+is%3Aclosed)
[![GitHub License](https://img.shields.io/github/license/custom-dev-tools/WampServer-PHP-CLI-Version-Changer.svg?color=informational&logo=github)](https://github.com/custom-dev-tools/WampServer-PHP-CLI-Version-Changer/blob/master/LICENSE) [![GitHub last commit](https://img.shields.io/github/last-commit/custom-dev-tools/WampServer-PHP-CLI-Version-Changer.svg?logo=github)](https://github.com/custom-dev-tools/WampServer-PHP-CLI-Version-Change/commits/master) [![GitHub open issues](https://img.shields.io/github/issues-raw/custom-dev-tools/WampServer-PHP-CLI-Version-Changer.svg?color=brightgreen&logo=github)](https://github.com/custom-dev-tools/WampServer-PHP-CLI-Version-Changer/issues?q=is%3Aopen+is%3Aissue) [![GitHub closed issues](https://img.shields.io/github/issues-closed-raw/custom-dev-tools/WampServer-PHP-CLI-Version-Changer.svg?color=brightgreen&logo=github)](https://github.com/custom-dev-tools/WampServer-PHP-CLI-Version-Changer/issues?q=is%3Aissue+is%3Aclosed)

WampServer PHP CLI Version Changer is a Microsoft Windows batch script that allows you to easily change between installed WampServer PHP CLI versions using the users environment 'path' variable.

Expand Down
16 changes: 8 additions & 8 deletions cli_changer.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ rem +------------------------------------------------+
rem ---------------------
rem Default Variables
rem ---------------------
set $scriptVersion=1.2.1
set $scriptVersion=1.2.2

set $defaultInstallPath[0]=C:\wamp
set $defaultInstallPath[1]=C:\wamp64
Expand Down Expand Up @@ -138,7 +138,7 @@ for /L %%a in (1,1,%$lastUsersEnvironmentalPathArrayId%) do (

rem Iterate through the available PHP versions array.
for /L %%b in (1,1,%$lastAvailablePhpVersionsArrayId%) do (

rem Check if the users environmental path string matches the (combined) full path of the available PHP version string.
if "!$usersEnvironmentalPathArray[%%a]!"=="%$pathToPhpFolders%\!$availablePhpVersionsArray[%%b]!" (
rem Force the 'for' command parameters into type 'integer'.
Expand All @@ -164,7 +164,7 @@ if "%~1" neq "" (

rem Iterate through the available PHP versions array.
for /L %%a in (1,1,%$lastAvailablePhpVersionsArrayId%) do (

rem If a matching installed PHP folder name is found, set the new selection id.
if "%1"=="!$availablePhpVersionsArray[%%a]!" (
set $newSelectionId=%%a
Expand Down Expand Up @@ -210,7 +210,7 @@ for /L %%a in (1,1,%$lastAvailablePhpVersionsArrayId%) do (

rem Prompt the user to make a new selection.
echo:
set /p $newSelectionId=%backspace% Selection (1-%$lastAvailablePhpVersionsArrayId%):
set /p $newSelectionId=%backspace% Selection (1-%$lastAvailablePhpVersionsArrayId%):
echo:


Expand Down Expand Up @@ -241,21 +241,21 @@ set "$usersEnvironmentalPathString="
rem Iterate through the users environmental path array.
for /L %%a in (1,1,%$lastUsersEnvironmentalPathArrayId%) do (

rem Remove any trailing slash.
rem Remove any trailing slash.
if !$usersEnvironmentalPathArray[%%a]:~-1! equ \ (
set $path=!$usersEnvironmentalPathArray[%%a]:~0,-1!
) else (
set $path=!$usersEnvironmentalPathArray[%%a]!
)

rem Get the last segment of the path.
for %%b in (!$path!) do (
set $segment=%%~nxb
)

rem Check the segment for a matching regex expression. IE: Any PHP folder.
echo !$segment! | findstr /R /C:"^php[1-9][0-9]*\.[0-9][0-9]*\.*[0-9]*[0-9]*" >nul

rem If a match is not found, append the path to the users environmental path string.
if !errorlevel! neq 0 (
set $usersEnvironmentalPathString=!$usersEnvironmentalPathString!!$usersEnvironmentalPathArray[%%a]!;
Expand Down

0 comments on commit b388bc8

Please sign in to comment.