API / Minn\Extension / Loader

Loader final class

Minn\Extension\Loader · public/minn/src/Minn/Extension/Loader.php · 129 lines

Finds extensions under wp-content/plugins and wp-content/mu-plugins, decides which are active, autoloads them, and asks each to register. An extension that throws is logged and skipped; the page still renders.

Constants and properties

privatearray $found
privatearray $active
privatereadonly string $contentDir

Promoted from the constructor.

privatereadonly Minn\Content\Site $site

Promoted from the constructor.

Public

new__construct(string $contentDir, Minn\Content\Site $site)#
methodfound(): array#

Every extension manifest on disk.

@return list<Manifest> every extension on disk
methodrefresh(): void#

Forgets the cached activation list after an option write.

methodactive(): array#

The manifests that are active.

@return list<Manifest> the extensions this site has switched on
methoddeclaredTypes(): array#

Extra post types declared by active extensions, keyed by slug.

@return array<string, array<string, mixed>>
methodreplacements(): array#

Which active WordPress plugin files an extension stands in for. @return array<string, string> plugin file => extension slug

@return array<string, string> plugin file => extension slug
methodregister(Minn\Extension\Seams $seams): void#

Registers every active extension, each on seams of its own; one that throws adds nothing.

Internals 1

Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.

privateautoload(Minn\Extension\Manifest $manifest): void#