Application Lifecycle
The lifecycle of the UserFrosting application extends the standard lifecycle of a Slim application. Here is the breakdown:
- PHP
session_start
is called (config-userfrosting.php
)
- The Slim application is instantiated (
config-userfrosting.php
)
- Set database, path, and URL config information (
config-userfrosting.php
)
- Set database table aliases (
initialize.php
)
- Initialize database table columns and names (
initialize.php
)
- Load site settings, either default or from the database (
initialize.php
)
- Create page schema (
initialize.php
)
- Setup a guest user and environment, including translator, message stream, and error handling (
setupGuestEnvironment
in UserFrosting.php
)
- Setup Twig custom functions and site setting variable (
setupTwig
in UserFrosting.php
)
- Initialize plugins (
initialize.php
)
slim.before
hook is called
- Set current user to logged in user, if one is available (
middleware/usersession/UserSession.php
)
- Setup logged-in user environment, including translator, message stream, error handling, and Twig user variables (setupAuthenticatedEnvironment in
UserFrosting.php
)
- Slim routes the request