PackageManifest
MMO\core\helpers · 1 symbol · generated 30 Sep 2026
PackageManifest
PackageManifest.php:25Store mmoframework package informations
- Namespace
MMO\core\helpers- Implements
- JsonSerializable
Index
| bootstrap | ||
| build | ||
| demo | ||
| dependencies | ||
| description | ||
| documentations | ||
| filename | ||
| hooks | ||
| i18n | ||
| icon | ||
| included | ||
| keywords | ||
| languages | ||
| links | ||
| name | ||
| namespace | ||
| readme | ||
| sources | ||
| status | ||
| tests | ||
| title | ||
| urls | ||
| version | ||
| addHook($hook, $callback) | Register a callback for $hook (see this class's own docblock for the list of hooks and when each fires). | |
| build($filename, $compression, $options) | Build package | |
| debugName() | ||
| executeHook($name, $args) | Execute a hook in the manifest | |
| FromJsonFile($filename) static | ||
| getAllDependencies() | ||
| getBuildFilename() | Get the package absolute filename | |
| getBuildFolder() | ||
| getDemoFolder() | ||
| getDocumentationFolders() | Get a list of existing documentations folders | |
| getIconFilename() | ||
| getReadmeFilename() | ||
| getReleaseNotes() | Get a list of releases notes filename | |
| getShowcasePath($path) | Resolve one of the showcase paths ($icon, $readme, $demo) against the manifest's folder. | |
| getSkillFolders() | The agent skills this package holds: every real folder of its .claude/skills/, which | |
| getTestsFilename() | ||
| getTitle() | ||
| incVersion($where, $inc) | Bump $version in place. | |
| isPackageUpToDate() | ||
| isPhar() | ||
| isValid() | Tells if manifest is valid | |
| jsonSerialize() | ||
| load($data) | Load data into the manifest | |
| loadJsonFile($filename) | Load (load) this manifest's data from a JSON file, also recording $filename itself ($filename). | |
| loadLanguage($language) | Load and register (with the shared I18n instance) this package's translations for $language, from | |
| loopSources($resolve) | ||
| reload() | Re-read this manifest's own $filename from disk, discarding any in-memory changes. | |
| removeHook($hook, $callback) | ||
| save($filename) | Write this manifest back out as JSON. | |
| toArray() | Get the manifest's data | |
| __construct($data) |
Properties23
bootstrap
- Type
- string
build
- Type
- string
demo
- Type
- string
dependencies
- Type
- array
description
- Type
- string
documentations
- Type
- array
filename
- Type
- string
hooks
- Type
- array
i18n
- Type
- string
icon
- Type
- string
included
- Type
- bool
keywords
- Type
- array
languages
links
- Type
- array
name
- Type
- string
namespace
- Type
- string
readme
- Type
- string
sources
- Type
- array
status
- Type
- string
tests
- Type
- string
title
- Type
- string
urls
- Type
- array
version
- Type
- string
Methods31
addHook($hook, $callback)
PackageManifest.php:238Register a callback for $hook (see this class's own docblock for the list of hooks and when each fires).
| $hook | string | |
| $callback | callable | function(PackageManifest $manifest, mixed ...$args): void |
| returns | callable | $callback, for chaining (e.g. $cb = $manifest->addHook(...), to later removeHook it) |
build($filename, $compression, $options)
PackageManifest.php:333Build package
debugName()
PackageManifest.php:198| returns | string | e.g. 'my-pkg.1.0.0' NOTE: $name/$version are typed, non-nullable properties with no default, so a manifest that failed to load fully (e.g. an invalid config, see load) may not have them set yet. This is guarded with isset() because describe (used while rendering ANY exception whose $origin is this manifest, regardless of whether the message even mentions {origin}) calls debugName() unconditionally -- an unguarded access here used to turn a clear "unknown configuration" error into a confusing, unrelated "must not be accessed before initialization" one, masking the real problem. |
executeHook($name, $args)
PackageManifest.php:266Execute a hook in the manifest
FromJsonFile($filename)
staticPackageManifest.php:113getAllDependencies()
PackageManifest.php:446| returns | array | this package's full (transitive) dependency list, via PackageManager |
getBuildFilename()
PackageManifest.php:286Get the package absolute filename
| returns | string |
getBuildFolder()
PackageManifest.php:291| returns | string | the directory getBuildFilename lives in |
getDemoFolder()
PackageManifest.php:418getDocumentationFolders()
PackageManifest.php:352Get a list of existing documentations folders
| returns | array |
getIconFilename()
PackageManifest.php:408getReadmeFilename()
PackageManifest.php:413getReleaseNotes()
PackageManifest.php:432Get a list of releases notes filename
| returns | array | every file under a 'releaseNotes' subfolder of each getDocumentationFolders entry |
getShowcasePath($path)
PackageManifest.php:401Resolve one of the showcase paths ($icon, $readme, $demo) against the manifest's folder.
- See
getDocumentationFolders, which silently drops a folder that does not exist.
getSkillFolders()
PackageManifest.php:372The agent skills this package holds: every real folder of its .claude/skills/, which
- See
MCPControllerserves andbuildputs in the package under the same name.
| returns | array | string> .claude/skills/<skill> => its folder |
getTestsFilename()
PackageManifest.php:424getTitle()
PackageManifest.php:386| returns | string | this package's human readable name, its short name when none was declared. |
incVersion($where, $inc)
PackageManifest.php:172Bump $version in place.
- See
inc's own behavior)
| $where = MMO\core\versions\PATCH | int | one of \MMO\core\versions\{MAJOR,MINOR,PATCH} -- only that single component is incremented, lower-precision components are NOT reset to 0 (see |
| $inc = 1 | int | |
| returns | void |
isPackageUpToDate()
PackageManifest.php:311| returns | bool | true if the built package (getBuildFilename) exists and is newer than every source file (always true for a .phar package, which is inherently self-consistent) |
isPhar()
PackageManifest.php:177isValid()
PackageManifest.php:185Tells if manifest is valid
| returns | bool |
jsonSerialize()
PackageManifest.php:120load($data)
PackageManifest.php:208Load data into the manifest
loadJsonFile($filename)
PackageManifest.php:129Load (load) this manifest's data from a JSON file, also recording $filename itself ($filename).
loadLanguage($language)
PackageManifest.php:463Load and register (with the shared I18n instance) this package's translations for $language, from
- See
$i18n. Translation files are discovered (and cached) on first call; each is a plain PHP file returning a translation array,include_once-d so it only actually runs once even across repeated calls.
| $language | string | a language tag (e.g. 'fr-FR'), matched via I18n::findLanguage (so a broader match like 'fr' can still resolve to a more specific 'fr-FR' file, or vice versa) |
| returns | bool | true if a matching translation file was found (and loaded, or already had been) |
loopSources($resolve)
PackageManifest.php:300reload()
PackageManifest.php:141Re-read this manifest's own $filename from disk, discarding any in-memory changes.
removeHook($hook, $callback)
PackageManifest.php:249| $hook | string | |
| $callback | callable | the exact callback previously passed to addHook |
| returns | bool | true if it was found (and removed) |
save($filename)
PackageManifest.php:153Write this manifest back out as JSON.
toArray()
PackageManifest.php:221Get the manifest's data