Laminas Overview
Sirius uses the Laminas Framework (formerly Zend) for the core of building its various PHP components. You can find out more at the Laminas documentation
It’s useful to know where to look for key elements and how they relate to the whole. All requests broadly follow the same path shown in:
Nginx (our web server) hands off any non-filesystem web requests to the php runtime running in php-fpm.
These are all handled by index.php, which loads the PHP autoloader and then initialises the Laminas application with the global application configuration file and configuration for all the modules that make up the app.
Modules are used to partition up similar pieces of application logic. Most of the work in Sirius goes on in the Application module, but some areas such as DDC (Document capture handling) and Finance are given their own areas. Modules register themselves with the EventManager to handle application events.
Typically the MVC event lifecycle follows the pattern:
- Bootstrap - set up initial configuration and servcies
- Route - Identify the correct namespace and appropriate controller
- Dispatch - Send the request to the appropriate controller
- Render - render any viewx with their data
- Finish - Trigger sending the final http response back
There are also Dispatch Error and Render Error events that are fired if either Dispatch or Render fail.
The MVCEvent object is passed around through the lifecycle and contains information on routing, request and repsonse.