@@ -15,9 +15,9 @@ rem +------------------------------------------------+
1515rem | DO NOT EDIT BELOW THIS LINE |
1616rem +------------------------------------------------+
1717
18- rem ---------------------
19- rem Default Variables
20- rem ---------------------
18+ rem -------------------
19+ rem Default Variables
20+ rem -------------------
2121set $scriptVersion = 1.3.0
2222
2323set $defaultInstallPath[0] = C:\wamp
@@ -34,9 +34,9 @@ set $colorWarning=0E
3434set $colorFailure = 0C
3535
3636
37- rem --------------------
38- rem Operation By CLI
39- rem --------------------
37+ rem ------------------
38+ rem Operation By CLI
39+ rem ------------------
4040
4141rem Check if the CLI is being used.
4242if " %1 " neq " " (
@@ -52,9 +52,10 @@ if "%1" neq "" (
5252 )
5353)
5454
55- rem --------------------
56- rem Operation by TUI
57- rem --------------------
55+
56+ rem ------------------
57+ rem Operation by TUI
58+ rem ------------------
5859
5960rem Check if the TUI is being used.
6061if %$cliMode% equ 0 (
@@ -64,9 +65,9 @@ if %$cliMode% equ 0 (
6465)
6566
6667
67- rem -----------------
68- rem Install Paths
69- rem -----------------
68+ rem ---------------
69+ rem Install Paths
70+ rem ---------------
7071
7172rem Test for a custom install path.
7273if defined $customInstallPath (
@@ -99,9 +100,9 @@ rem Exit if unable to find installation path.
99100if not defined $installPath goto defaultInstallPathsMissing
100101
101102
102- rem -------------------
103- rem PHP Folder Path
104- rem -------------------
103+ rem -----------------
104+ rem PHP Folder Path
105+ rem -----------------
105106
106107rem Set the path to the PHP folders.
107108if %$installPath:~-1 % neq \ (
@@ -125,9 +126,9 @@ rem Set the last available PHP versions array id.
125126set $lastAvailablePhpVersionsArrayId = !counter!
126127
127128
128- rem ----------------------------
129- rem Users Environmental Path
130- rem ----------------------------
129+ rem --------------------------
130+ rem Users Environmental Path
131+ rem --------------------------
131132
132133rem Get the users environmental path string.
133134for /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.
150151set $lastUsersEnvironmentalPathArrayId = !counter!
151152
152153
153- rem ----------------------------
154- rem Match PHP Folder Version
155- rem ----------------------------
154+ rem --------------------------
155+ rem Match PHP Folder Version
156+ rem --------------------------
156157
157158rem If there is more than one PHP path in the users environmental path, the operating system
158159rem 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 (
177178:break
178179
179180
180- rem --------------------
181- rem Operation By CLI
182- rem --------------------
181+ rem ------------------
182+ rem Operation By CLI
183+ rem ------------------
183184
184185rem Check if the CLI is being used.
185186if %$cliMode% equ 1 (
@@ -201,17 +202,17 @@ if %$cliMode% equ 1 (
201202)
202203
203204
204- rem -----------
205- rem Hack(s)
206- rem -----------
205+ rem ---------
206+ rem Hack(s)
207+ rem ---------
207208
208209rem Hack to define a backspace so the 'set /p' command can be offset from the windows edge.
209210for /F %%a in ('" prompt $H &echo on &for %%b in (1) do rem" ') do set backspace = %%a
210211
211212
212- rem ------------------------
213- rem Display PHP Versions
214- rem ------------------------
213+ rem ----------------------
214+ rem Display PHP Versions
215+ rem ----------------------
215216
216217rem Show the header.
217218echo :
@@ -236,9 +237,9 @@ set /p $newSelectionId=%backspace% Selection (1-%$lastAvailablePhpVersionsArray
236237echo :
237238
238239
239- rem --------------------
240- rem Check User Input
241- rem --------------------
240+ rem ------------------
241+ rem Check User Input
242+ rem ------------------
242243:checkUserInput
243244
244245rem 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.
252253if %$newSelectionId% equ %$currentPhpVersionId% goto currentSelectionGiven
253254
254255
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 -------------------------------
259260
260261rem Rebuild the users environmental path string excluding any and all previously
261262rem 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.
290291set $usersEnvironmentalPathString = %$usersEnvironmentalPathString%%$pathToPhpFolders% \!$availablePhpVersionsArray[%$newSelectionId%]!
291292
292293
293- rem -------------------------------------------
294- rem Perform action depending on entry point
295- rem -------------------------------------------
294+ rem -----------------------------------------
295+ rem Perform action depending on entry point
296+ rem -----------------------------------------
296297
297298rem Check if the CLI session mode is being used.
298299if %$cliSessionMode% equ 1 (
@@ -346,13 +347,17 @@ rem Explode the environmental path string.
346347exit /B
347348
348349
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
351354
352355exit /B
353356
354357
355- rem Add the selected PHP path to environmental path string.
358+ rem ---------------------------
359+ rem Include selected PHP path
360+ rem ---------------------------
356361:includeSelectedPhpPath
357362
358363exit /B
@@ -362,7 +367,9 @@ rem ============================================================================
362367rem Success Message
363368rem ====================================================================================================================
364369
365- rem The update was successful.
370+ rem -------------------
371+ rem Update successful
372+ rem -------------------
366373:updateSuccessful
367374
368375if %$cliMode% equ 0 (
@@ -378,7 +385,9 @@ if %$cliMode% equ 0 (
378385)
379386
380387
381- rem The 'session' update was successful.
388+ rem ---------------------------
389+ rem Session update successful
390+ rem ---------------------------
382391:sessionUpdateSuccessful
383392
384393echo Success: This sessions PHP CLI version is now !$availablePhpVersionsArray[%$newSelectionId%]!
@@ -390,7 +399,9 @@ rem ============================================================================
390399rem Notice Message
391400rem ====================================================================================================================
392401
393- rem A current selection was given.
402+ rem -------------------------
403+ rem Current selection given
404+ rem -------------------------
394405:currentSelectionGiven
395406
396407if %$cliMode% equ 0 (
@@ -410,7 +421,9 @@ rem ============================================================================
410421rem Failure Message
411422rem ====================================================================================================================
412423
413- rem An invalid selection was given.
424+ rem -------------------------
425+ rem Invalid selection given
426+ rem -------------------------
414427:invalidSelectionGiven
415428
416429if %$cliMode% equ 0 (
@@ -430,7 +443,9 @@ rem ============================================================================
430443rem Error Messages
431444rem ====================================================================================================================
432445
433- rem An invalid $customInstallPath was given.
446+ rem -----------------------------------
447+ rem Invalid custom install path given
448+ rem -----------------------------------
434449:invalidCustomInstallPathGiven
435450
436451if %$cliMode% equ 0 (
@@ -447,7 +462,9 @@ if %$cliMode% equ 0 (
447462)
448463
449464
450- rem Both of the default install paths are missing.
465+ rem -------------------------------
466+ rem Default install paths missing
467+ rem -------------------------------
451468:defaultInstallPathsMissing
452469if %$cliMode% equ 0 (
453470 color %$colorFailure%
@@ -471,7 +488,9 @@ if %$cliMode% equ 0 (
471488)
472489
473490
474- rem An invalid $pathToPhpFolders was given.
491+ rem ----------------------------------
492+ rem Invalid path to PHP folder given
493+ rem ----------------------------------
475494:invalidPathToPhpFoldersGiven
476495
477496if %$cliMode% equ 0 (
0 commit comments