History

A file for storing old documentation and notes. Partially because I might use them. Partially for historical purposes. Partially because I'm just not ready to let go.

The History folder contains additional files to preserve


v0.3 notes README stuff (prior to December 2021)

Request lifecycle

  1. .htaccess routes to deliver.php or wherever you like
  2. Server setup: Database configuration, other non-liaison things
  3. $lia = new Liaison() <- Liaison adds its built-in package (or pass ['bare'=>true])
  4. new \Lia\Package($lia, $dir, $configs) for each package to add
    1. new $Component() for each component in the package
    2. $Component->onCreate() <- Called from \Lia\Compo
    3. $Component->onReady() <- Called from \Lia\Compo
    4. $Component->onComponentsLoaded() <- After all components in THIS package have called onCreate & onReady. Called by \Lia\Package
    5. $Component->onPackageReady() <- After routes, views, & configs have been loaded for this package
      • $Component->onPrePackageReady() is called first, but is not recommended. If used, you must call parent::onPrePackageReady() to keep prefix scanning enabled
  5. $lia->deliver() calls $lia->getResponse() (the following is all called from \Lia\Compo\Server)
    1. $lia->emit('PreAllPackagesReady')
    2. emit AllPackagesReady <- Handle in components by declaring onEmitAllPackagesReady()
    3. emit RequestStarted($request, $response)
    4. emit RoutesFound($routeList)
    5. emit RoutesFiltered($finalRoute)
    6. resolve route
    7. emit RouteResolved($route, $response)
    8. if ($response->useTheme), load theme, emit ThemeLoaded($themeView), then set $response->content to (string)$themeView
    9. emit ResponseReady($response)
  6. $lia->deliver() has a response
    1. $response->sendHeaders()
    2. if ($response->sendContent) echo $response->content
    3. emit ResponseSent($response)
    4. close connection (May not work in all web hosts / apache setups)
    5. emit RequestFinished($response)