YII 框架使用之——创建应用

linux环境为UBUNTU14.04,YII框架的版本是1.1.17

将下载的YII解压缩,压缩后会有三个文件夹,”demos,requirements,framework”,demos 当然就是演示了,暂时不用,而requirements是独立于YII框架的,用于检测服务器信息的。

timeless@timeless-HP-Pavilion-g4-Notebook-PC:/usr/local/apache243/htdocs/YII$ ls yii

build composer.json demos framework nbproject README.md tests CHANGELOG CONTRIBUTING.md docs LICENSE README requirements UPGRADE

执行操作

usr/local/php/bin$ sudo /usr/local/apache243/htdocs/YII/yii/framework/yiic webapp /usr/local/apache243/htdocs/YiiDemo  

Create a Web application under '/usr/local/apache243/htdocs/YiiDemo'? (yes|no) [no]:yes

如果LAMP是编译安装的,还需要用vi打开yiic,把”#!/usr/bin/env php”改为”!#/usr/local/php/bin/php(也就是你php路径)”。

    mkdir /usr/local/apache243/htdocs/YiiDemo

   generate index-test.php

   generate index.php

      mkdir /usr/local/apache243/htdocs/YiiDemo/assets

      mkdir /usr/local/apache243/htdocs/YiiDemo/css

   generate css/screen.css

   generate css/bg.gif

   generate css/main.css

   generate css/ie.css

   generate css/form.css

   generate css/print.css

      mkdir /usr/local/apache243/htdocs/YiiDemo/themes

      mkdir /usr/local/apache243/htdocs/YiiDemo/themes/classic

      mkdir /usr/local/apache243/htdocs/YiiDemo/themes/classic/views

      mkdir /usr/local/apache243/htdocs/YiiDemo/themes/classic/views/site

      mkdir /usr/local/apache243/htdocs/YiiDemo/themes/classic/views/layouts

   generate themes/classic/views/.htaccess

      mkdir /usr/local/apache243/htdocs/YiiDemo/themes/classic/views/system

      mkdir /usr/local/apache243/htdocs/YiiDemo/images

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/runtime

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/tests

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/tests/report

   generate protected/tests/WebTestCase.php

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/tests/functional

   generate protected/tests/functional/SiteTest.php

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/tests/fixtures

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/tests/unit

   generate protected/tests/phpunit.xml

   generate protected/tests/bootstrap.php

   generate protected/yiic.php

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/views

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/views/site

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/views/site/pages

   generate protected/views/site/pages/about.php

   generate protected/views/site/contact.php

   generate protected/views/site/error.php

   generate protected/views/site/index.php

   generate protected/views/site/login.php

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/views/layouts

   generate protected/views/layouts/main.php

   generate protected/views/layouts/column2.php

   generate protected/views/layouts/column1.php

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/components

   generate protected/components/UserIdentity.php

   generate protected/components/Controller.php

   generate protected/yiic.bat

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/migrations

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/config

   generate protected/config/main.php

   generate protected/config/console.php

   generate protected/config/test.php

   generate protected/config/database.php

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/messages

   generate protected/.htaccess

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/extensions

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/models

   generate protected/models/LoginForm.php

   generate protected/models/ContactForm.php

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/controllers

   generate protected/controllers/SiteController.php

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/data

   generate protected/data/schema.sqlite.sql

   generate protected/data/schema.mysql.sql

   generate protected/data/testdrive.db

   generate protected/yiic

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/vendor

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/commands

      mkdir /usr/local/apache243/htdocs/YiiDemo/protected/commands/shell



Your application has been created successfully under /usr/local/apache243/htdocs/YiiDemo.

到现在要生成的app已经生成完毕。

你可能感兴趣的:(yii)