Skip to content

Commit 8fc1c18

Browse files
Merge branch 'release/v1.3.0'
2 parents 6d579cc + 251a122 commit 8fc1c18

File tree

3 files changed

+273
-122
lines changed

3 files changed

+273
-122
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
66

77
## [Unreleased]
88

9+
## [1.3.0] - 2021-07-02
10+
11+
### Added
12+
- Added ability to change PHP version within an open CMD Window session only.
13+
14+
### Updated
15+
- Updated readme.md reflecting the new feature.
16+
- Updated version number.
17+
918
## [1.2.3] - 2020-08-26
1019

1120
### Fixed

README.md

+34-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ WampServer PHP CLI Version Changer is a Microsoft Windows batch script that allo
1414
* [How To Use](#how-to-use)
1515
* [Text Based User Interface (TUI)](#text-based-user-interface-tui)
1616
* [Command Line Interface (CLI)](#command-line-interface-cli)
17+
* [Session Mode](#session-mode)
1718
* [FAQ's](#faqs)
1819

1920
## Minimum Requirements
@@ -26,7 +27,7 @@ The following are required for the CLI Changer script to function correctly.
2627

2728
No installation is required.
2829

29-
At just over 10kB the CLI Changer script is small enough to be saved anywhere in your file system.
30+
At just over 13KB the CLI Changer script is small enough to be saved anywhere in your file system.
3031

3132
**Tip:** Once you have save the CLI Changer script, create a desktop shortcut to it for quick and easy access.
3233

@@ -51,6 +52,7 @@ rem | User Defined Variable(s) |
5152
rem +------------------------------------------------+
5253
5354
rem WampServer custom install path.
55+
rem Note: Trailing slash is not required.
5456
set $customInstallPath=D:\WampServer 64-Bit
5557
```
5658

@@ -62,6 +64,7 @@ There are two ways you can use the CLI Changer script.
6264

6365
* Text based user interface (TUI).
6466
* Command line interface (CLI).
67+
* Session mode
6568

6669
### Text Based User Interface (TUI)
6770

@@ -128,6 +131,31 @@ Following execution, an exit code will be given:
128131

129132
**Tip:** Calling scripts via the command line is common during (automated) development, testing and deployment. EG: Incorporate it into your build files...
130133

134+
#### Session Mode
135+
136+
Should you have the need to only change the PHP version number within an open command window (session) and not across your whole system then you can use the `--temp` option.
137+
138+
From a CMD prompt:
139+
```
140+
C:\>: "C:\path\to\cli_changer.bat" php7.2.3 --temp
141+
```
142+
143+
From a Bash or Powershell prompt:
144+
```
145+
$ start "C:\path\to\cli_changer.bat" php7.2.3 --temp
146+
```
147+
148+
The short command line option `-t` is also available.
149+
150+
**Note:** Enclosing the script path in quotes if it contains spaces and knowing the available PHP CLI version(s) in advance is still required.
151+
152+
Following execution, an exit code will be given:
153+
154+
- `0` - Success
155+
- `1` - Failure
156+
157+
**Note:** Using the `--temp` or `-t` option will only change the PHP version number within that command window. Multiple command windows can be open and the PHP version number changed without affecting other open command windows.
158+
131159
## FAQ's
132160

133161
### What are environment path variables and how do they work?
@@ -136,11 +164,14 @@ Environment 'path' variables allow the user (and system) to call an executable w
136164

137165
When the user (or the user's script) calls `php` or `php.exe`, the path pointing to the executable will be used. If an environment path contains two or more paths to a PHP executable, then only the first one found is executed. The other php executables will never be called, ever.
138166

139-
Based on this information and pursuant to the successful selection of a PHP version number, this script scans and then removes any and all reference to any php executable path(s) found within the environment 'user' path prior to appending the selected PHP version path.
167+
Based on this information and pursuant to the successful selection of a PHP version number, this script scans and then removes any and all reference to any php executable path(s) found within the environment 'user' path (or the cmd window 'session' path) prior to appending the selected PHP version path.
140168

141169
The PHP CLI version number returned by typing `php -v` at the command prompt should be the same as that selected by you when using this script. If it is not, there is a strong chance that there is reference to a PHP executable within the environment 'system' path. To correct this situation, you must remove this reference from the environment 'system' path manually.
142170

143-
Both the environment 'user' and 'system' paths can be accessed by clicking 'Start' -> 'Control Panel' -> 'System' -> 'Advanced system settings' -> 'Environment Variables...'
171+
Access the environment 'user' and 'system' paths by:
172+
173+
* Windows 7: Clicking 'Start' -> 'Control Panel' -> 'System' -> 'Advanced system settings' -> 'Environment Variables...'
174+
* Windows 10: Clicking 'Start Search' -> Type 'env' -> Click the result 'Edit system environment variables' -> 'Environment Variables...'
144175

145176
### How do I remove the error at the bottom of the WampServer right-click menu?
146177

0 commit comments

Comments
 (0)