The plugin is framework-agnostic. It works in Yii2, Yii3, Laravel, Symfony, Slim, Mezzio, or plain PHP projects as long as they use Composer.
Add the plugin to your project:
composer require yii2-extensions/scaffold:^0.1Because yii2-extensions/scaffold is a Composer plugin, you must allow it explicitly:
composer config allow-plugins.yii2-extensions/scaffold trueOr add the entry manually to your composer.json:
{
"config": {
"allow-plugins": {
"yii2-extensions/scaffold": true
}
}
}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.
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"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 lockNo framework bootstrap is required; the binary starts directly from Composer's autoloader.