@@ -15,9 +15,9 @@ rem +------------------------------------------------+
15
15
rem | DO NOT EDIT BELOW THIS LINE |
16
16
rem +------------------------------------------------+
17
17
18
- rem ---------------------
19
- rem Default Variables
20
- rem ---------------------
18
+ rem -------------------
19
+ rem Default Variables
20
+ rem -------------------
21
21
set $scriptVersion = 1.3.0
22
22
23
23
set $defaultInstallPath[0] = C:\wamp
@@ -34,9 +34,9 @@ set $colorWarning=0E
34
34
set $colorFailure = 0C
35
35
36
36
37
- rem --------------------
38
- rem Operation By CLI
39
- rem --------------------
37
+ rem ------------------
38
+ rem Operation By CLI
39
+ rem ------------------
40
40
41
41
rem Check if the CLI is being used.
42
42
if " %1 " neq " " (
@@ -52,9 +52,10 @@ if "%1" neq "" (
52
52
)
53
53
)
54
54
55
- rem --------------------
56
- rem Operation by TUI
57
- rem --------------------
55
+
56
+ rem ------------------
57
+ rem Operation by TUI
58
+ rem ------------------
58
59
59
60
rem Check if the TUI is being used.
60
61
if %$cliMode% equ 0 (
@@ -64,9 +65,9 @@ if %$cliMode% equ 0 (
64
65
)
65
66
66
67
67
- rem -----------------
68
- rem Install Paths
69
- rem -----------------
68
+ rem ---------------
69
+ rem Install Paths
70
+ rem ---------------
70
71
71
72
rem Test for a custom install path.
72
73
if defined $customInstallPath (
@@ -99,9 +100,9 @@ rem Exit if unable to find installation path.
99
100
if not defined $installPath goto defaultInstallPathsMissing
100
101
101
102
102
- rem -------------------
103
- rem PHP Folder Path
104
- rem -------------------
103
+ rem -----------------
104
+ rem PHP Folder Path
105
+ rem -----------------
105
106
106
107
rem Set the path to the PHP folders.
107
108
if %$installPath:~-1 % neq \ (
@@ -125,9 +126,9 @@ rem Set the last available PHP versions array id.
125
126
set $lastAvailablePhpVersionsArrayId = !counter!
126
127
127
128
128
- rem ----------------------------
129
- rem Users Environmental Path
130
- rem ----------------------------
129
+ rem --------------------------
130
+ rem Users Environmental Path
131
+ rem --------------------------
131
132
132
133
rem Get the users environmental path string.
133
134
for /F " usebackq tokens=2,*" %%a in (`reg.exe query HKCU\Environment /v PATH`) do (
@@ -150,9 +151,9 @@ rem Set the last users environmental path array id.
150
151
set $lastUsersEnvironmentalPathArrayId = !counter!
151
152
152
153
153
- rem ----------------------------
154
- rem Match PHP Folder Version
155
- rem ----------------------------
154
+ rem --------------------------
155
+ rem Match PHP Folder Version
156
+ rem --------------------------
156
157
157
158
rem If there is more than one PHP path in the users environmental path, the operating system
158
159
rem will only use the first one. Therefore, we only need to match the first one.
@@ -177,9 +178,9 @@ for /L %%a in (1,1,%$lastUsersEnvironmentalPathArrayId%) do (
177
178
:break
178
179
179
180
180
- rem --------------------
181
- rem Operation By CLI
182
- rem --------------------
181
+ rem ------------------
182
+ rem Operation By CLI
183
+ rem ------------------
183
184
184
185
rem Check if the CLI is being used.
185
186
if %$cliMode% equ 1 (
@@ -201,17 +202,17 @@ if %$cliMode% equ 1 (
201
202
)
202
203
203
204
204
- rem -----------
205
- rem Hack(s)
206
- rem -----------
205
+ rem ---------
206
+ rem Hack(s)
207
+ rem ---------
207
208
208
209
rem Hack to define a backspace so the 'set /p' command can be offset from the windows edge.
209
210
for /F %%a in ('" prompt $H &echo on &for %%b in (1) do rem" ') do set backspace = %%a
210
211
211
212
212
- rem ------------------------
213
- rem Display PHP Versions
214
- rem ------------------------
213
+ rem ----------------------
214
+ rem Display PHP Versions
215
+ rem ----------------------
215
216
216
217
rem Show the header.
217
218
echo :
@@ -236,9 +237,9 @@ set /p $newSelectionId=%backspace% Selection (1-%$lastAvailablePhpVersionsArray
236
237
echo :
237
238
238
239
239
- rem --------------------
240
- rem Check User Input
241
- rem --------------------
240
+ rem ------------------
241
+ rem Check User Input
242
+ rem ------------------
242
243
:checkUserInput
243
244
244
245
rem Check if the new selection comprises of digits.
@@ -252,10 +253,10 @@ rem Check if the new selection is the same as the current selection.
252
253
if %$newSelectionId% equ %$currentPhpVersionId% goto currentSelectionGiven
253
254
254
255
255
- rem ---------------------------------
256
- rem Update Users Environment Path
257
- rem TODO: Does this need to move down into is own block / function as well?
258
- rem ---------------------------------
256
+ rem -------------------------------
257
+ rem Update Users Environment Path
258
+ rem TODO: Does this need to move down into is own block / function as well?
259
+ rem -------------------------------
259
260
260
261
rem Rebuild the users environmental path string excluding any and all previously
261
262
rem set PHP folder paths no matter where they are located within the string.
@@ -290,9 +291,9 @@ rem: TODO: move down into setx path code block.
290
291
set $usersEnvironmentalPathString = %$usersEnvironmentalPathString%%$pathToPhpFolders% \!$availablePhpVersionsArray[%$newSelectionId%]!
291
292
292
293
293
- rem -------------------------------------------
294
- rem Perform action depending on entry point
295
- rem -------------------------------------------
294
+ rem -----------------------------------------
295
+ rem Perform action depending on entry point
296
+ rem -----------------------------------------
296
297
297
298
rem Check if the CLI session mode is being used.
298
299
if %$cliSessionMode% equ 1 (
@@ -346,13 +347,17 @@ rem Explode the environmental path string.
346
347
exit /B
347
348
348
349
349
- rem Implode the environmental path string (whilst excluding any PHP versions).
350
- :implodeEnvironmentalPathExcludingPhps
350
+ rem ----------------------------
351
+ rem Implode path excluding PHP
352
+ rem ----------------------------
353
+ :implodePathExcludingPhps
351
354
352
355
exit /B
353
356
354
357
355
- rem Add the selected PHP path to environmental path string.
358
+ rem ---------------------------
359
+ rem Include selected PHP path
360
+ rem ---------------------------
356
361
:includeSelectedPhpPath
357
362
358
363
exit /B
@@ -362,7 +367,9 @@ rem ============================================================================
362
367
rem Success Message
363
368
rem ====================================================================================================================
364
369
365
- rem The update was successful.
370
+ rem -------------------
371
+ rem Update successful
372
+ rem -------------------
366
373
:updateSuccessful
367
374
368
375
if %$cliMode% equ 0 (
@@ -378,7 +385,9 @@ if %$cliMode% equ 0 (
378
385
)
379
386
380
387
381
- rem The 'session' update was successful.
388
+ rem ---------------------------
389
+ rem Session update successful
390
+ rem ---------------------------
382
391
:sessionUpdateSuccessful
383
392
384
393
echo Success: This sessions PHP CLI version is now !$availablePhpVersionsArray[%$newSelectionId%]!
@@ -390,7 +399,9 @@ rem ============================================================================
390
399
rem Notice Message
391
400
rem ====================================================================================================================
392
401
393
- rem A current selection was given.
402
+ rem -------------------------
403
+ rem Current selection given
404
+ rem -------------------------
394
405
:currentSelectionGiven
395
406
396
407
if %$cliMode% equ 0 (
@@ -410,7 +421,9 @@ rem ============================================================================
410
421
rem Failure Message
411
422
rem ====================================================================================================================
412
423
413
- rem An invalid selection was given.
424
+ rem -------------------------
425
+ rem Invalid selection given
426
+ rem -------------------------
414
427
:invalidSelectionGiven
415
428
416
429
if %$cliMode% equ 0 (
@@ -430,7 +443,9 @@ rem ============================================================================
430
443
rem Error Messages
431
444
rem ====================================================================================================================
432
445
433
- rem An invalid $customInstallPath was given.
446
+ rem -----------------------------------
447
+ rem Invalid custom install path given
448
+ rem -----------------------------------
434
449
:invalidCustomInstallPathGiven
435
450
436
451
if %$cliMode% equ 0 (
@@ -447,7 +462,9 @@ if %$cliMode% equ 0 (
447
462
)
448
463
449
464
450
- rem Both of the default install paths are missing.
465
+ rem -------------------------------
466
+ rem Default install paths missing
467
+ rem -------------------------------
451
468
:defaultInstallPathsMissing
452
469
if %$cliMode% equ 0 (
453
470
color %$colorFailure%
@@ -471,7 +488,9 @@ if %$cliMode% equ 0 (
471
488
)
472
489
473
490
474
- rem An invalid $pathToPhpFolders was given.
491
+ rem ----------------------------------
492
+ rem Invalid path to PHP folder given
493
+ rem ----------------------------------
475
494
:invalidPathToPhpFoldersGiven
476
495
477
496
if %$cliMode% equ 0 (
0 commit comments