MMOframework
Why AI Playground Libraries Documentation Search Agency
FR EN
Index

MMO\doc

MMO\doc · 20 symbols · generated 27 Oct 2026

function

addSearchSource

bootstrap.php:232

Makes the documentation searchable from <mmo-app>'s command palette, the one search box of the application: the search endpoint (SearchController::routeSearch) is declared in MMO.config.searches, and the palette lists what it answers under its own heading, next to the pages and the commands.

function addSearchSource(MMO\core\documents\Document $document, ?string $page = null): void
Namespace
MMO\doc
The first call wins: [`DocPageController`](https://mmoframework.fr/en/documentation/mmo.doc/php/controllers/DocPageController.md#docpagecontroller) calls it first with the page the reader is on, so what is documented on that page comes first; the listener every html page goes through only adds it when missing.
$documentDocumentanything but an html document is left alone
$page = nullnull | stringthe page path the reader is on (mmo.core/php/server/Route.md), or a folder of pages
returnsvoid
Call graph
function

anchor

functions.php:15

The canonical in-page anchor for a symbol or member name.

function anchor(string $name): string
Namespace
MMO\doc
Every renderer goes through this one function, so a link built by [`MarkdownPrinter`](https://mmoframework.fr/en/documentation/mmo.doc/php/MarkdownPrinter.md#markdownprinter) and one built by [`DocPageController`](https://mmoframework.fr/en/documentation/mmo.doc/php/controllers/DocPageController.md#docpagecontroller) always agree: lowercased, namespace/path separators and sigils dropped, anything else that is not a letter, a digit or a `-` folded into a `-`.
$namestringe.g. MMO\core\server\Route, MMO.core.Map, Route::getUri, $content
returnsstringe.g. mmocoreserverroute, mmo-core-map, route-geturi, content
\MMO\doc\anchor('Route::getUri'); // 'route-geturi'
Call graph
function

buildDocumentation

build.php:33

Build the code documentation of $names with mmo.doc, into each library's own documentation folder: docs/php/ from the reflection of its loaded php, docs/js/ from its parsed javascript and .jhs -- a .md page and its .doc.json model per file, and an index.json. Every library's git ignores them; a phar carries them (PackageManifest::build takes its documentation folders whole).

function buildDocumentation(?array $names = null, ?callable $log = null): bool
Namespace
MMO\doc
What an earlier run generated is removed first: the generators never remove a page, and the index keeps every symbol it ever saw, so a class deleted since would still be documented. Only what git ignores in those folders is removed -- a file a library commits there is left alone -- and nothing is removed unless everything can be. The libraries must be loaded (the php generator documents what reflection sees), so this runs in a script that loaded the project, not in a request. `{bin}` is moved to a temporary folder: Documentor wires itself into mmo.client when it is built, which would write prism.js and mmo.doc.css into the project's own.
$names = nullnull | arraythe libraries, every one the project packages when null (its includes, minus itself)
$log = nullnull | callable
returnsboolfalse when a generator failed: what it was building is incomplete
throwswhen a name is not a library the project packages
throwswhen an earlier run's files cannot be replaced (they belong to another user, the web server's through mmo.doc's control panel): nothing was removed, and the message says how to give them back
\MMO\doc\buildDocumentation(['mmo.core'], fn($line) => print("$line\n")); // true
Call graph
function

compileDocumentationCss

bootstrap.php:277

Compiles src/styles/documentation.scs to {bin}/mmo.doc.css, recompiling only when the source is newer (dev mode only -- like MMO\client\Theme's own asset jobs, a production deploy is expected to build this ahead of time).

function compileDocumentationCss(): ?string
Namespace
MMO\doc
It is Simple CSS, compiled by [`SCSCompiler`](https://mmoframework.fr/en/documentation/mmo.client/php/SCSCompiler.md#scscompiler) with `emitThemes` off: the design tokens are already declared on `:root` by the app's own `mmo.client.css`, and this stylesheet only *references* them, so a theme switch reaches the documentation pages like any other page.
returnsnull | stringthe absolute compiled filename, or null when nothing has been built yet
Call graph
function

connectPageRoutes

bootstrap.php:294

Registers the html documentation renderer, which only makes sense once mmo.client provides the page tree.

function connectPageRoutes(): void
Namespace
MMO\doc
returnsvoid
Call graph
function

connectReadOnly

bootstrap.php:190

Serve the documentation to readers, and nothing else: for a public site (www.mmoframework.fr) rather than a developer's checkout. documentation is the index of everything documented, documentation/mmo.core/php/server/Route.md a page of it, under a bar searching every symbol (doc/search).

function connectReadOnly(): void
Namespace
MMO\doc
Only what reads: the page tree, its renderer and the search. Call it INSTEAD of [`Documentor::Shared()`](https://mmoframework.fr/en/documentation/mmo.core/php/classes/aModule.md#amodule-shared), which also connects the control panel (`tools/mmo/doc`: anyone could regenerate the documentation) and the example runner (`doc/example/run`, which runs code), and puts the panel in the menu. Needs mmo.client. The menu lists the documentation and its libraries, not the thousand pages under them, which every page of the site would carry: they stay reachable from the index, the search and a library's page. A scaffolding template (`{{name}}`) documents no library and is hidden. Like [`connectToClient()`](https://mmoframework.fr/en/documentation/mmo.doc/php.md#connecttoclient), call it once, before the first request is routed.
returnsvoid
\MMO\app([...]); \MMO\doc\connectReadOnly(); \MMO\run();
Call graph
function

connectRoutes

bootstrap.php:289

Registers this package's controllers as routes (connect).

function connectRoutes(): void
Namespace
MMO\doc
returnsvoid
Call graph
function

connectToClient

bootstrap.php:143
function connectToClient(): void
Namespace
MMO\doc
returnsvoid
Call graph
function

copyPrismAsset

bootstrap.php:252

Copies mmo.client's vendored vendor/prism/prism.js (a Prism.js build already bundling the markup/js/scss/ css/markdown/php grammars) out to {bin}/prism.js, so it's actually servable -- Theme's own asset pipeline never picks up files under a package's vendor/ folder. Only copies when missing/stale.

function copyPrismAsset(): ?string
Namespace
MMO\doc
returnsnull | stringthe absolute copied filename, or null if mmo.client (or its vendored prism) isn't there.
Call graph
function

directImplementations

functions.php:59

Get the direct interfaces implemented by a class

function directImplementations(ReflectionClass|string $ref): array
Namespace
MMO\doc
$refReflectionClass | stringthe classname or its reflection
returnsarraya list of interfaces name
throws
Call graph
function

directUses

functions.php:40

Get the direct trait implemented by a class

function directUses(ReflectionClass|string $ref): array
Namespace
MMO\doc
$refReflectionClass | stringthe classname or its reflection
returnsarraya list of traits name
throws
Call graph
function

generatedFiles

build.php:120
function generatedFiles(string $folder, string $library): array
Namespace
MMO\doc
$folderstring
$librarystring
returnsarraywhat an earlier run generated in $folder, a library's documentation folder: php/, js/ and their php.md/js.md summaries, and only the files the library's git ignores (none when it is no checkout)
Call graph

Uses (1)

function

includeDocumentation

bootstrap.php:65

Include the documentation in the html response This function is added as a job in the application.

function includeDocumentation(MMO\client\events\PageContents $contents): void
Namespace
MMO\doc
If mmo.client is included, this function is attached to PageContents signal.
$contentsPageContents
returnsvoid
Call graph
function

isInNamespaces

functions.php:26

Check if a namespace is inside a list of other namespaces

function isInNamespaces(string $namespace, ?array $namespaces): bool
Namespace
MMO\doc
$namespacestringthe namespace to test
$namespacesnull | arraythe list of available namespaces. If null, always return true.
returnsbool
Call graph
function

linkSees

functions.php:112

Replace every @see reference of a markdown text with a link to its target, or with inline code when the target is documented nowhere. Fenced code blocks are left alone.

function linkSees(string $text, array $sees, callable $href): string
Namespace
MMO\doc
$textstringmarkdown
$seesarraythe resolved references, keyed by target (seeTargets), as the reflector stores them in a node's sees
$hrefcallable
returnsstring
\MMO\doc\linkSees('(@see stop)', ['stop' => ['url' => 'https://x']], fn($r) => $r['url']); // '([`stop`](https://x))'
Call graph
function

lockedFiles

build.php:148
function lockedFiles(string $folder): array
Namespace
MMO\doc
$folderstring
returnsarraywhat of an earlier run in $folder cannot be replaced: a file, or a folder whose entries cannot be removed. Written by another user -- the web server, through mmo.doc's control panel (tools/mmo/doc).
Call graph

Uses (1)

function

seeLabel

functions.php:167
function seeLabel(string $target): string
Namespace
MMO\doc
$targetstring
returnsstringhow a @see target reads once linked: its short name, Route::stop() for \MMO\core\server\Route::stop(), anchor for \MMO\doc\anchor.
Call graph

Used by (1)

function

seeParts

functions.php:157
function seeParts(string $target): array
Namespace
MMO\doc
$targetstring
returnsarraythe names a a/b target lists, or [] when it is a single name, a url or a path.
Call graph
function

seeTarget

functions.php:144
function seeTarget(string $raw): string
Namespace
MMO\doc
$rawstring
returnsstringa raw @see target without the punctuation of the sentence it ends (stop). → stop).
Call graph
function

seeTargets

functions.php:90

Every target the @see references of a text point at, cleaned of the punctuation the sentence around it glued on (@see stop., (stop)), and split when several are written as one (@see getFilename/getUrl).

function seeTargets(string $text): array
Namespace
MMO\doc
$textstring
returnsarraythe targets, as written
\MMO\doc\seeTargets('Run it (@see Route::stop, @see a/b).'); // ['Route::stop', 'a', 'b']
Call graph