src/Provider/Silex/VarsServiceProvider.php
public function register(Application $app)
    {
        $app['vars'] = function ($app) {
            return new Vars($this->entity, $this->createOptions($app));
        };

        $app['vars.merge'] = $app->protect(function () use ($app) {
            static $initialized = false;
            if ($initialized) {
                return;
            }
            $initialized = true;

            foreach ($app['vars']->getGlobals() as $key => $value) {
                $app[$key] = $value;
            }

            foreach ($app['vars']->toDots(false) as $key => $value) {
                $app['vars.'.$key] = $value;
            }
        });
    }
public function register(Application $app)
    {
        $app['vars'] = function ($app) {
            return new Vars($this->entity, $this->createOptions($app));
        };

        $app['vars.merge'] = $app->protect(function () use ($app) {
            static $initialized = false;
            if ($initialized) {
                return;
            }
            $initialized = true;

            foreach ($app['vars']->getGlobals() as $key => $value) {
                $app[$key] = $value;
            }

            foreach ($app['vars']->toDots(false) as $key => $value) {
                $app['vars.'.$key] = $value;
            }
        });
    }
Registers the service provider, sets the user defined options and returns the vars instance

@param \Silex\Application $app The silex app