Skip to content

Instantly share code, notes, and snippets.

@AnrDaemon AnrDaemon/php-server.btm
Last active Feb 20, 2019

Embed
What would you like to do?
Server starter.
@ECHO OFF
SET SERVER="%~dp0php-xdebug.btm"
:: PARAMETRIZE [name param]
ALIAS /L
ALIAS PARAMETRIZE=`SET __name=%1 %+ SET __value=%@REREPLACE[^^--.*?=,,%2] %+ IFF "%[__value]" != "%2" THEN %+ SET %[__name]=%[__value] %+ UNSET __name %+ ENDIFF %+ UNSET __value`
SET _enc=UTF-8
SET _session=local
DO param IN /Q %$ ""
SET param=%@UNQUOTES[%[param]]
IFF "%[__name]" != "" THEN
SET %[__name]=%[param]
UNSET __name
SHIFT
ELSE
SWITCH %@REREPLACE[=.*$,,%[param]]
CASE --encoding
PARAMETRIZE _enc %[param]
SHIFT
CASE --name
PARAMETRIZE _session %[param]
SHIFT
CASE --root
PARAMETRIZE _root %[param]
SHIFT
DEFAULT
ECHO Def: %$
LEAVE
ENDSWITCH
ENDIFF
ENDDO
IFF "%[_root]" != "" THEN
SET _root=-t %[_root]
ENDIFF
CALL %[SERVER] -S 0.0.0.0:8080 -d "internal_encoding=%[_enc]" -d "xdebug.idekey=%[_session]" %[_root] %$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.