Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 1.97 KB

http-workflow.md

File metadata and controls

34 lines (29 loc) · 1.97 KB

HTTP Application Workflow

Table of Contents

  1. Introduction
  2. Workflow

Introduction

Opulence uses a single point of entry for all pages. In other words, all HTTP requests get redirected through index.php, which instantiates the application and handles the request. Here's a breakdown of the workflow of a typical Opulence HTTP application:

Workflow

  1. User requests http://www.example.com/users/23/profile
  2. Your virtual host redirects the request through http://www.example.com/index.php
  3. bootstrap/http/start.php is loaded, which instantiates an Application object
  4. Various configs are read, and bootstrappers are registered
  5. Pre-start tasks are run
  6. Bootstrappers' bindings are registered by the bootstrapper Dispatcher
  7. Bootstrappers are run by the bootstrapper Dispatcher
  8. The application is started
  9. An HTTP Kernel is instantiated, which converts the HTTP request into a response
  • The path "/users/23/profile" is detected by the request
  1. All global middleware are run
  2. The Router finds a route that matches the request
  • The user Id 23 is extracted from the URL here
  1. The Dispatcher runs any middleware registered specifically to this route
  2. The Dispatcher dispatches the request to the Controller
  • The user Id is injected into the controller method
  1. The Controller processes data from the request, updates/retrieves any appropriate models, and creates a Response
  2. The Response is sent back to the user
  3. Post-start tasks are run
  4. Pre-shutdown tasks are run
  5. The application is shut down
  6. Post-shutdown tasks are run