<?php

use Webuccino\Install\Core\App;
use Webuccino\Install\Core\Container;
use Webuccino\Install\Core\Database;

if (config_native('srm_db_config')) {


    $container = new Container();

    $container->bind('Webuccino\Install\Core\Database', function () {

        $config_db = config_native('srm_db_config');
        return new Database(
            $config_db["driver"],
            $config_db["host"],
            $config_db["database"],
            $config_db["username"],
            $config_db["password"],
            $config_db["port"]
        );
    });

    App::setContainer($container);
}
