Register Entry Point
@param \Silex\Application $app
343309
protected function registerEntryPoint(\Silex\Application $app)
    {
        $entry_point       = 'security.entry_point.'.$this->name.
            (empty($this->loginPath) ? '.http' : '.form');
        $app[$entry_point] = $app->share(function () use ($app) {
            return $this->loginPath ?
                new FormAuthenticationEntryPoint($app, $app['security.http_utils'], $this->loginPath, true)
                    :
                new BasicAuthenticationEntryPoint('Secured');
        });
        return $entry_point;
    }
856744
public function register(App $app)
    {
        $app["config.service"] = function (App $app) {
            return new \SlaxWeb\Config\Container(
                $app["configHandler.service"]
            );
        };

        $app["configHandler.service"] = function (App $app) {
            switch ($app["configHandler"]) {
                case \SlaxWeb\Config\Container::PHP_CONFIG_HANDLER:
                    return new \SlaxWeb\Config\PhpHandler(
                        [$app["configResourceLocation"]]
                    );
                case \SlaxWeb\Config\Container::XML_CONFIG_HANDLER:
                    return new \SlaxWeb\Config\XmlHandler(
                        [$app["configResourceLocation"]],
                        new \Desperado\XmlBundle\Model\XmlReader
                    );
                case \SlaxWeb\Config\Container::YAML_CONFIG_HANDLER:
                    return new \SlaxWeb\Config\YamlHandler(
                        [$app["configResourceLocation"]]
                    );
                default:
                    $availOpts = [
                        \SlaxWeb\Config\Container::PHP_CONFIG_HANDLER,
                        \SlaxWeb\Config\Container::XML_CONFIG_HANDLER,
                        \SlaxWeb\Config\Container::YAML_CONFIG_HANDLER
                    ];
                    throw new \SlaxWeb\Bootstrap\Exception\InvalidConfigHandlerException(
                        "Handler type property 'configHandler' must be one of "
                        . json_encode($availOpts)
                    );
            }
        };
    }
312065
public function register(Container $app)
    {
        $routerContainer = new RouterContainer();
        $app[Map::class] = $routerContainer->getMap();
        $app[RuleIterator::class] = $routerContainer->getRuleIterator();
    }
635673
public function register(Application $app)
    {
        $this->app = $app;

        $app['negotiator'] = $app->share(function ($app) {
            return new \Negotiation\Negotiator();
        });

        $app['language.negotiator'] = $app->share(function ($app) {
            return new \Negotiation\LanguageNegotiator();
        });

        $customFormats = $this->customFormats;

        $app['format.negotiator'] = $app->share(function ($app) use($customFormats) {
            $negotiator = new \Negotiation\FormatNegotiator();

            // add new formats
            foreach ($customFormats as $name => $mimeTypes) {
                $negotiator->registerFormat($name, $mimeTypes, true);
            }

            return $negotiator;
        });
    }
280686
public function register(App $app)
    {
        // new Route class instance
        $app["router.newRoute"] = $app->factory(function () {
            return new Route;
        });

        /*
         * Routes Container
         *
         * Requires the Logger Service Provider to be registered prior to its
         * own instantiation.
         */
        $app["routesContainer.service"] = function (App $app) {
            return new RoutesContainer($app["logger.service"]("System"));
        };

        /*
         * Route Dispatcher
         *
         * Requires the Routes Container, the Hooks Container, and the Logger.
         * This Service gathers all required services, and instantiates the
         * Dispatcher. Just make sure all required service providers are
         * registered prior to instantiating the Dispatcher
         */
        $app["routeDispatcher.service"] = function (App $app) {
            $dispatcher = new RouteDispatcher(
                $app["routesContainer.service"],
                $app["hooks.service"],
                $app["logger.service"]("System")
            );

            $config = $app["config.service"];
            if ($config["app.segmentBasedMatch"] === true) {
                $dispatcher->enableSegMatch(
                    $config["app.controllerNamespace"],
                    [$app],
                    $config["app.segmentBasedUriPrepend"],
                    $config["app.segmentBasedDefaultMethod"]
                );
            }
            return $dispatcher;
        };

        // new Request object from superglobals or pre set base url
        $app["request.service"] = function (App $app) {
            if (isset($app["requestParams"])) {
                $method = $app["requestParams"]["method"] ?? $_SERVER["REQUEST_METHOD"];
                $request = Request::create(
                    $app["requestParams"]["uri"],
                    $method,
                    array_merge($_GET, $_POST),
                    $_COOKIE,
                    $_FILES,
                    $_SERVER
                );

                /*
                 * prepare request parameters from request content, copy from
                 * Symfony Http Foundation Request method "createFromGlobals"
                 */
                if (strpos($request->headers->get("CONTENT_TYPE"), "application/x-www-form-urlencoded") === 0
                    && in_array(strtoupper($request->server->get("REQUEST_METHOD", "GET")),
                        ["PUT", "DELETE", "PATCH"])) {
                    parse_str($request->getContent(), $data);
                    $request->request = new ParameterBag($data ?? []);
                }
            } else {
                $request = Request::createFromGlobals();
            }

            return $request;
        };

        // new empty Response object
        $app["response.service"] = function () {
            return new Response;
        };
    }
1357493
public function register(Application $app)
    {
        $app['migrations.create-proxy'] = $app->share(function ($app) {
            $command = new CreateMigrationCommandProxy('migrations:create');
            $command->setFactory($app->raw('migrations.create'))
                ->setApp($app);
            return $command;
        });

        $app['migrations.create'] = $app->share(function ($app) {
            $view = new CreateMigrationView($app['mustache']);

            $command = new CreateMigrationCommand($view);

            $config = $app['config']->load('init');

            if (isset($config['migrations_namespace'])) {
                $command->setMigrationNamespace($config['migrations_namespace']);
            }

            return $command;
        });

        $app['migrations.run-proxy'] = $app->share(function ($app) {
            $command = new RunMigrationsCommandProxy('migrations:run');
            $command->setFactory($app->raw('migrations.run'))
                ->setApp($app);
            return $command;
        });

        $app['migrations.run'] = $app->share(function ($app) {
            $command = new RunMigrationsCommand();

            $command->setDatabaseAdapter($app['db']);

            $config = $app['config']->load('init');

            if (isset($config['migrations_namespace'])) {
                $command->setMigrationNamespace($config['migrations_namespace']);
            }

            return $command;
        });
    }
1079499
public function register(Application $app)
    {
        Assertion::isInstanceOf($app, \Alchemy\Phrasea\Application::class);

        $app['setup.validate-config'] = $app->protect(function (Request $request) use ($app) {
            if (0 === strpos($request->getPathInfo(), '/setup')) {
                if (!$app['phraseanet.configuration-tester']->isInstalled()) {
                    if (!$app['phraseanet.configuration-tester']->isBlank()) {
                        if ('setup_upgrade_instructions' !== $app['request']->attributes->get('_route')) {
                            return $app->redirectPath('setup_upgrade_instructions');
                        }
                    }
                } elseif (!$app['phraseanet.configuration-tester']->isBlank()) {
                    return $app->redirectPath('homepage');
                }
            } else {
                if (false === strpos($request->getPathInfo(), '/include/minify')) {
                    $app['firewall']->requireSetup();
                }
            }
        });
    }
1322714
public function register(Application $app)
    {
        $app['validator'] = $app->share(function ($app) {
            if (isset($app['translator'])) {
                $r = new \ReflectionClass('Symfony\Component\Validator\Validator');
                $file = dirname($r->getFilename()).'/Resources/translations/validators.'.$app['locale'].'.xlf';
                if (file_exists($file)) {
                    $app['translator']->addResource('xliff', $file, $app['locale'], 'validators');
                }
            }
            $translator = isset($app['translator']) ? $app['translator'] : new IdentityTranslator();

            $executionContext = new ExecutionContextFactory($translator);
            $metaDataFactory = new LazyLoadingMetadataFactory();
            $constrainValidator = new ConstraintValidatorFactory();
            return new RecursiveValidator($executionContext,$metaDataFactory,$constrainValidator);


        });
    }
802221
public function register(Application $app)
    {
        /** @var Translator $translator  */
        $translator = $app['translator'];
        $translator->addTranslationFolder(__DIR__ . DIRECTORY_SEPARATOR . 'Messages');

        /** @var ApplicationConfiguration $config */
        $config = $app['config'];

        $partialsCollection = new PartialsCollection($app['markdown']);
        $app['partials'] = $partialsCollection;

        /** @var Partial[] $partials */
        $partials = $config->getPartials();
        if ($partials) {
            foreach ($partials as $partial) {
                if (! $partial->getName()) {
                    throw new Exception\MissingNameForPartialException('The name of the partial to load is missing');
                }

                $content = '';
                if ($partial->getContent()) {
                    $content = $partial->getContent();
                } elseif ($partial->getLink()) {
                    if (! is_readable($partial->getLink())) {
                        $app['monolog']->error(
                            sprintf($translator->translate('PPCPP:EXC-NOPARTIAL'), $partial->getLink())
                        );
                        continue;
                    }

                    $content = file_get_contents($partial->getLink());
                }
                $partialsCollection->set($partial->getName(), $content);
            }
        }
    }
247013
public function register(Container $app): void
    {
        $this->registerWriters($app);
        $this->registerDependenciesOnXsltExtension($app);

        $app->register(new \phpDocumentor\Plugin\Graphs\ServiceProvider());
        $app->register(new \phpDocumentor\Plugin\Twig\ServiceProvider());
    }
466791
public function register(Application $app)
    {
        $prefix = $this->prefix;

        foreach(array('.server', '.options', '.attributes') as $key) {
            if (!(isset($app[$prefix . $key]))) {
                $app[$prefix. $key] = array();
            }
        }

        $app[$prefix] = $this->getPdo($app, $prefix);
    }
1212872
private function registerComponents($app)
    {
        foreach ($this->getModules() as $id => $module) {
            // set an alias for all user modules
            Yii::setAlias('@'.$id, $module->getBasePath());
            // see if the module has a registerComponents method
            foreach ($module->registerComponents() as $componentId => $definition) {
                if (!$app->has($componentId)) {
                    Yii::trace('Register component ' . $componentId, __METHOD__);
                    $app->set($componentId, $definition);
                }
            }
        }
    }
787212
public function register(Application $app)
	{
		$assets = $this;
		$app['assets'] = $app->share(function() use($app, $assets){
			
			return $assets;
		});
	}
1264297
public function register(Application $app)
    {
        $app[Controller::INDEX] = $app->share(function () use ($app) {
            return new Controller\IndexController($app[UseCase::LOGIN]);
        });
        $app[Controller::ACCOUNT] = $app->share(function () use ($app) {
            return new Controller\AccountController($app[UseCase::REGISTRATION], $app[Repository::USER]);
        });
        $app[Controller::CITY] = $app->share(function () use ($app) {
            return new Controller\CityController(
                $app[UseCase::LIST_DIRECTIONS],
                $app[Repository::USER],
                $app[Repository::CITY]);
        });
    }
232722
public function registerCommands(Application $application)
    {
        foreach ($this->getCommands() as $command) {
            $application->add($command);
        }
    }
745453
public function register(Application $app)
    {
        $this->registerTranslationMessages($app);
        $this->registerWriters($app);
        $this->registerDependenciesOnXsltExtension($app);

        $app->register(new \phpDocumentor\Plugin\Graphs\ServiceProvider());
        $app->register(new \phpDocumentor\Plugin\Twig\ServiceProvider());
    }
1178479
public function bootstrap(Application $app)
	{
		Facade::clearResolvedInstances();

		Facade::setFacadeApplication($app);

		AliasLoader::getInstance($app['config']['app.aliases'])->register();
	}