mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-10-04 04:02:30 +02:00
Structure:
- Split development/ (20 files) into development/ (framework reference) and guides/ (how-to)
- Moved 13 how-to files into new guides/ category (auth, cli, error-handling, etc.)
- Moved navbar-rendering.md from system/ into development/
- Deleted empty system/README.md files
- Deleted documentation_gaps.md (all gaps resolved) and redundant info/update.md
Sidebar / navbar:
- Removed all emojis from _sidebar.md (EN + RU) — fixes tree hierarchy rendering
- Removed flag emojis from _navbar.md language switcher
- Removed duplicate entries from the old "System Documentation" section
- Renamed section headers: "Development" -> "Framework Reference" + "Developer Guides"
Content fixes (modules.md EN + RU):
- Updated "Class naming" section: now documents XcVm\Module\{Pascal} namespaces
(was "global PHP namespace — Until PHP namespaces are introduced")
- Updated main module class example to use namespace declaration + use statements
- Updated class naming in ModuleLoader description to FQN
- Replaced installCrontab() manual crontab instruction with getCronEntries() API
- Updated enable/disable section: added ModuleState enum table, updated config examples
- Fixed FAQ answer for disabling a module
Content fixes (bootstrap-contexts.md EN + RU):
- Replaced CONTEXT_* string constants with BootContext enum cases throughout
- Updated boot() signature: string $context -> BootContext $context
- Updated getContext() return type: ?string -> ?BootContext
New framework reference docs (EN + RU):
- docs/{en,ru}/development/event-system.md: EventDispatcher singleton bridge,
#[ListensTo] attribute, getEventSubscribers() array API, stoppable events,
built-in event catalog, custom event authoring, ListensTo attribute reference
- docs/{en,ru}/development/exception-hierarchy.md: full XcVmException tree,
container vs module subtrees, PSR-11 compliance notes, catch-by-subsystem examples
2.7 KiB
2.7 KiB
Exception Hierarchy
All XC_VM exceptions extend XcVmException so callers can catch the entire tree with
one catch block or target a specific subsystem.
Tree
\Exception
└── XcVmException
├── Container
│ └── ContainerException (PSR-11 ContainerExceptionInterface)
│ ├── CircularDependencyException
│ ├── ServiceCreationException
│ └── NotFoundException (PSR-11 NotFoundExceptionInterface)
└── Module
└── ModuleException
├── ModuleNotFoundException
├── ModuleLoadException
├── ModuleManifestException
└── ModuleCycleException
Container exceptions
| Class | When thrown |
|---|---|
ContainerException |
Base for all container failures |
CircularDependencyException |
A service's factory graph contains a cycle |
ServiceCreationException |
Factory callable threw while creating a service |
NotFoundException |
get($id) called for an unregistered service |
NotFoundException implements both PSR-11 interfaces so the container is compliant:
try {
$service = $container->get('unknown');
} catch (NotFoundException $e) {
// PSR-11 NotFoundExceptionInterface
}
Module exceptions
| Class | When thrown |
|---|---|
ModuleException |
Base for all module failures |
ModuleNotFoundException |
Required dependency module is missing |
ModuleLoadException |
Module file cannot be loaded or class not found |
ModuleManifestException |
module.json is missing, malformed, or fails validation |
ModuleCycleException |
Dependency graph has a cycle |
Catching by subsystem
// Catch any XC_VM exception
try {
$loader->loadAll();
} catch (XcVmException $e) {
logger()->error($e->getMessage());
}
// Catch only module-related failures
try {
$loader->loadAll();
} catch (ModuleException $e) {
// ModuleNotFoundException | ModuleLoadException | ...
}
// Catch container-specific failures
try {
$container->get('missing');
} catch (ContainerException $e) {
// CircularDependencyException | NotFoundException | ...
}
Location
src/core/Exception/
├── XcVmException.php
├── Container/
│ ├── ContainerException.php
│ ├── CircularDependencyException.php
│ ├── ServiceCreationException.php
│ └── NotFoundException.php
└── Module/
├── ModuleException.php
├── ModuleNotFoundException.php
├── ModuleLoadException.php
├── ModuleManifestException.php
└── ModuleCycleException.php