Index

DocIndex

MMO\doc · 1 symbol · generated 30 Sep 2026

class

DocIndex

DocIndex.php:22

Everything the documentation can point a reader at, in one list: what the index page lists and what the search box searches (DocPageController::routeIndex, SearchController).

class MMO\doc\DocIndex
Namespace
MMO\doc
It starts from the `index.json` files the generators write ([`Documentor::buildIndex`](https://mcp.mmoframework.fr/documentation/mmo.doc/php/Documentor.md#documentor-buildindex), [`JSDocumentor::buildIndex`](https://mcp.mmoframework.fr/documentation/mmo.doc/php/JSDocumentor.md#jsdocumentor-buildindex)) and completes them with what they do not hold: the php namespaces (javascript already writes its own), the exceptions and the abstract classes told apart from the other classes, and the hand-written pages of every documentation folder. All of it is read once per request, never written.
$results = \MMO\doc\DocIndex::Search('route', 10, 'mmo.core/php/server/Route.md');

Index

KIND_ABSTRACT
KIND_EXCEPTION
KIND_PAGE
SECTIONS
WEIGHTS
entries static
Guides($library, $folder) staticThe hand-written pages of a documentation folder: every markdown file that is not a generated page (a generated page has its .doc.json model next to it, and its symbols are in the index already).
IsOn($page, $context) static
KindOf($entry) staticThe kind an entry is listed under: its own, except for an exception class and an abstract one, which a reader looks for separately -- an abstract exception is an exception first.
LibraryOf($page) static
Load($reload) static
Namespaces($entries) staticThe php namespaces, which the php generator does not index on their own: one entry for each namespace holding something documented, pointing at the page of its functions when it has some, at the fo…
Search($q, $limit, $context) staticSearch for anything by (sub)string: what is documented on the page the reader is on comes first, then everything else.
Sections() static

Constants5

KIND_ABSTRACT

const KIND_ABSTRACT = 'abstract'

KIND_EXCEPTION

const KIND_EXCEPTION = 'exception'

KIND_PAGE

const KIND_PAGE = 'page'

SECTIONS

const SECTIONS = […13 items]

WEIGHTS

const WEIGHTS = […14 items]

Properties1

entries

static
protected static ?array $entries = null
Type
null | array

Methods8

Guides($library, $folder)

staticDocIndex.php:226

The hand-written pages of a documentation folder: every markdown file that is not a generated page (a generated page has its .doc.json model next to it, and its symbols are in the index already).

protected static function Guides(string $library, string $folder): array
$librarystringthe package the folder belongs to
$folderstring
returnsarrayindex entries, keyed by page path

IsOn($page, $context)

staticDocIndex.php:182
static function IsOn(?string $page, string $context): bool
$pagenull | stringan entry's page path
$contextstringthe page the reader is on, or a folder of pages, Search
returnsboolwhether that entry is documented on that page (or in that folder)

KindOf($entry)

staticDocIndex.php:203

The kind an entry is listed under: its own, except for an exception class and an abstract one, which a reader looks for separately -- an abstract exception is an exception first. The php generator flags both (exception, abstract); an index written before it did is read by reflection when the class is loaded, and by the framework's naming conventions otherwise (eNotFound, aController).

static function KindOf(array $entry): string
$entryarray
returnsstring
\MMO\doc\DocIndex::KindOf(['kind' => 'class', 'name' => 'MMO\core\classes\aController', 'shortName' => 'aController']); // 'abstract'

LibraryOf($page)

staticDocIndex.php:189
static function LibraryOf(?string $page): ?string
$pagenull | string
returnsnull | stringthe package a page path belongs to: its first segment, mmo.core for mmo.core/php/Route.md

Load($reload)

staticDocIndex.php:71
static function Load(bool $reload = false): array
$reload = falseboolread the files again instead of returning what this worker already read
returnsarrayevery documented thing of every installed package, keyed by its full name: {kind, name, namespace, shortName, page, anchor, summary, language, library}

Namespaces($entries)

staticDocIndex.php:254

The php namespaces, which the php generator does not index on their own: one entry for each namespace holding something documented, pointing at the page of its functions when it has some, at the folder of its classes otherwise.

protected static function Namespaces(array $entries): array
$entriesarray
returnsarrayindex entries, keyed by namespace

Sections()

staticDocIndex.php:162
static function Sections(): array
returnsarraywhat the index page lists: one section per kind, in the order of SECTIONS, each sorted by short name. Empty sections are left out