API / Minn\Admin / App

App final readonly class

Minn\Admin\App · public/minn/src/Minn/Admin/App.php · 100 lines

The Minn Admin app on disk: the symlinked dev copy the engine serves the shell and assets from. Minn Admin is MIT, so reading its files is fine.

Constants and properties

privateASSET_TYPES = array ( 'css' => 'text/css', 'js' => 'application/javascript', 'woff2' => 'font/woff2', 'woff' => 'font/woff', 'svg' => 'image/svg+xml', 'png' => 'image/png', 'json' => 'application/json', )
privatereadonly string $dir

Promoted from the constructor.

Public

new__construct(string $dir)#
staticswitchedOff(string $contentDir, Minn\Content\Site $site): bool#

Whether the site has switched Minn Admin off: its plugin folder is in wp-content/plugins (the record the reference keeps) and active_plugins does not name it. A site that carries only the engine's bundle has no such record and keeps its admin.

methoddir(): string#

Where the bundle sits on disk.

methodinstalled(): bool#

Whether the bundle is on disk.

methodversion(): string#

The bundle's version from its plugin header.

methodfile(string $relative): ?string#

The absolute path of a readable file inside the app, or null.

methodassetVersion(string $relative): string#

A self-busting asset version: app version plus file mtime.

methodasset(string $relative): ?array#

The absolute path and content type of an asset inside the app, or null for anything missing or outside it.

@return array{0: string, 1: string}|null