protected function registerConfigs(Application $app)
    {
        $base = $app['path.base'];

        if (file_exists("$base/.env")) {
            $dotenv = \Dotenv::load($base);
        }

        $preloadedVars = [
            'env.DEBUG'              => $app['debug'],
            'env.AUTO_REBUILD'       => $app['auto_rebuild'],
            'env.DOMAIN'             => isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'skimpy.dev',
            'path.base'              => $base,
        ];

        $envVars = $_ENV;
        foreach ($envVars as $k => $v) {
            $preloadedVars["env.$k"] = $v;
        }

        $app->register(new \Igorw\Silex\ConfigServiceProvider("$base/config/site.php"));
    }