Registers services on the given app.

This method should only be used to configure services and parameters.
It should not get services.
556307
public function register(Application $app)
    {
        $app['rest_normalizer.version'] = '0.1.0';
        $app['rest_normalizer.builder'] = $app->protect(
            function ($object = null) use ($app) {
                $version = $app['rest_normalizer.version'];
                $request = $app['request'];
                /** @var $request \Symfony\Component\HttpFoundation\Request */

                $builder = ResponseBuilder::create(
                    $version,
                    HttpMethod::valueOf($request->getMethod()),
                    $object
                );

                foreach ($request->request->all() as $key => $value) {
                    $parameter = Parameter::create($key, $value);
                    $builder->addParameter($parameter);
                }

                return $builder;
            }
        );
    }
1221413
def should_register(self, app):
        
        if self.only_if is None:
            return True
        elif callable(self.only_if):
            return self.only_if(app)
        return bool(self.only_if)
544972
public function register()
    {
        $this->app->singleton(ServiceCaller::class, function ($app) {
            return new ServiceCaller($app);
        });

        $this->app->alias(
            ServiceCaller::class,
            AbstractServiceCaller::class
        );
    }
782650
public function register()
    {
        $this->config = ConfigurationLoader::load($this->app);

        $this->registerServices();

        // If we want Laravel's Redis API to use Sentinel, we'll return an
        // instance of the RedisSentinelManager when requesting the "redis"
        // service:
        if ($this->config->shouldOverrideLaravelRedisApi) {
            $this->registerOverrides();
        }
    }
414155
public function register(Application $app)
    {
        $app['accounts.service'] = $app->share(function () use ($app) {
            return new AccountService(
                $app['authentication'],
                $app['auth.password-encoder'],
                $app['dispatcher'],
                $app['orm.em'],
                $app['model.user-manager'],
                $app['manipulator.user'],
                $app['repo.users']
            );
        });
    }
1143199
public final void register() {
        synchronized (this) {
            if (filterFactoryServiceRegistration != null) {
                throw new IllegalStateException(String.format("%s [%s] has been registered.", getClass()
                    .getSimpleName(), this));
            }
            filterFactoryServiceRegistration = bundleContext.registerService(SERVICE_CLASSES, this, properties);
            LOGGER.info("Registered filterFactory for application {} with priority {}", getApplicationName(),
                getPriority());
        }
    }
1020954
protected function registerApiHelper(Application $app)
    {
        $app->singleton(Factory::class, function ($app) {
            $request = $app['request'];
            $config = $app['config'];

            return new Factory($request, $config);
        });

        $app->alias(Factory::class, 'apihelper');
    }
1249297
protected function registerServices()
    {
        $this->app->bindShared('modules', function ($app) {
            $path = $app['config']->get('modules.paths.modules');

            return new Repository($app, $path);
        });
    }
1367761
protected function registerService()
	{
	    $this->app->singleton($this->getProviderKey(), function($app)
	    {
	    	return new Service($this->getProviderKey(), null, $this->getAggregateService());
	    });
	}
201298
protected void registerSelf() {
        publishSelf();
        serviceRegistry.get().registerService(getServiceDescription());
        serviceRegistry.get().subscribe((pair, err) -> {
            serviceEvent(pair.car(), pair.cdr(), err);
        });
        heartBeat();
        Log.Info(this, "registered at serviceRegistry.");
    }
336445
public function registerRoute()
    {
        if(!is_null($services = $this->services)) {
            foreach($services as $service) {

                $routes = $this->app->make($service)->registerRoute();

                $this->requiredRoute($routes);
            }
        }
    }
35602
protected function registerToAppConfig()
    {
        /*
         * Register the service provider for the dependencies.
         */
        $this->app->register(\Cartalyst\Sentinel\Laravel\SentinelServiceProvider::class);
        $this->app->register(\TomLingham\Searchy\SearchyServiceProvider::class);
        $this->app->register(\Jenssegers\Agent\AgentServiceProvider::class);
        $this->app->register(\Torann\GeoIP\GeoIPServiceProvider::class);

        /*
         * Create aliases for the dependencies.
         */
        $loader = \Illuminate\Foundation\AliasLoader::getInstance();
        $loader->alias('Schema', 'jlourenco\support\Database\Schema');
        $loader->alias('Activation', 'Cartalyst\Sentinel\Laravel\Facades\Activation');
        $loader->alias('Reminder', 'Cartalyst\Sentinel\Laravel\Facades\Reminder');
        $loader->alias('Sentinel', 'Cartalyst\Sentinel\Laravel\Facades\Sentinel');
        $loader->alias('Datatables', 'yajra\Datatables\Datatables');
        $loader->alias('SentinelUser', 'App\Http\Middleware\SentinelUser');
        $loader->alias('Base', 'jlourenco\base\Facades\Base');
        $loader->alias('Searchy', 'TomLingham\Searchy\Facades\Searchy');
        $loader->alias('Agent', 'Jenssegers\Agent\Facades\Agent');
        $loader->alias('GeoIP', 'Torann\GeoIP\GeoIPFacade');
    }
1015168
public function registerServices()
    {
        $this['serviceProviders'] = $this->serviceProviders;

        foreach ($this->serviceProviders as $providerArray) {
            list($provider,$enabled) = $providerArray;

            if (!$enabled) {
                continue;
            }

            if (empty($provider) || !class_exists($provider)) {
                continue;
            }

            $provider = new $provider(self::$instance);
            $provider->register();
        }
    }
535908
def register_app(self, app=None):
        '''
        
        '''
        app = app or self.options['DEFAULT_APP']
        if not app:
            raise ImproperlyConfigured('An app name is required because DEFAULT_APP is empty - please use a '
                                        'valid app name or set the DEFAULT_APP in settings')
        if isinstance(app, str):
            app = apps.get_app_config(app)

        # since this only runs at startup, this lock doesn't affect performance
        with self.registration_lock:
            # short circuit if already registered
            if app.name in self.registered_apps:
                return

            # first time for this app, so add to our dictionary
            self.registered_apps[app.name] = app

            # set up the template, script, and style renderers
            # these create and cache just by accessing them
            self.engine.get_template_loader(app, 'templates', create=True)
            self.engine.get_template_loader(app, 'scripts', create=True)
            self.engine.get_template_loader(app, 'styles', create=True)

            # send the registration signal
            if self.options['SIGNALS']:
                dmp_signal_register_app.send(sender=self, app_config=app)
1146027
public function register(Application $app)
    {
        $this->loadProviders();

        foreach ($this->controllerProviders as $class => $values) {
            $app->register(new $class, $values);
        }
    }
1320208
def _register(cls, app, **kwargs):
        

        # nav
        nav = __options__.get("nav", {})
        nav.setdefault("title", "Contact")
        nav.setdefault("visible", True)
        nav.setdefault("order", 100)
        title = nav.pop("title")
        render.nav.add(title, cls.page, **nav)

        # route
        kwargs["base_route"] = __options__.get("route", "/contact/")

        # App Option
        data = {
            "recipients": __options__.get("recipients"),
            "success_message": __options__.get("success_message",
                                               "Message sent. Thanks!")
        }

        @app.before_first_request
        def setup():
            if db._IS_OK_:
                try:
                    app_data.set(APP_DATA_KEY, data, init=True)
                except Exception as ex:
                    logging.fatal("mocha.contrib.app_data has not been setup. Need to run `mocha :dbsync`")
                    abort(500)

        # Call the register
        super(cls, cls)._register(app, **kwargs)
738524
def register(self, *paths, methods=None, name=None, handler=None):
        
        if isinstance(methods, str):
            methods = [methods]

        def wrapper(view):
            if handler is None:

                handler_ = view
                methods_ = methods or [METH_ANY]

                if isfunction(handler_) or ismethod(handler_):
                    handler_ = Handler.from_view(view, *methods_, name=name)

                handler_.bind(self, *paths, methods=methods_, name=name)

            else:

                view_name = view.__name__
                if not hasattr(handler, view_name):
                    setattr(handler, view_name, to_coroutine(view))
                name_ = name or view_name
                handler.bind(self, *paths, methods=methods, name=name_, view=view_name)

            return view

        # Support for @app.register(func)
        if len(paths) == 1 and callable(paths[0]):
            view = paths[0]

            if isclass(view) and issubclass(view, BaseException):
                return wrapper

            paths = []
            return wrapper(view)

        return wrapper