cd进入yii/framework框架的根目录。
执行
# php yiic Yii command runner (based on Yii v1.1.8) Usage: yiic <command-name> [parameters...] The following commands are available: - message - migrate - shell - webapp To see individual command help, use the following: yiic help <command-name>
可以看到
yiic的基本命令参数规则
yiic <command-name> [parameters...]
command-name对应的有
- message
- migrate
- shell
- webapp
如果要查看具体的命令的功能可以用
yiic help <command-name>
例如:
php yiic shell
1.php yiic webapp
执行 php yiic help webapp
/* USAGE yiic webapp <app-path> DESCRIPTION This command generates an Yii Web Application at the specified location. PARAMETERS * app-path: required, the directory where the new application will be created. If the directory does not exist, it will be created. After the application is created, please make sure the directory can be accessed by Web users. */
在指定的位置创建一个基于yii的完整结构的webapp。app-path是webapp的存放目录。如果目录不存在会被创建。
例如:
/yii/framework# php yiic webapp ../../testwebap Create a Web application under '/home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap'? [Yes|No] Yes mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap generate index-test.php mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/themes mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/themes/classic mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/themes/classic/views mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/themes/classic/views/layouts generate themes/classic/views/.htaccess mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/themes/classic/views/site mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/themes/classic/views/system mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/css generate css/ie.css generate css/bg.gif generate css/screen.css generate css/form.css generate css/print.css generate css/main.css generate index.php mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/assets mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/models generate protected/models/LoginForm.php generate protected/models/ContactForm.php mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/components generate protected/components/UserIdentity.php generate protected/components/Controller.php generate protected/yiic.bat mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/controllers generate protected/controllers/SiteController.php mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/migrations generate protected/yiic mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/data generate protected/data/testdrive.db generate protected/data/schema.mysql.sql generate protected/data/schema.sqlite.sql mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/config generate protected/config/test.php generate protected/config/console.php generate protected/config/main.php generate protected/.htaccess mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/views mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/views/layouts generate protected/views/layouts/column1.php generate protected/views/layouts/column2.php generate protected/views/layouts/main.php mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/views/site generate protected/views/site/contact.php generate protected/views/site/login.php mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/views/site/pages generate protected/views/site/pages/about.php generate protected/views/site/index.php generate protected/views/site/error.php mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/messages mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/tests generate protected/tests/bootstrap.php mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/tests/fixtures generate protected/tests/phpunit.xml mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/tests/report mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/tests/unit mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/tests/functional generate protected/tests/functional/SiteTest.php generate protected/tests/WebTestCase.php mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/runtime generate protected/yiic.php mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/extensions mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/commands mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/protected/commands/shell mkdir /home/coder/adata/liuyuqiang/wamp/www/yii_dev/testwebap/images
Your application has been created successfully under /yii_dev/testwebap.
生成的目录结构如下