Search by

rmb32 / barnscaff

rogerbarnfather

Filesystem projection for Barntree Trees

Package info

bitbucket.org/rmb32/barnscaff

pkg:composer/rmb32/barnscaff

Statistics

Installs: 283

Dependents: 4

Suggesters: 0

v0.1.1 2026-11-11 14:22 UTC

This package is auto-updated.

Last update: 2026-11-11 15:01:25 UTC


README

Early, version 0.x. Not ready for real projects yet; the minor version is the breaking one.

Part of Barn.

Turn a Barntree Tree's item tree into real folders and files — and check that an existing folder still matches it. Use it from PHP, or from the command line via barnscaff-cli.

Map children are traversed alphabetically by display name through Barntree. Members of a list retain their sequence.

Requirements

Installation

composer require rmb32/barnscaff

Command line

Install barnscaff-cli to get barnscaff:

composer require rmb32/barnscaff-cli

Run it inside a barn with a saved tree. The Barnscaff CLI quick start shows how to set one up with the bundled House tree.

vendor/bin/barnscaff scaffold House ./generated           # preview the plan
vendor/bin/barnscaff scaffold House ./generated --apply   # write it
vendor/bin/barnscaff scan House ./generated               # exit 0 if conformant, 1 otherwise

PHP usage

use Rmb32\Barntree\Api\Factory\TreeFactory;
use Rmb32\Barnscaff\Api\Factory\ScaffolderFactory;
use Rmb32\Barnscaff\Api\Factory\ScannerFactory;

$tree = new TreeFactory()->create($data);

$scaffolder = new ScaffolderFactory()->create();
$plan = $scaffolder->plan($tree, '/path/to/project');
$scaffolder->apply($plan); // writes to disk

$report = new ScannerFactory()->create()->scan($tree, '/path/to/project');
$report->isConformant(); // true

The root item is the folder you name. Below it, each map and list item becomes a folder and each leaf item a .php file, named by the item's name (a member's own, or its type's). Barnscaff never reads a tree file itself: load one with Barntree's TreeFactory or TreeStoreFactory.

Related packages

  • Barntree — defines the Trees whose item trees Barnscaff writes.
  • Barnscaff CLI — the barnscaff scaffold / barnscaff scan commands.
  • Barnark — architecture templates, built on Barntree.

More docs

Internals · History · Known issues

License

Proprietary. See LICENSE. Copyright (c) Roger Barnfather.