Created
July 23, 2013 15:32
-
-
Save masiorama/6063334 to your computer and use it in GitHub Desktop.
CMD: Yii create app script
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
::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