Last active
April 14, 2018 19:05
-
-
Save Rodrigo54/4c06d17e03eac5724fcd2d599341cf44 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@REM This file detects the current enabled PHP version of wampserver (http://www.wampserver.com/) and executes the enabled php.exe and all parameters are passed | |
@REM Copy this file to WAMPSERVERPATH\bin\php | |
@REM Now you can add WAMPSERVERPATH\bin\php to your Windows Environment-Variable "PATH". Now you can use "php" global. For example "php -v". | |
@REM You can show the current PHP version with "php -v" | |
@setlocal enableextensions enabledelayedexpansion | |
@echo off | |
set serverPath="%~dp0\..\.." | |
set file="!serverPath!\wampmanager.conf" | |
set area=[php] | |
set key=phpVersion | |
FOR /F "tokens=*" %%a IN ('type %file%') DO ( | |
set ln=%%a | |
if "x!ln:~0,1!"=="x[" ( | |
set currarea=!ln! | |
) else ( | |
for /f "tokens=1,2 delims== " %%b in ("!ln!") do ( | |
set currkey=%%b | |
set currval=%%c | |
if "x!area!"=="x!currarea!" ( | |
if "x!key!"=="x!currkey!" ( | |
set !currkey!=!currval:"=! | |
) | |
) | |
) | |
) | |
) | |
CALL !serverPath:"=!\bin\php\php!%key%!\php.exe %* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment