/scaffold

scaffold是一个基于Yii2高级项目模版工程化实现的应用程序

Primary LanguagePHP

Yii 2 Scaffold Project Kit


易加-脚手架(scaffold)是一个基于Yii2高级项目模版工程化实现的应用程序,它将更加高效、规范和工程化的满足项目开发的需求。

Latest Stable Version Total Downloads Build Status DOCS Yii2 Apache--2.0

DIRECTORY STRUCTURE

common
    config/              contains shared configurations
    mail/                contains view files for e-mails
    models/              contains model classes used in both backend and frontend
    tests/               contains tests for common classes    
console
    config/              contains console configurations
    controllers/         contains console controllers (commands)
    migrations/          contains database migrations
    models/              contains console-specific model classes
    runtime/             contains files generated during runtime
backend
    assets/              contains application assets such as JavaScript and CSS
    config/              contains backend configurations
    controllers/         contains Web controller classes
    models/              contains backend-specific model classes
    runtime/             contains files generated during runtime
    tests/               contains tests for backend application    
    views/               contains view files for the Web application
    web/                 contains the entry script and Web resources
frontend
    assets/              contains application assets such as JavaScript and CSS
    config/              contains frontend configurations
    controllers/         contains Web controller classes
    models/              contains frontend-specific model classes
    runtime/             contains files generated during runtime
    tests/               contains tests for frontend application
    views/               contains view files for the Web application
    web/                 contains the entry script and Web resources
    widgets/             contains frontend widgets
api
    config/              contains api configurations
    controllers/         contains Web controller classes
    models/              contains api-specific model classes
    runtime/             contains files generated during runtime
    tests/               contains tests for api application
    web/                 contains the entry script and Web resources
vendor/                  contains dependent 3rd-party packages
docker/                  contains docker for project
vagrant/                 contains vagrant for project
environments/            contains environment-based overrides

快速安装

  • 安装 Composer 依赖管理

  • 安装 Docker 应用容器引擎

  • 基于容器化环境部署

    # 克隆代码
    git clone https://github.com/yiiplus/scaffold.git
    
    # 进入项目目录
    cd scaffold
    
    # 设置Git配置
    git config user.name "yourname"
    git config user.email "your email" 
    
    # 编译环境
    # 如果安装失败请尝试添加 GitHub 密钥:
    # 进入 https://github.com/settings/tokens 点击 「Generate new token」 新建一个 Token;
    # 编辑 vim composer.json
    #    "config": {
    #        "github-oauth": {
    #            "github.com": "<token>"
    #        }
    #    }
    composer run-script docker:build
    
    # 代码规范检查
    ./vendor/bin/phpcs --standard=PSR2 --ignore=tests,docs/,docker/,vendor/,console/migrations,backend/runtime,frontend/runtime,api/runtime,console/runtime,frontend/web/assets,backend/web/assets,api/web/assets -n --colors ./
    # 质量检查工具
    ./vendor/bin/phpmd environments,common,console,backend,frontend,api text phpmd.xml --exclude tests,docs/,docker/,vendor/,console/migrations,backend/runtime,frontend/runtime,api/runtime,console/runtime,frontend/web/assets,backend/web/assets,api/web/assets
  • 访问地址