File src/class/App.php

class Lia\App

Liaison App

Constants

Properties

  • protected string $namespace; Namespace
  • public string $dir; Root dir of the app
  • public \Lia $lia; Liaison instance this app is in
  • public array $addons = []; Addons in this app
  • public array $config = []; The app's configs, usually in a config.json file in the app's root dir, unless overridden.

Methods

  • public function __construct(\Lia $lia, string $dir)

  • public function getLia(): \Lia

  • public function getNamespace(): string

  • public function getPath(string $relative_path = ""): string Get the absolute path to a directory or file within the app

  • public function getConfig(string $config_name): mixed

  • public function hasConfig(string $config_name): bool Check if the named config is set for your app

  • protected function load_addons($sub_dir = 'addon') Load THIS app's addons from the addon dir.

  • public function addAddon(\Lia\AddonInterface $addon)

  • public function getAddon(string $addon_name): \Lia\AddonInterface Get an addon by its name

  • public function dir(string $sub_dir): string Get the sub-directory.

  • public function onLiaisonReady(\Lia $lia) called before an HTTP request or CLI input is processed

  • public function onFinish(\Lia $lia) called after input is processed

  • public function onTerminate(\Lia $lia) Called when $lia->terminate() is called, which will exit after the onTerminate() event.

  • public function onStartRequest(\Lia\Http\Request $request, \Lia\Http\Response $response) called by $lia->deliver() after onReady() event

  • public function onCliReady(\Lia\CliExecution $cli) called by $lia->execute() after onReady() event