PHPackages                             scafera/scaffold - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. scafera/scaffold

ActiveComposer-plugin[Framework](/categories/framework)

scafera/scaffold
================

Composer plugin that scaffolds framework files into Scafera projects

v1.0.3(1mo ago)0151MITPHPPHP &gt;=8.4

Since Apr 13Pushed 1mo agoCompare

[ Source](https://github.com/scafera/scaffold)[ Packagist](https://packagist.org/packages/scafera/scaffold)[ Docs](https://github.com/scafera/scaffold)[ RSS](/packages/scafera-scaffold/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (1)

scafera/scaffold
================

[](#scaferascaffold)

Composer plugin that scaffolds framework-owned files into Scafera projects.

> **Provides:** Composer plugin that copies framework-owned files (entry point, kernel bootstrap, `.gitignore`, config examples) into Scafera projects on `composer install`/`update`. Files are always overwritten (except `initial-files`, copied once) to keep framework and project in sync.
>
> **Depends on:** Composer 2+ (`composer-plugin-api ^2.0`). Activates automatically for any installed package that declares `extra.scafera-scaffold`.
>
> **Extension points:**
>
> - `composer.json` → `extra.scafera-scaffold.files` — logical keys mapped to source paths in the declaring package; always overwritten on install
> - `extra.scafera-scaffold.initial-files` — literal target paths; copied once, never overwritten (intended for user-editable configs)
> - `extra.scafera-scaffold.target-map` — architecture packages remap logical keys to project-specific paths (e.g. `index.php` → `public/index.php`)
> - `extra.scafera-scaffold.file-mapping` — project-level opt-out (`"public/index.php": false` to disable a scaffolded file)
> - Convention — package-side scaffold sources live under `support/scaffold/` at the package root
>
> **Not responsible for:** Code generation (use `scafera make:controller`, `make:service`, `make:command` from the architecture package — e.g. `scafera/layered`) · application scaffolding (only framework-owned files are copied) · modifying user-authored code · conflict resolution beyond last-package-wins for duplicate logical keys.

How It Works
------------

[](#how-it-works)

Scafera packages declare which files they provide. The plugin collects these declarations from all installed packages and copies the files into the project.

```
composer install
  → plugin reads declarations from installed packages
  → copies files to project
  → creates directories as needed

```

Package Declaration
-------------------

[](#package-declaration)

Packages declare scaffold files in their `composer.json` under `extra.scafera-scaffold`.

### `files` — Always Overwritten

[](#files--always-overwritten)

Use a logical key (not a path) to identify each file. The key decouples the file identity from its target location.

```
{
    "extra": {
        "scafera-scaffold": {
            "files": {
                "index.php": "support/scaffold/public/index.php"
            }
        }
    }
}
```

The logical key is used as the default target path. To place the file elsewhere, an architecture package provides a `target-map` (see below).

### `initial-files` — Created Once

[](#initial-files--created-once)

Files that are only copied if the target does not already exist. Useful for configuration files that the developer is expected to modify.

```
{
    "extra": {
        "scafera-scaffold": {
            "initial-files": {
                "config/config.yaml": "support/scaffold/config/config.example.yaml"
            }
        }
    }
}
```

Unlike `files`, initial files use literal target paths (not logical keys).

### `target-map` — Control Placement

[](#target-map--control-placement)

Architecture packages can remap where a logical key is placed without duplicating the source file.

```
{
    "extra": {
        "scafera-scaffold": {
            "target-map": {
                "index.php": "public/index.php"
            }
        }
    }
}
```

This tells the plugin: place the file identified by `index.php` at `public/index.php`. The source remains in the kernel — no duplication.

A different architecture package could remap the same key:

```
{
    "target-map": {
        "index.php": "web/index.php"
    }
}
```

Project-Level Overrides
-----------------------

[](#project-level-overrides)

Projects can disable specific scaffolded files via `file-mapping`:

```
{
    "extra": {
        "scafera-scaffold": {
            "file-mapping": {
                "public/index.php": false
            }
        }
    }
}
```

Disabled files are skipped during scaffolding with a console message.

File Placement Convention
-------------------------

[](#file-placement-convention)

Packages that provide scaffold files should place them under `support/scaffold/` at the package root:

```
my-package/
├── src/
├── support/
│   └── scaffold/
│       └── public/
│           └── index.php
└── composer.json

```

Conflict Resolution
-------------------

[](#conflict-resolution)

If multiple packages declare the same logical key, the last package processed wins. Package order is determined by Composer's dependency resolution.

Console Output
--------------

[](#console-output)

The plugin logs every action during scaffolding:

```
Scafera: scaffolding project files...
  .gitignore → .gitignore (from scafera/layered)
  config/config.example.yaml → config/config.example.yaml (from scafera/kernel)
  index.php → public/index.php (from scafera/kernel)
  Skipped: .gitignore (already exists)
Scafera: 3 file(s) scaffolded.

```

Requirements
------------

[](#requirements)

- PHP &gt;= 8.4

License
-------

[](#license)

MIT

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance89

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

4

Last Release

54d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9233f415f42755f68dc3006e2853b76c34de54b04c9535202b70aa147790e6a?d=identicon)[samaphp](/maintainers/samaphp)

---

Top Contributors

[![samaphp](https://avatars.githubusercontent.com/u/531627?v=4)](https://github.com/samaphp "samaphp (10 commits)")

---

Tags

phpscaffoldcomposer-pluginscafera

### Embed Badge

![Health badge](/badges/scafera-scaffold/health.svg)

```
[![Health](https://phpackages.com/badges/scafera-scaffold/health.svg)](https://phpackages.com/packages/scafera-scaffold)
```

###  Alternatives

[pestphp/pest-plugin

The Pest plugin manager

4666.2M134](/packages/pestphp-pest-plugin)[oro/platform

Business Application Platform (BAP)

641140.7k103](/packages/oro-platform)[wecodemore/wpstarter

Composer plugin to easily build WordPress websites entirely managed via Composer.

254203.9k8](/packages/wecodemore-wpstarter)[pestphp/pest-plugin-stressless

Stressless plugin for Pest

68943.9k18](/packages/pestphp-pest-plugin-stressless)[event4u/data-helpers

Framework-agnostic PHP library for data mapping, DTOs and utilities. Includes DataMapper, SimpleDto/LiteDto, DataAccessor/Mutator/Filter and helper classes (MathHelper, EnvHelper, etc.). Works with Laravel, Symfony/Doctrine or standalone PHP.

1426.9k](/packages/event4u-data-helpers)[alleyinteractive/pest-plugin-wordpress

WordPress Pest Integration

273.9k1](/packages/alleyinteractive-pest-plugin-wordpress)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
