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

Package info

github.com/yii2-extensions/scaffold

Type:composer-plugin

pkg:composer/yii2-extensions/scaffold

Statistics

Installs: 5โ€‰235

Dependents: 14

Suggesters: 0

Stars: 4

Open Issues: 0

0.1.0 2026-05-05 23:30 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause 695bb48f4c509262202a265817de59c7c5f9d558

scaffoldscaffoldingcomposer-pluginyii2-extensionsfile-mapping

This package is auto-updated.

Last update: 2026-06-26 12:34:21 UTC


README

๐Ÿ‘ Yii Framework

Scaffold


๐Ÿ‘ Build
๐Ÿ‘ Mutation
๐Ÿ‘ PHPStan
๐Ÿ‘ Security

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

Project status

๐Ÿ‘ PHPStan Level Max
๐Ÿ‘ Quality
๐Ÿ‘ StyleCI

Our social networks

๐Ÿ‘ Follow on X
๐Ÿ‘ Follow on Facebook
๐Ÿ‘ Join our Subreddit
๐Ÿ‘ Join on Telegram

License

๐Ÿ‘ License