Skip to content

Instantly share code, notes, and snippets.

@masiorama
Created July 23, 2013 15:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save masiorama/6063334 to your computer and use it in GitHub Desktop.
Save masiorama/6063334 to your computer and use it in GitHub Desktop.
CMD: Yii create app script
::set PATH=%PATH%;C:\wamp\bin\php\php5.3.13 ::not necessary if php is set on environment variables
::set FRAMEWORKS=C:\frameworks ::not necessary if frameworks is set on environment variables
@echo off
setlocal enabledelayedexpansion
set /a counter=0
echo Please enter your choice:
for /f %%i in ('dir /b %FRAMEWORKS%"\yii*"') do (
set /a counter+=1
set option=!counter! %%i
echo !option!
)
set /p M=
set /a SEL_DEC=%M%-1
if %SEL_DEC% GTR 0 (
set SKIP="skip=%SEL_DEC%"
) else (
set SKIP=
)
for /f %SKIP% %%e in ('dir /b %FRAMEWORKS%"\yii*"') do echo starting %%e... & set YIIV=%%e& pause & goto doit
:doit
set /p APP_NAME="Please enter Yii App name: " %=%
set YII_COM=%FRAMEWORKS%\%YIIV%\framework\yiic.php
set WWW_ROOT=C:\wamp\www
php %YII_COM% webapp %WWW_ROOT%\%APP_NAME%
goto exit
:exit
echo Operation completed!
pause
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment