Skip to content

Latest commit

 

History

History
87 lines (64 loc) · 2.48 KB

File metadata and controls

87 lines (64 loc) · 2.48 KB

Installation guide

System requirements

The plugin is framework-agnostic. It works in Yii2, Yii3, Laravel, Symfony, Slim, Mezzio, or plain PHP projects as long as they use Composer.

Installation

Add the plugin to your project:

composer require yii2-extensions/scaffold:^0.1

Because yii2-extensions/scaffold is a Composer plugin, you must allow it explicitly:

composer config allow-plugins.yii2-extensions/scaffold true

Or add the entry manually to your composer.json:

{
    "config": {
        "allow-plugins": {
            "yii2-extensions/scaffold": true
        }
    }
}

Authorize scaffold providers

Declare which packages are permitted to write files into your project under extra.scaffold.allowed-packages. The plugin ignores all providers that are not listed here.

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

Run composer install or composer update to trigger the scaffold process. The plugin applies all file mappings declared by the listed providers and writes scaffold-lock.json.

Commit the lockfile

scaffold-lock.json records the hash of every file written by the scaffold process. Commit it to version control alongside composer.lock so that collaborators and CI can detect user-modified files and reproduce the exact scaffold state.

git add scaffold-lock.json
git commit -m "chore: add scaffold-lock.json"

Invoke the console CLI

After composer install, the Symfony Console CLI is available at vendor/bin/scaffold:

vendor/bin/scaffold list                      # discover available commands
vendor/bin/scaffold status                    # what changed since last scaffold?
vendor/bin/scaffold providers                 # list providers + file counts
vendor/bin/scaffold diff config/params.php    # review changes on a single file
vendor/bin/scaffold reapply --force           # replay stubs, overwriting user edits
vendor/bin/scaffold eject config/params.php --yes   # detach a file from the lock

No framework bootstrap is required; the binary starts directly from Composer's autoloader.

Next steps