spiral/boot
Spiral Boot Core provides the kernel bootstrapping foundation for the Spiral Framework. It includes bootloaders, application lifecycle management, and configuration wiring used by Spiral apps and bundles, with strong type-safety and CI-tested quality.
The spiral/boot package provides foundational infrastructure for bootstrapping Spiral-based applications—primarily as part of the Spiral Framework kernel. It’s not typically used in isolation. To get started:
spiral/framework pulls it in as a dependency).spiral/framework’s kernel configuration and bootloader chain (config/boot.php, src/Application/Kernel.php).Spiral\Boot\Bootloader\Bootloader to build your own custom bootloaders.Spiral\Boot\BootloaderManager or use the framework’s Kernel to manage bootloader lifecycle and dependency resolution.Spiral\Boot\Bootloader\Bootloader. Use boot() method for initialization logic, init() for one-time setup, and depended() for service dependencies (implement DependedInterface).public const DEPENDENCIES = [...]. The BootloaderManager resolves and executes them in topologically correct order.Spiral\Boot\EnvironmentInterface (and its implementations) to safely read and mutate environment state during bootstrap (note: immutable by design to prevent race conditions).Spiral\Boot\DispatcherInterface (e.g., CommandDispatcher) to dispatch CLI or background tasks during boot (e.g., seeding, migration check).Spiral\Boot\LoggerInterface (deprecated) and ListenerRegistryInterface; prefer PSR-3 logger injection for production.composer.json). Older versions (v1.0–v1.1.x) supported PHP 7.2, but current usage demands 8.1+.safeSet() or set values before kernel boots (e.g., .env or CLI args).Bootloader, EnvironmentInterface, and BootloaderManager.try/catch in boot() if recovery is needed.ConfigInterface and related config helpers—prefer Spiral\Core\ConfigInterface (in spiral/core) for config access during boot.Spiral\Boot\ListenerRegistryInterface to register cleanup/termination callbacks (e.g., closing DB connections) via addListener(). The terminate() flag in finalizers controls shutdown behavior.Spiral\Boot\*. Ensure imports aren’t outdated (e.g., old Spiral\Core\Bootloader → now Spiral\Boot\Bootloader).How can I help you explore Laravel packages today?