Index

AdminController

MMO\core\controllers · 1 symbol · generated 30 Sep 2026

class

AdminController

AdminController.php:18

CLI admin commands (status, phpinfo, package listing/building, cron management), run via the shell request dispatcher (aShellController) -- each route_* method backs one #[Command]/#[InteractiveCommand].

class MMO\core\controllers\AdminController extends MMO\core\classes\aShellController
Namespace
MMO\core\controllers
Extends
aShellController
One route is not a command: [`routeServerInfo`](https://mmoframework.fr/documentation/mmo.core/php/controllers/AdminController.md#admincontroller-routeserverinfo) answers the same payload as the `phpinfo` command over http, in json, which is what `<mmo-app>`'s console drawer shows. It is served in dev mode only.

Index

getServerInfo()What the server is made of: the application, the php it runs on, its extensions, and every package the framework included with its version.
printServerInfo($info)Print getServerInfo as text -- the sections, then the packages and the extensions as tables.
routeServerInfo($route)
route_build($route)Read a package manifest (e.g.
route_buildClean($route)Remove every stale build artifact for every included package and its dependencies (interactively confirmed one by one).
route_cron()Print every registered cron job (interval, command, notification email) as a table.
route_cronAdd($route)Add a cron job: interval (the 2nd shell argument) then the command to run (every remaining argument, re-joined with spaces).
route_cronRemove($route)Remove a cron job by its command (every shell argument after the command name, re-joined with spaces).
route_cronRemoveAll($route)Remove every cron job.
route_packages()List every known package and its latest available version.
route_phpinfo($route)Show what the server is made of: interactively, prompts for which section (php's own phpinfo() sections included); non-interactively, prints the whole report as text, or -- with -m -- answers i…
route_status($route)Print (or, with -m, respond with JSON of) every included package's name/version.

Methods12

getServerInfo()

AdminController.php:54

What the server is made of: the application, the php it runs on, its extensions, and every package the framework included with its version. One payload, rendered three ways -- as text by route_phpinfo, as json by the same command with -m, and as json over http by routeServerInfo.

function getServerInfo(): arrayNothing here is read from the request, and `$_SERVER`/`getenv()` are deliberately left out: the http route is a development tool, and an environment dump is where the secrets are.
returnsarray

printServerInfo($info)

AdminController.php:110

Print getServerInfo as text -- the sections, then the packages and the extensions as tables. This is what the phpinfo command shows when it is not asked for one php section in particular.

function printServerInfo(?array $info = null): void
$info = nullnull | arraydefaults to getServerInfo
returnsvoid

routeServerInfo($route)

AdminController.php:189
#[MMO\core\attributes\APIRoute('GET|admin/server-info.json', […2 items], mediaTypes: ['json'])] function routeServerInfo(MMO\core\server\Route $route): arrayDevelopment only: php's version and extension list, the loaded packages and the paths they were loaded from are exactly what an attacker fingerprints a server with, so a non-dev application answers 403 even when the route is registered.
See
getServerInfo over http, as json -- the source of the server tab of <mmo-app>'s console drawer.
$routeRoute
returnsarray
throwsif the application is not running in dev mode

route_build($route)

AdminController.php:217

Read a package manifest (e.g. mmo.json) and build it.

#[MMO\core\attributes\InteractiveCommand('build', 'build packages from manifest', [['type' => 'string', 'description' => 'mmo.json manifest to read']])] function route_build(MMO\core\server\Route $route): void
$routeRoutenon-interactively, the manifest path is the 2nd shell argument ($route->get(1) -- position 0 is the command name itself, e.g. 'build').
returnsvoid

route_buildClean($route)

AdminController.php:227

Remove every stale build artifact for every included package and its dependencies (interactively confirmed one by one).

#[MMO\core\attributes\InteractiveCommand('build-clean', 'clean current build packages for all project and dependencies')] function route_buildClean(MMO\core\server\Route $route): void
$routeRoute
returnsvoid

route_cron()

AdminController.php:241

Print every registered cron job (interval, command, notification email) as a table.

#[MMO\core\attributes\InteractiveCommand('cron', 'show cron table')] function route_cron(): void
returnsvoid

route_cronAdd($route)

AdminController.php:264

Add a cron job: interval (the 2nd shell argument) then the command to run (every remaining argument, re-joined with spaces).

#[MMO\core\attributes\InteractiveCommand('cron-add', 'add cron job', [[…2 items]])] function route_cronAdd(MMO\core\server\Route $route): void
$routeRoute
returnsvoid
cron-add "* * * * *" echo hello

route_cronRemove($route)

AdminController.php:284

Remove a cron job by its command (every shell argument after the command name, re-joined with spaces).

#[MMO\core\attributes\InteractiveCommand('cron-remove', 'remove cron job', [['type' => 'string', 'description' => 'the job to remove']])] function route_cronRemove(MMO\core\server\Route $route): void
$routeRoute
returnsvoid

route_cronRemoveAll($route)

AdminController.php:300

Remove every cron job.

#[MMO\core\attributes\InteractiveCommand('cron-remove-all', 'remove all cron job')] function route_cronRemoveAll(MMO\core\server\Route $route): void
$routeRoute
returnsvoid

route_packages()

AdminController.php:200

List every known package and its latest available version.

#[MMO\core\attributes\InteractiveCommand('packages', 'list available packages')] function route_packages(): void
returnsvoid

route_phpinfo($route)

AdminController.php:150

Show what the server is made of: interactively, prompts for which section (php's own phpinfo() sections included); non-interactively, prints the whole report as text, or -- with -m -- answers it as json, the same payload routeServerInfo serves.

#[MMO\core\attributes\InteractiveCommand('phpinfo', 'php and packages information')] function route_phpinfo(MMO\core\server\Route $route): void
$routeRoute
returnsvoid

route_status($route)

AdminController.php:25

Print (or, with -m, respond with JSON of) every included package's name/version.

#[MMO\core\attributes\Command([['const' => 'status']], 'status of the application')] function route_status(MMO\core\server\Route $route)
$routeRoute
returns
Inherited members (64)
ConstantsDeclared byDescription
ALERTiLogLevelAlert: Action must be taken immediately.
ALLiLogLevelMask for all
ALL_PLUSiLogLeveldebug everything
BACKTRACEiLogLevel
CRITICALiLogLevelCritical: Critical conditions.
DEBUGiLogLevelDebug: Detailed debug information.
DEEPiLogLeveldebug everything with arguments
EMERGENCYiLogLevelEmergency: System is unusable.
ERRORiLogLevelError: Runtime errors that do not require immediate action but should typically be logged and monitored.
ERROR_PLUSiLogLevelMask for all error
FATALiLogLevelMask for all fatal error
INFOiLogLevelInfo: Interesting events.
INFO_PLUSiLogLevelMask for all errors/warning/notices/info
MEMORYiLogLevelinclude backtrace object
NOTICEiLogLevelNotice: Normal but significant events.
NOTICE_PLUSiLogLevelMask for all errors/warning/notices/info
TRACEiLogLevelinclude backtrace as origins
WARNINGiLogLevelWarning: Exceptional occurrences that are not errors.
WARNING_PLUSiLogLevelMask for all errors and warnings
PropertiesDeclared byDescription
interactiveaShellController
verbosityaModule
MethodsDeclared byDescription
alert($message, $context)aModuleAction must be taken immediately.
backtraces($message, $context)aModuleForce-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).
callInteractiveCommand($route, $cmd)aShellControllerInvoke the method behind $cmd (looked up via InteractiveCommands), or print an "unknown command" message if $cmd doesn't match any registered interactive command.
Configure($config)aModuleMerge $config into this module's configuration in the shared Configuration.
critical($message, $context)aModuleCritical conditions. No-op if CRITICAL is currently filtered out by the verbosity mask.
debug($message, $context)aModuleDetailed debug information.
debugName()aModuleHuman-readable identifier used as the default {origin} in this instance's log messages.
DefaultConfig()aModuleThe config a module starts from before anything loaded via Configuration is merged in.
emergency($message, $context)aModuleSystem is unusable. No-op if EMERGENCY is currently filtered out by the verbosity mask.
error($message, $context)aModuleRuntime errors that do not require immediate action but should typically be logged and monitored.
ExtractRoutes($config)aControllerExtract all the APIRoute from this class, regardless of the fact they are registered in the application
getVerbosity()aModule
HasRoutes()aControllerTells if any APIRoute are registered in the application
index($route)aShellControllerThe built-in interactive REPL: shows the splash + command list, then loops reading a command name (with autocompletion, via ask) and dispatching it through callInteractive…
info($message, $context)aModuleInteresting 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.
InteractiveCommands()aShellControllerEvery #[InteractiveCommand(...)]-decorated method on this class, keyed by its command name.
IsShared()aModule
Link($method, $data)aControllerBuild a Link (URL + label/icon/description/title, taken from the route's APIRoute metadata) for a registered route.
log($level, $message, $context)aModuleLogs with an arbitrary level.
notice($message, $context)aModuleNormal 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.
onRoute($route)aShellControllerSame as aController::onRoute, plus: forces the response to shell/text output, and decides whether to fall back to the built-in interactive index command -- it stays active only if this is…
Route($method)aControllerGet a registered APIRoute WARNING: if this class was not registered in the application, it will return null.
Routes()aControllerGet a list of registered APIRoutes (from this class) in the application WARNING: if this class was not registered in the application, it will return an empty array.
route_help($route)aShellControllerPrint CLI usage for every 'SHELL'-method route on this controller: the command line to type, each argument's name/required-ness/description, and any declared usage examples.
serialize($path, $serializer)aModule\MMO\core\interfaces\iSerializable::serialize -- exports every property (via
setInteractive($interactive)aShellController
setVerbosity($verb)aModuleSet the current verbosity mask, replacing whatever it was before.
Shared()aModuleGet the shared instance, creating (and configuring) it on first call.
showInteractiveCommands()aShellControllerPrint the list of available interactive commands, plus the [ENTER]/[ESC]/q hints.
showSplash()aShellControllerPrint the application's icon/version/title/description banner.
testVerbosity($level)aModuleTest whether a given level (or set of levels) is currently enabled by this instance's verbosity mask.
traitUnshare($serialize)aModuleRemove the shared instance, so the next Shared() call creates a fresh one.
unserialize($data, $path, $instances)aModule\MMO\core\interfaces\iSerializable::unserialize -- merges $data onto DefaultConfig, runs it through the (possibly overridden) constructor, then applies each resulting value to its property (via
Unshare($serialize)aModuleLike tSingleton::Unshare, but also disconnects this module's instance from every event it was listening to (via Event::DisconnectListeners) before dropping it.
Url($method, $data)aControllerBuild the URL for a registered route, filling in any {placeholder} from $data.
warning($message, $context)aModuleExceptional occurrences that are not errors.
__construct($config)aModuleprotected constructor, so it is not possible to do new Module(...) called by the serialization process just before being injected with data.
__wakeup()aControllerCalled automatically right after the controller's shared instance is built (aModule::unserialize): registers onRoute as a Route listener with a low priority (-10), so it…