接管一个Yii的系统,因为没有文档,所以非常上火。

01 查版本

Yii::getVersion();

02 生成webapp

Yii 是支持通过命令行生成webapp的。其中, yiic.bat是Windows 下的 yiic 命令行脚本。这里如果没有配置php_command变量的话,需要改一下yiic.bat文件。

@echo off

rem -------------------------------------------------------------
rem Yii command line script for Windows.
rem
rem This is the bootstrap script for running yiic on Windows.
rem
rem @author Qiang Xue <[email protected]>
rem @link http://www.yiiframework.com/
rem @copyright Copyright &copy; 2008 Yii Software LLC
rem @license http://www.yiiframework.com/license/
rem @version $Id: yiic.bat 2485 2010-09-19 17:07:11Z qiang.xue $
rem ------------------------------------------------------------- @setlocal set YII_PATH=%~dp0 REM if "%PHP_COMMAND%" == "" set PHP_COMMAND=php.exe
REM 以下为修改
if "%PHP_COMMAND%" == "" set PHP_COMMAND=D:\wamp\bin\php\php5.5.12\php.exe "%PHP_COMMAND%" "%YII_PATH%yiic" %* @endlocal

然后去到yiic.bat所在的目录下,执行以下脚本即可

# helloyii 为应用名
yiic webapp helloyii

REFs

yiic php_command

05-12 09:26