ShapeFiles final class
Minn\Ops\ShapeFiles · public/minn/src/Minn/Ops/ShapeFiles.php · 104 lines
The files an install lays at the webroot for tooling to find: the shape files from layout/ (index.php, wp-settings.php, version.php and the rest) and one file for each of the reference's wp-includes and wp-admin/includes files, an empty placeholder or, where layout/ ships one, the engine's loader. An engine update lays them again from the new engine: a file still as the replaced engine wrote it is replaced, a missing one is written, and one the site changed is left alone.
Constants and properties
| const | LAYOUT = array ( 0 => 'index.php', 1 => 'wp-login.php', 2 => 'wp-settings.php', 3 => 'wp-cli.yml', 4 => 'wp-includes/version.php', 5 => 'wp-admin/index.php', ) | The shape files copied from layout/ as they are. |
Public
| static | lay(string $engineDir, string $root): array# | An install: every layout file copied, and each of the reference's files the site lacks written (an empty placeholder found there becomes the loader layout/ ships for it). @return array{layout: int, placeholders: int} how many were written |
| static | refresh(string $engineDir, string $root, string $previous): int# | An update, once the new engine is in place: each file the new engine lays that is missing, or still as the replaced engine ($previous, its folder) laid it, is written from the new one. |
| static | placeholder(string $file): string# | The empty placeholder for one of the reference's files. |
Internals 5
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | boots(string $root): bool# | Whether the webroot boots the engine: its wp-settings.php requires minn/bootstrap.php. | |||
| private | wanted(string $engineDir): array# | @return array<string, string> every file the engine lays, by path from the webroot | |||
| private | referenceFiles(string $engineDir): array# | @return array<string, string> the reference's files, each with the placeholder or loader the engine lays for it | |||
| private | stale(string $path, string $want, array $earlier): bool# |
| |||
| private | write(string $path, string $contents): bool# |
Nothing matches.