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

Maintainers

Package info

github.com/yii2-extensions/scaffold

Type:composer-plugin

pkg:composer/yii2-extensions/scaffold

Statistics

Installs: 402

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 0

dev-main / 0.1.x-dev 2026-04-20 16:41 UTC

This package is auto-updated.

Last update: 2026-04-20 16:41:50 UTC


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
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.

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