自动创建thinkphp5.1应用[BAT版]

@echo off
:start
cls
echo ================创建ThinkPHP 5.1项目====================
echo 1.下载composer安装包
echo 2.更改composer安装源(执行一次即可)
echo 3.创建项目
echo 4.退出
echo ==============================================
set /p choice= 请选择:
if %choice%==1 goto 1
if %choice%==2 goto 2
if %choice%==3 goto 3
if %choice%==4 exit
:1
start https://getcomposer.org/Composer-Setup.exe
pause
goto :start
:2
composer config -g repo.packagist composer https://packagist.phpcomposer.com
echo =======composer源修改成功==========
pause
goto :start
:3
set /p projectname=请输入项目名称:
echo %projectname%
composer create-project topthink/think %projectname%
pause
goto :start
More...

ThinkPHP5.1创建项目

ThinkPHP 5.1版本发布,新版本不再提供完整的包下载,而是采用了Composer的方式。说起这个,估计有好多人第一件事就是想去翻墙。。翻翻翻。。。为了方便,我做了个BAT方便自己

1、翻墙。。。下载Composer安装包。。地址:https://getcomposer.org/Composer-Setup.exe

2、在你的Web目录下新建BAT文件,输入以下内容并保存。然后双击打开。

 

@echo off
:start
cls
echo ================创建ThinkPHP 5.1项目====================
echo 1.下载composer安装包
echo 2.更改composer安装源(执行一次即可)
echo 3.创建项目
echo 4.退出
echo ==============================================
set /p choice= 请选择:
if %choice%==1 goto 1
if %choice%==2 goto 2
if %choice%==3 goto 3
if %choice%==4 exit
:1
start https://getcomposer.org/Composer-Setup.exe
pause
goto :start
:2
composer config -g repo.packagist composer https://packagist.phpcomposer.com
echo =======composer源修改成功==========
pause
goto :start
:3
set /p projectname=请输入项目名称:
echo %projectname%
composer create-project topthink/think %projectname%
pause
goto :start
More...