Browse Source

Formatting

pull/26/head
Starbeamrainbowlabs 4 years ago
parent
commit
ca955f3c89
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
  1. 10
      api.php

10
api.php

@ -3,8 +3,8 @@ $start_time = microtime(true); @@ -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"); @@ -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( @@ -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") { @@ -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…
Cancel
Save