定制 yii2-extensions/scaffold 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

yii2-extensions/scaffold

Composer 安装命令:

composer require yii2-extensions/scaffold

包简介

Declarative multi-layer file scaffolding for PHP projects via Composer providers and a Symfony Console CLI.

README 文档

README

Yii Framework

Scaffold


Build Mutation PHPStan

Declarative multi-layer file scaffolding for PHP projects
via Composer providers and a Console CLI

Features

Feature Overview

Installation

composer require yii2-extensions/scaffold:^0.1
composer config allow-plugins.yii2-extensions/scaffold true

Declare the providers that are permitted to write files into your project:

{
    "extra": {
        "scaffold": {
            "allowed-packages": [
                "yii2-extensions/app-base"
            ]
        }
    }
}

Run composer install to trigger the scaffold process. Commit scaffold-lock.json to version control.

To opt out of auto-trigger and manage updates manually via vendor/bin/scaffold, set auto: false (see Configuration Reference):

{
    "extra": {
        "scaffold": {
            "auto": false,
            "allowed-packages": ["yii2-extensions/app-base"]
        }
    }
}

Configuration

Minimal composer.json for a project using one scaffold provider:

{
    "require": {
        "yii2-extensions/scaffold": "^0.1",
        "yii2-extensions/app-base": "^0.1"
    },
    "config": {
        "allow-plugins": {
            "yii2-extensions/scaffold": true
        }
    },
    "extra": {
        "scaffold": {
            "allowed-packages": [
                "yii2-extensions/app-base"
            ]
        }
    }
}

Console commands

After composer install, the plugin ships a standalone Symfony Console CLI at vendor/bin/scaffold that works in any PHP project (Yii2, Yii3, Laravel, Symfony, plain PHP).

Command What it does
vendor/bin/scaffold status Prints a table comparing every tracked file's on-disk hash to the one recorded in scaffold-lock.json (synced / modified / missing).
vendor/bin/scaffold providers Lists every provider recorded in scaffold-lock.json and how many files each one contributed.
vendor/bin/scaffold diff <file> Shows a line-by-line diff between the provider stub and the current on-disk file.
vendor/bin/scaffold reapply [file] [--force] [--provider=<name>] Re-copies stubs from vendor/ to the project, updating lock hashes on success. Without --force, user-modified files are reported and skipped.
vendor/bin/scaffold eject <file> [--yes] Removes a file entry from scaffold-lock.json without deleting the file from disk. Without --yes only previews the change.

Typical post-install workflow:

vendor/bin/scaffold status                                      # what changed
vendor/bin/scaffold diff config/params.php                      # review one file
vendor/bin/scaffold reapply config/params.php --force           # accept stub version

# or
vendor/bin/scaffold eject config/params.php --yes               # keep yours, stop tracking

See docs/console.md for the full reference.

Documentation

Package information

PHP Latest Stable Version Total Downloads

Quality code

PHPStan Level Max Super-Linter StyleCI

Our social networks

Follow on X

License

License

统计信息

  • 总下载量: 3.63k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 1
  • 依赖项目数: 14
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2026-04-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固