Theme
MMO\client · 1 symbol · generated 27 Oct 2026
Theme
Theme.php:18- Namespace
MMO\client- Extends
- aModule
Index
| assets | ||
| bin | ||
| enabled | ||
| errorTpl | ||
| fonts | ||
| imports | ||
| pages | ||
| releaseCheck | ||
| rootAttributes | ||
| rootElement | ||
| stylesheet | ||
| addAsset($filename, $key) | ||
| BuildHook($manifest, $filename, $options) static | Hook in mmo.json triggered when library is built into a phar package | |
| compileCSS($opts, $dev) | Compile the theme's stylesheet ($stylesheet) into getBin('css'). | |
| compileJHS($sassOpts, $dev) | Compile every .jhs of getAssets('jhs') into getBin('jhs'). | |
| compileJS($opts, $dev) | Bundle every .js of getAssets('js') into getBin('js'). | |
| compileOther() | ||
| compileSVG() | ||
| configureHtmlDocument($document) | Configure the HTMLDocument to include the mmo-app custom element as root | |
| createErrorResponse($e, $route) | Import an error template when the route trigger an exception. | |
| DefaultConfig() static | ||
| exportMenu($content, $document) | ||
| getAssets($key, $resolve) | ||
| getBin($key, $resolve) | ||
| getBinUrl($key) | ||
| getBinVersion($key, $sources) | The version of a built file: its modification time, or in dev mode that of its newest source when it is newer. | |
| getRelease() | What identifies the code the site runs. | |
| getStylesheet($resolve) | ||
| getVersionedBinUrl($key) | ||
| hasAsset($filename, $key) | ||
| isUpToDate($key, $time) | ||
| loopAssets($key, $resolve) | ||
| onDocumentInit($event) | Configure HTMLDocument after it has been created | |
| onPageContents($contents) | ||
| onRelease($response) | Every response says the release the site runs in X-App-Version -- json included: the calls a page makes tell it when the site was deployed again since it was loaded (MMO.release, src/js/core/Re… | |
| onResponse($response) | ||
| onRoute($route) | ||
| recordSources($key) | ||
| removeAsset($filename, $key) | Remove from the list $key every entry that resolves to $filename (the file, folder or glob as it was added). | |
| sourcesFingerprint($key) | ||
| unserialize($data, $path, $instances) | The asset lists of the configuration are ADDED to the defaults, never merged onto them. | |
| __wakeup() |
Properties11
assets
- Type
- array
bin
- Type
- array
enabled
- Type
- bool
errorTpl
- Type
- string
fonts
- Type
- array
imports
- Type
- array
pages
- Type
- array
releaseCheck
- Type
- bool
rootAttributes
- Type
- array
rootElement
- Type
- string
stylesheet
- Type
- string
- See
getBin('css') and linked in every html document. It declares the design tokens at:root, from where they inherit into every shadow root, so a reskin is this one file.
Methods31
addAsset($filename, $key)
Theme.php:529BuildHook($manifest, $filename, $options)
staticTheme.php:106Hook in mmo.json triggered when library is built into a phar package
compileCSS($opts, $dev)
Theme.php:630Compile the theme's stylesheet ($stylesheet) into getBin('css').
| $opts = [] | array | per-compilation overrides for SCSCompiler |
| $dev = true | bool | false to force a production build (compressed, no source map) |
| returns | void | |
| throws | when the stylesheet is not a .scs file |
compileJHS($sassOpts, $dev)
Theme.php:654Compile every .jhs of getAssets('jhs') into getBin('jhs').
compileJS($opts, $dev)
Theme.php:609Bundle every .js of getAssets('js') into getBin('js').
| $opts = [] | array | per-compilation overrides for JSCompiler |
| $dev = true | bool | false to force a production build (minified, no source map) |
| returns | void |
compileOther()
Theme.php:659| returns | void |
compileSVG()
Theme.php:598| returns | void |
configureHtmlDocument($document)
Theme.php:281Configure the HTMLDocument to include the mmo-app custom element as root
| $document | HtmlDocument | |
| returns | void |
createErrorResponse($e, $route)
Theme.php:175Import an error template when the route trigger an exception.
DefaultConfig()
staticTheme.php:42| returns | array |
exportMenu($content, $document)
Theme.php:188| $content | Content | |
| $document | HtmlDocument | |
| returns | void |
getAssets($key, $resolve)
Theme.php:566getBin($key, $resolve)
Theme.php:450getBinUrl($key)
Theme.php:455getBinVersion($key, $sources)
Theme.php:481The version of a built file: its modification time, or in dev mode that of its newest source when it is newer.
- See
__wakeup): with the bundle's own time alone, that page still linked the url of the old build, which the browser had cached, and a change was seen only on the reload after (or a forced one).
| $key | string | a file of $bin |
| $sources = true | bool | also the times of its sources (loopAssets): what a dev build is about to become |
| returns | int | a unix time, 0 when the file is not built and has no source |
getRelease()
Theme.php:499| returns | string | printable ascii only (it goes in a header), '' when nothing is known |
getStylesheet($resolve)
Theme.php:525getVersionedBinUrl($key)
Theme.php:465| $key | string | a file of $bin: js, jhs, css, svg |
| returns | string | its url, with getBinVersion (?v=): another url once a source changes or it is built again |
hasAsset($filename, $key)
Theme.php:557isUpToDate($key, $time)
Theme.php:410| $key | string | a file of $bin |
| $time = null | null | int | the time to compare its sources with, else the built file's: then its sources must also be the ones it was built from (sourcesFingerprint) -- a package added to the project brings sources older than the bundle, a source removed none newer |
| returns | bool | false when the file must be built again |
loopAssets($key, $resolve)
Theme.php:570onDocumentInit($event)
Theme.php:203Configure HTMLDocument after it has been created
| $event | DocumentInit | |
| returns | void |
onPageContents($contents)
Theme.php:256| $contents | PageContents | |
| returns | void |
onRelease($response)
Theme.php:249Every response says the release the site runs in X-App-Version -- json included: the calls a page makes tell it when the site was deployed again since it was loaded (MMO.release, src/js/core/Release.js).
onResponse($response)
Theme.php:215onRoute($route)
Theme.php:208recordSources($key)
Theme.php:446| $key | string | a file of $bin, just built from its sources (isUpToDate) |
| returns | void |
removeAsset($filename, $key)
Theme.php:544Remove from the list $key every entry that resolves to $filename (the file, folder or glob as it was added).
sourcesFingerprint($key)
Theme.php:439| $key | string | a file of $bin |
| returns | string | what identifies the list of its sources (loopAssets), whatever their contents: kept beside the built file ({bin}.sources, recordSources), a hash only since {bin} is served |
unserialize($data, $path, $instances)
Theme.php:84The asset lists of the configuration are ADDED to the defaults, never merged onto them.
__wakeup()
Theme.php:125| returns | void |
Inherited members (46)
| Constants | Declared by | Description | |
|---|---|---|---|
ALERT | iLogLevel | Alert: Action must be taken immediately. | |
ALL | iLogLevel | Mask for all | |
ALL_PLUS | iLogLevel | debug everything | |
BACKTRACE | iLogLevel | ||
CRITICAL | iLogLevel | Critical: Critical conditions. | |
DEBUG | iLogLevel | Debug: Detailed debug information. | |
DEEP | iLogLevel | debug everything with arguments | |
EMERGENCY | iLogLevel | Emergency: System is unusable. | |
ERROR | iLogLevel | Error: Runtime errors that do not require immediate action but should typically be logged and monitored. | |
ERROR_PLUS | iLogLevel | Mask for all error | |
FATAL | iLogLevel | Mask for all fatal error | |
INFO | iLogLevel | Info: Interesting events. | |
INFO_PLUS | iLogLevel | Mask for all errors/warning/notices/info | |
MEMORY | iLogLevel | include backtrace object | |
NOTICE | iLogLevel | Notice: Normal but significant events. | |
NOTICE_PLUS | iLogLevel | Mask for all errors/warning/notices/info | |
TRACE | iLogLevel | include backtrace as origins | |
WARNING | iLogLevel | Warning: Exceptional occurrences that are not errors. | |
WARNING_PLUS | iLogLevel | Mask for all errors and warnings |
| Properties | Declared by | Description | |
|---|---|---|---|
verbosity | aModule |
| Methods | Declared by | Description | |
|---|---|---|---|
alert($message, $context) | aModule | Action must be taken immediately. | |
backtraces($message, $context) | aModule | Force-log a message at INFO level together with a full stack trace/memory snapshot (iLogLevel::BACKTRACE), bypassing the verbosity mask entirely (any non-zero verbosity is enough to trigger it). | |
Configure($config) | aModule | Merge $config into this module's configuration in the shared Configuration. | |
critical($message, $context) | aModule | Critical conditions. No-op if CRITICAL is currently filtered out by the verbosity mask. | |
debug($message, $context) | aModule | Detailed debug information. | |
debugName() | aModule | Human-readable identifier used as the default {origin} in this instance's log messages. | |
emergency($message, $context) | aModule | System is unusable. No-op if EMERGENCY is currently filtered out by the verbosity mask. | |
error($message, $context) | aModule | Runtime errors that do not require immediate action but should typically be logged and monitored. | |
getVerbosity() | aModule | ||
info($message, $context) | aModule | Interesting events. No-op if INFO is currently filtered out by the verbosity mask. | |
Instantiate($config) | aModule | (Re)create the shared instance immediately, configured with $config merged into the class's existing config. | |
IsShared() | aModule | ||
log($level, $message, $context) | aModule | Logs with an arbitrary level. | |
notice($message, $context) | aModule | Normal but significant events. | |
offsetExists($key) | aModule | \ArrayAccess::offsetExists -- tells whether $key is a declared property at all, regardless of whether it is currently readable/writable through array access. | |
offsetGet($key) | aModule | \ArrayAccess::offsetGet -- reads a property directly, unless it has a #[Serialize(serialize: 'methodName')] attribute, in which case that zero-argument method is called instead (e.g. | |
offsetSet($key, $value) | aModule | \ArrayAccess::offsetSet -- sets a property directly, unless it has a #[Serialize(unserialize: 'methodName')] attribute, in which case that method is called with $value instead (e.g. | |
offsetUnset($key) | aModule | \ArrayAccess::offsetUnset -- equivalent to $module[$key] = null. | |
serialize($path, $serializer) | aModule | \MMO\core\interfaces\iSerializable::serialize -- exports every property (via | |
setVerbosity($verb) | aModule | Set the current verbosity mask, replacing whatever it was before. | |
Shared() | aModule | Get the shared instance, creating (and configuring) it on first call. | |
testVerbosity($level) | aModule | Test whether a given level (or set of levels) is currently enabled by this instance's verbosity mask. | |
traitUnshare($serialize) | aModule | Remove the shared instance, so the next Shared() call creates a fresh one. | |
Unshare($serialize) | aModule | Like tSingleton::Unshare, but also disconnects this module's instance from every event it was listening to (via Event::DisconnectListeners) before dropping it. | |
warning($message, $context) | aModule | Exceptional occurrences that are not errors. | |
__construct($config) | aModule | protected constructor, so it is not possible to do new Module(...) called by the serialization process just before being injected with data. |