Download the PHP package tobento/service-booting without Composer
On this page you can find all versions of the php package tobento/service-booting. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package service-booting
Booting Service
Booting for any PHP applications.
Table of Contents
- Getting started
- Requirements
- Highlights
- Documentation
- Booter
- Create Booter
- Register Boots
- Booting
- Misc
- Boots
- Create Boot
- Dependent Boot
- Boot Priority
- Rebooting
- Boot Info
- Booter
- Credits
Getting started
Add the latest version of the booting service project running this command.
Requirements
- PHP 8.0 or greater
Highlights
- Framework-agnostic, will work with any project
- Decoupled design
Documentation
Booter
Create Booter
Parameters explanation
Parameter | Description |
---|---|
bootFactory | The boot factory. |
name | The name of the booter. |
bootMethods | The boot methods the booter calls if exists, in the order defined. |
terminateMethods | The terminate methods the booter calls if exists, in the order defined. |
Register Boots
Each boot class is registered once. If you register the same class again it will just overwrite it.
Booting
You may call the booting methods as many times as you want. By default the boot methods gets called once, except declared otherwise with the constant REBOOTABLE in the boot classes. See Rebooting.
Example
Misc
get
Returns the specified boot registry if exist, otherwise NULL.
getBoot
Returns the specified boot if exist, otherwise NULL.
getBoots
Returns the registered boots.
getBooted
For debugging purposes, you might want to get boots booted.
Boots
Create Boot
You can create a Boot by simply exenting Tobento\Service\Booting\Boot:
Currently, your Boot doesn't do anything. Depending on the booter boot and terminate methods defined, you can now define these methods in your Boot class which support method injection (autowiring).
Dependent Boot
If your Boot depends on another Boot you may ensure that the Boot has always been initiated before by using the constant BOOT.
Boot Priority
You may declare a boot priority by using the constant PRIORITY. The default priority is 1000.
Rebooting
By default, when the booter calls the Booting methods muliple times, the boot method gets call once only. You may define methods as rebootable by using the constant REBOOTABLE.
Boot Info
You may add some info for your boot methods by using the constant INFO.
Credits
- Tobias Strub
- All Contributors