Preflight final class
Minn\Cli\Preflight · public/minn/src/Minn/Cli/Preflight.php · 417 lines
What a site will and will not get from the engine, before anything moves: the config it can read, the database it can reach, the theme's kind, the plugins the extensions cover, and the content survey (the shortcodes, third-party blocks, menus, extra tables, and extra post types in the database). Every finding is a light; the worst decides.
Constants and properties
| private | AREAS = array ( 'admin' => 'wp-admin', 'editor' => 'editor', 'customizer' => 'Customizer', 'xmlrpc' => 'XML-RPC', 'omitted' => 'left out', ) | What the dead-end areas are, as a report says them. |
| private | array $lines | |
| private | string $worst | |
| private | readonly string $engineDir | Promoted from the constructor. |
Public
| new | __construct(string $engineDir = '')# |
| |||
| method | lines(): array# | The report, one line per finding. @return list<string> @return list<string> | |||
| method | run(string $root): string# | Runs every check and returns the worst light: GREEN, AMBER, or RED. | |||
| static | themeKind(string $dir, string $parentDir): string# | Same line Theme::active / ClassicTheme::active draw: a block template index (child or parent) is a block theme; otherwise a parent index.php is a classic theme. |
Internals 14
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | readConfig(string $file): array# | The database constants and prefix, read from the file as text: nothing in it runs. | |||||||||
| private | env(string $name, ?string $default = NULL): ?string# | getenv, then {NAME}_FILE (Docker secrets), then the fallback. Matches the official image's getenv_docker without running that PHP. | |||||||||
| private | optionReader(mysqli $db, string $prefix): Closure# | A reader for one option's raw value, on the site's own connection. @return \Closure(string): ?string @return \Closure(string): ?string | |||||||||
| private | preflightTheme(string $root, Closure $option): void# | The active theme: present, and block or classic. @param \Closure(string): ?string $option
| |||||||||
| private | preflightPlugins(string $root, Closure $option): array# | The active plugins against the extensions on disk: what each provides, what will not run, and the shortcodes, blocks, and types the active extensions cover, for the content survey.
@return array{array<string, string>, array<string, string>, array<string, string>} | |||||||||
| private | preflightPlugin(string $file, string $read, string $label, Minn\Runtime\SymbolGap $gap, array $deadEnds): void# | One plugin as the engine's gate will judge it: refused for what the engine lacks, or for declaring a function the engine already defines in its main file; otherwise it runs, and the calls that answer with nothing on Minn are counted by area.
| |||||||||
| private | some(array $names): string# |
| |||||||||
| private | surveyContent(mysqli $db, string $prefix, array $coveredShortcodes, array $coveredBlocks, array $coveredTypes): void# | What the content holds that the engine must serve: shortcodes and third-party blocks against the extensions covering them, menus, extra tables, and extra post types.
| |||||||||
| private | surveyMarkup(mysqli $db, string $prefix, array $coveredShortcodes, array $coveredBlocks): void# |
| |||||||||
| private | surveyMenus(mysqli $db, string $prefix): void# | ||||||||||
| private | surveyTables(mysqli $db, string $prefix): void# | ||||||||||
| private | surveyTypes(mysqli $db, string $prefix, array $coveredTypes): void# |
| |||||||||
| private | light(string $light, string $text): void# | ||||||||||
| private | say(string $line): void# |
Nothing matches.