Download the PHP package tobento/app without Composer
On this page you can find all versions of the php package tobento/app. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package app
Short Description Base application for creating any PHP project.
License MIT
Homepage https://www.tobento.ch
Informations about the package app
App
Base application for creating any PHP project.\ You might get started with the App Skeleton where you will find a list of available app bundles.
Table of Contents
- Getting Started
- Requirements
- Documentation
- App Lifecycle
- App Factory
- App Resolving
- PSR-11
- Autowiring
- Definitions
- Make
- Call
- On
- App Booting
- App Directories
- App Clock
- App Macros
- Available Boots
- App Boot
- Config Boot
- Functions Boot
- Error Handling Boot
- Dater Boot
- Handle Boot Errors
- Customization
- Credits
Getting Started
Add the latest version of the app project running this command.
Requirements
- PHP 8.0 or greater
Documentation
App Lifecycle
First, create the app from the provided app factory.\ Next, register any boot you want within your app.\ Finally, run your app.
App Factory
Parameters explanation
Parameter | Description |
---|---|
resolverFactory | If no resolver factory is set, it uses the Resolver Container. |
booter | If no booter is set, it uses the Default Booter. |
dirs | If no dirs is set, it uses the Default Dirs. |
App Resolving
PSR-11
Autowiring
The app resolves any dependencies by autowiring, except build-in parameters needs a definition to be resolved.
On union types parameter, the first resolvable parameter gets used if not set by definiton.
Definitions
Check out the Resolver Definitions to learn more about definitions in general.
Make
Check out Resolver Make to learn more about it.
Call
Check out Resolver Call to learn more about it.
On
Check out Resolver On to learn more about it.
App Booting
You may call the booting method to boot the registered boots so as having access to its functionality, otherwise it gets called on the run method.
App Directories
You may add directories for its later usage.
Check out the Dir Service to learn more about dirs in general.
App Clock
App Macros
Check out the Macro Service to learn more about macros in general.
Available Boots
App Boot
The app boot does the following:
- boots Functions Boot
- loads app config file if exist
- sets app environment based on app config
- adds specific config directory for environment
- sets timezone based on app config
- boots the specified boots from app config
Config Boot
The config boot does the following:
- implements the config interface
- adds config macro
Check out the Config Service to learn more about it in general.
Functions Boot
The functions boot does the following:
- registers app functions
- provides register method
- adds app functions macro
Check out the Helper Function Service to learn more about it in general.
Error Handling Boot
The error handling boot does the following:
- implements the error handling
Dater Boot
The dater boot does the following:
- configures DateFormatter with the app.timezone and app.locale config
Check out the Dater Service to learn more about in general.
Handle Boot Errors
You might want to handle errors caused by boots in order to continue running the app:
Check out the Throwable Handlers to learn more about handlers in general.
Customization
Some boots might implement interfaces on their boot method such as the app http boot. There are several ways to change its implementations. But we need to keep in mind that other boots might have dependent boots defined.
Using the app on method
Boot extending
Boot implementation overwriting
Credits
- Tobias Strub
- All Contributors
All versions of app with dependencies
psr/container Version ^2.0
psr/clock Version ^1.0
tobento/service-macro Version ^1.0
tobento/service-helper-function Version ^1.0
tobento/service-error-handler Version ^1.0
tobento/service-resolver Version ^1.0
tobento/service-resolver-container Version ^1.0
tobento/service-dir Version ^1.0
tobento/service-booting Version ^1.0
tobento/service-clock Version ^1.0
tobento/service-collection Version ^1.0
tobento/service-config Version ^1.0
tobento/service-dater Version ^1.0