Services final class
Minn\Rest\Services · public/minn/src/Minn/Rest/Services.php · 417 lines
The objects one REST request shares, each made once, on first use, from the database door and the request. Every getter is typed and names its dependencies in plain constructor calls: there is no autowiring, and get() knows only the names listed here, so a wrong one fails at the first call rather than deep in a handler.
Uses 53 (show)
Constants and properties
| private | NAMED = array ( 'Minn\\Content\\Users' => 'users', 'Minn\\Content\\Posts' => 'posts', 'Minn\\Content\\Terms' => 'terms', 'Minn\\Content\\Comments' => 'comments', 'Minn\\Content\\Site' => 'site', 'Minn\\Content\\PostWriter' => 'writer', 'Minn\\Front\\Permalinks' => 'permalinks', 'Minn\\Rest\\RestUrl' => 'url', 'Minn\\Auth\\Capabilities' => 'capabilities', 'Minn\\Rest\\Caller' => 'caller', 'Minn\\Rest\\Subjects' => 'subjects', 'Minn\\Extension\\Loader' => 'loader', 'Minn\\Rest\\Types' => 'types', 'Minn\\Rest\\Taxonomies' => 'taxonomies', 'Minn\\Media\\Uploads' => 'uploads', 'Minn\\Content\\Inventory' => 'inventory', 'Minn\\Ops\\Packages' => 'packages', 'Minn\\Admin\\App' => 'app', 'Minn\\Ops\\Logs' => 'logs', 'Minn\\Ops\\Updates' => 'updates', 'Minn\\Content\\Menus' => 'menus', 'Minn\\Content\\Revisions' => 'revisions', 'Minn\\Auth\\Sessions' => 'sessions', 'Minn\\Auth\\ApplicationPasswords' => 'applicationPasswords', 'Minn\\Admin\\Translations' => 'translations', 'Minn\\Admin\\Appearance' => 'appearance', 'Minn\\Admin\\HiddenIntegrations' => 'hiddenIntegrations', 'Minn\\Admin\\ActivityFeed' => 'activityFeed', 'Minn\\Admin\\Dashboard' => 'dashboard', 'Minn\\Admin\\Notifications' => 'notifications', 'Minn\\Ops\\Diagnostics' => 'diagnostics', 'Minn\\Media\\Writer' => 'mediaWriter', 'Minn\\Rest\\Schema' => 'schema', 'Minn\\Rest\\PostObject' => 'postObject', 'Minn\\Rest\\TermObject' => 'termObject', 'Minn\\Rest\\UserObject' => 'userObject', 'Minn\\Rest\\MediaObject' => 'mediaObject', 'Minn\\Rest\\CommentObject' => 'commentObject', 'Minn\\Theme\\UserStyles' => 'userStyles', 'Minn\\Theme\\ThemeStyles' => 'themeStyles', ) | |
| private | array $made | |
| private | readonly Minn\Db $db | Promoted from the constructor. |
| private | readonly Minn\Http\Request $request | Promoted from the constructor. |
| private | readonly string $root | Promoted from the constructor. |
| private | readonly string $engineDir | Promoted from the constructor. |
Public
| new | __construct(Minn\Db $db, Minn\Http\Request $request, string $root, string $engineDir)# | ||||
| static | forRequest(Minn\Db $db, Minn\Http\Request $request): self# | The services for one request, none made yet. | |||
| method | get(string $class): object# | The service registered under a class name. Only the names in NAMED answer; anything else is a programming error and says so at once.
| |||
| method | subjects(): Minn\Rest\Subjects# | The record lookups the policy gate asks before it judges a caller. | |||
| method | db(): Minn\Db# | The database door. | |||
| method | request(): Minn\Http\Request# | The request being answered. | |||
| method | root(): string# | The site root, no trailing slash. | |||
| method | contentDir(): string# | wp-content under the site root. | |||
| method | users(): Minn\Content\Users# | The users repository. | |||
| method | posts(): Minn\Content\Posts# | The posts repository. | |||
| method | terms(): Minn\Content\Terms# | The terms repository. | |||
| method | comments(): Minn\Content\Comments# | The comments repository. | |||
| method | site(): Minn\Content\Site# | The site's options. | |||
| method | writer(): Minn\Content\PostWriter# | The post writer. | |||
| method | revisions(): Minn\Content\Revisions# | Revisions and autosaves. | |||
| method | userStyles(): Minn\Theme\UserStyles# | The site editor's saved global styles. | |||
| method | themeStyles(): Minn\Theme\ThemeStyles# | The active theme's global styles and variations. | |||
| method | menus(): Minn\Content\Menus# | Classic menus and their items. | |||
| method | inventory(): Minn\Content\Inventory# | What wp-content holds: plugins, themes, drop-ins. | |||
| method | permalinks(): Minn\Front\Permalinks# | Link building from the permalink structure. | |||
| method | url(): Minn\Rest\RestUrl# | REST URL building. | |||
| method | capabilities(): Minn\Auth\Capabilities# | The capability engine. | |||
| method | caller(): Minn\Rest\Caller# | Who is making this call. | |||
| method | sessions(): Minn\Auth\Sessions# | The session store. | |||
| method | applicationPasswords(): Minn\Auth\ApplicationPasswords# | Application passwords for Basic auth. | |||
| method | loader(): Minn\Extension\Loader# | The extension loader. | |||
| method | types(): Minn\Rest\Types# | The post types the REST surface knows. | |||
| method | taxonomies(): Minn\Rest\Taxonomies# | The taxonomies the REST surface knows. | |||
| method | uploads(): Minn\Media\Uploads# | The uploads directory. | |||
| method | mediaWriter(): Minn\Media\Writer# | Stores an upload as an attachment. | |||
| method | schema(): Minn\Rest\Schema# | The JSON Schema validator, with the reference's filters passed in. | |||
| method | app(): Minn\Admin\App# | The Minn Admin bundle on disk. | |||
| method | packages(): Minn\Ops\Packages# | Installing and removing themes and extensions. | |||
| method | logs(): Minn\Ops\Logs# | The debug log reader. | |||
| method | updates(): Minn\Ops\Updates# | Update checks and offers. | |||
| method | translations(): Minn\Admin\Translations# | Locales and the app's catalogs. | |||
| method | appearance(): Minn\Admin\Appearance# | The app's per-user appearance. | |||
| method | # | The app's per-user hidden views. | |||
| method | activityFeed(): Minn\Admin\ActivityFeed# | What happened lately. | |||
| method | dashboard(): Minn\Admin\Dashboard# | The overview payload. | |||
| method | releases(): Minn\Ops\Releases# | Minn's own releases, asked of GitHub once a day. | |||
| method | engineChangelog(): Minn\Ops\Changelog# | Minn's changelog, read from its repository. | |||
| method | adminChangelog(): Minn\Ops\Changelog# | Minn Admin's changelog, read from its repository. | |||
| method | coreStatus(): Minn\Ops\CoreStatus# | Minn's version and the release on offer, behind the app's update banner. | |||
| method | engineUpdate(): Minn\Ops\EngineUpdate# | The engine replacing itself with a release. | |||
| method | notifications(): Minn\Admin\Notifications# | The bell feed. | |||
| method | diagnostics(): Minn\Ops\Diagnostics# | The System view's payload. | |||
| method | templates(): ?Minn\Theme\TemplateIndex# | The active block theme's templates; null under a classic theme, where the routes answer as the reference does when it never registered them. | |||
| method | templateWriter(): ?Minn\Theme\TemplateWriter# | Writes block templates; null under a classic theme. | |||
| method | postObject(): Minn\Rest\PostObject# | The wp/v2 post shape. | |||
| method | termObject(): Minn\Rest\TermObject# | The wp/v2 term shape. | |||
| method | userObject(): Minn\Rest\UserObject# | The wp/v2 user shape. | |||
| method | mediaObject(): Minn\Rest\MediaObject# | The wp/v2 media shape. | |||
| method | commentObject(): Minn\Rest\CommentObject# | The wp/v2 comment shape. |
Internals 1
Private and protected methods: how the class does its work. Not a contract; they change whenever the code is tidied.
| private | share(string $name, Closure $make): object# |
|
Nothing matches.