Alto Tree builds, parses, traverses, prints, manipulates, and compares hierarchies of files and directories.
<?php
use Alto\Tree\Printer\TreePrinter;
use Alto\Tree\TreeBuilder;
$tree = TreeBuilder::fromPaths([
'project/src/App.php',
'project/tests/AppTest.php',
], 'project');
echo (new TreePrinter())->print($tree);Introduction
- Installation: install the package and verify the runtime.
- Getting started: build and print a first tree.
Trees
- Building: create trees from paths, directories, Git, or custom providers.
- Parsing: read tree-shaped text back into objects.
- Printing: filter, sort, and format tree output.
- Traversal: collect information or visit nodes with custom behavior.
- Editing: split, merge, append, flatten, and rebuild trees.
- Comparing: find and print added, removed, and unchanged paths.