mirror of
https://github.com/ConnectedHumber/Air-Quality-Web
synced 2024-11-24 06:43:01 +00:00
Formatting
This commit is contained in:
parent
dc4d821f27
commit
ca955f3c89
1 changed files with 4 additions and 6 deletions
10
api.php
10
api.php
|
@ -3,8 +3,8 @@ $start_time = microtime(true);
|
|||
|
||||
define("ROOT_DIR", dirname(__FILE__) . "/");
|
||||
|
||||
// 1: Autoloaders
|
||||
|
||||
// 1: Autoloaders
|
||||
require("vendor/autoload.php");
|
||||
|
||||
$autoloader = new \Aura\Autoload\Loader();
|
||||
|
@ -12,6 +12,7 @@ $autoloader->addPrefix("AirQuality", "logic");
|
|||
$autoloader->addPrefix("SBRL", "lib/SBRL");
|
||||
$autoloader->register();
|
||||
|
||||
|
||||
// 2: Settings
|
||||
$settings = new \SBRL\TomlConfig(
|
||||
"data/settings.toml",
|
||||
|
@ -19,7 +20,7 @@ $settings = new \SBRL\TomlConfig(
|
|||
);
|
||||
|
||||
|
||||
// 2: Dependency injection
|
||||
// 3: Dependency injection
|
||||
|
||||
$di_builder = new DI\ContainerBuilder();
|
||||
$di_builder->addDefinitions("di_config.php");
|
||||
|
@ -37,15 +38,12 @@ if($settings->get("env.mode") == "production") {
|
|||
$di_container = $di_builder->build();
|
||||
|
||||
|
||||
// 3: Settings
|
||||
|
||||
$settings = $di_container->get(\SBRL\TomlConfig::class);
|
||||
|
||||
// 4: Database
|
||||
|
||||
// Done automagically by PHP-DI.
|
||||
// PHP-DI autowires it, and doesn't create more than 1 instance of it either
|
||||
|
||||
|
||||
// 5: Action
|
||||
|
||||
// Figure out the action name
|
||||
|
|
Loading…
Reference in a new issue