Skip to content

Instantly share code, notes, and snippets.

@AnrDaemon
Last active April 4, 2020 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AnrDaemon/a28e5af7de533aca38060355c7bbd682 to your computer and use it in GitHub Desktop.
Save AnrDaemon/a28e5af7de533aca38060355c7bbd682 to your computer and use it in GitHub Desktop.
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] %$
@CALL "%~dp0php.btm" -e -d "zend_extension=php_xdebug.dll" %$
@ECHO OFF
ON BREAK REM
SET PHP_RELEASE=7.1
SET PHP_INI_SCAN_DIR=%@PATH[%@RTRIM[\,%~dp0]]php-%[PHP_RELEASE]-extra\conf.d;%~dp0conf.d
SET PATH=%@PATH[%@RTRIM[\,%~dp0]]php-%[PHP_RELEASE]-extra;%[PATH]
"%~dp0%@NAME["%~0"].exe" %$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment