Registers services on the given app.

This method should only be used to configure services and parameters.
It should not get services.
196827
public function register(Application $app)
    {
        $app['twig'] = $app->share($app->extend('twig', function (\Twig_Environment $twig, $app) {
            $twig->setCache($app['cache.path'] . '/twig');

            $paths = [];

            if (file_exists($app['plugin.path'] . '/twig-paths.php')) {
                $paths = require $app['plugin.path'] . '/twig-paths.php';
            }

            if ($app['browser']->isTablet() || $app['browser']->isMobile()) {
                $paths[] = $app['root.path'] . '/config/templates/mobile';
                $paths[] = $app['root.path'] . '/templates/mobile';
                $paths['phraseanet'] = $app['root.path'] . '/config/templates/mobile';
                $paths['phraseanet'] = $app['root.path'] . '/templates/mobile';
            }

            $paths[] = $app['root.path'] . '/config/templates/web';
            $paths[] = $app['root.path'] . '/templates/web';
            $paths['phraseanet'] = $app['root.path'] . '/config/templates/web';
            $paths['phraseanet'] = $app['root.path'] . '/templates/web';

            foreach ($paths as $namespace => $path) {
                if (!is_int($namespace)) {
                    $app['twig.loader.filesystem']->addPath($path, $namespace);
                } else {
                    $app['twig.loader.filesystem']->addPath($path);
                }
            }

            $twig->addGlobal('current_date', new \DateTime());

            $this->registerExtensions($twig, $app);
            $this->registerFilters($twig, $app);

            return $twig;
        }));
    }
618129
public final void register() {
        synchronized (lock) {
            if (serviceRegistration == null) {
                BundleClassResolver resolver = new BundleClassResolver();
                serviceRegistration = bundleContext.registerService(SERVICE_NAMES, resolver, serviceProperties);
            }
        }
    }
934392
protected function registerProviders(): void
    {
        foreach ($this->providers as $provider) {
            $this->app->register($provider);
        }
    }
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)
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');
    }
168220
private function registerServices()
    {
        $this->app->singleton('pluggables', function ($app) {
            return new Pluggables($app['config'], $app['files']);
        });

        $this->app->booting(function ($app) {
            $app['pluggables']->register();
        });
    }
1321496
protected void doRegister(String appName, String serviceName, ProviderInfo providerInfo) {

        registerAppInfoOnce(appName);

        if (LOGGER.isInfoEnabled(appName)) {
            LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_ROUTE_REGISTRY_PUB, serviceName));
        }

        PublishServiceRequest publishServiceRequest = new PublishServiceRequest();
        publishServiceRequest.setServiceName(serviceName);
        ProviderMetaInfo providerMetaInfo = new ProviderMetaInfo();
        providerMetaInfo.setProtocol(providerInfo.getProtocolType());
        providerMetaInfo.setSerializeType(providerInfo.getSerializationType());
        providerMetaInfo.setAppName(appName);
        providerMetaInfo.setVersion(VERSION);
        publishServiceRequest.setProviderMetaInfo(providerMetaInfo);

        client.publishService(publishServiceRequest);
    }
530708
public function register()
	{
		$this->app['db'] = function($app)
		{
			// @FIXME: this isn't pretty, but it will shim the removal of the old mysql_* calls from php
			$driver = (Config::get('dbtype') == 'mysql') ? 'pdo' : Config::get('dbtype');

			$options = [
				'driver'   => $driver,
				'host'     => Config::get('host'),
				'user'     => Config::get('user'),
				'password' => Config::get('password'),
				'database' => Config::get('db'),
				'prefix'   => Config::get('dbprefix')
			];

			return Driver::getInstance($options);
		};
	}
1213158
protected function registerServices()
    {
        foreach (Antvel::bindings() as $key => $value) {
            is_numeric($key)
                ? $this->app->singleton($value)
                : $this->app->singleton($key, $value);
        }
    }
187340
def register_app(self, name: str, app: Callable = None) -> Callable:
        
        if app is None:
            def dec(app):
                """ inner decorator for register app """
                assert app is not None
                self.register_app(name, app)
                return app
            return dec
        self.applications[name] = app
        return None
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.");
    }
964717
private function registerServiceProviders()
    {
        $this->app->register( ArboryTranslationServiceProvider::class );
        $this->app->register( TranslatableServiceProvider::class );
        $this->app->register( ArboryFileServiceProvider::class );
        $this->app->register( ArboryAuthServiceProvider::class );
        $this->app->register( GlideImageServiceProvider::class );
        $this->app->register( AssetServiceProvider::class );
        $this->app->register( SettingsServiceProvider::class );
        $this->app->register( ExcelServiceProvider::class );
        $this->app->register( FileManagerServiceProvider::class );
    }
390304
public function register()
    {   
        $providers = config('app','core_providers');
        foreach ($providers as $key => $value) {
            $this->getContainer()->add($value);
        }
    }
873198
public function register(Application $app)
    {
        $this->setup($app);
        $app
            ->offsetGet('console')
            ->getHelperSet()
            ->set(new ConnectionHelper($app->offsetGet('connection')), 'connection')
        ;
    }
518275
def _init_app(self, app):
        
        for resource, urls, kwargs in self.resources:
            self._register_view(app, resource, *urls, **kwargs)
843845
public function register()
    {
        //Load helpers
        load_module_helpers(__DIR__);

        //Merge configs
        $configs = split_files_with_basename($this->app['files']->glob(__DIR__ . '/../../config/*.php'));

        foreach ($configs as $key => $row) {
            $this->mergeConfigFrom($row, $key);
        }

        $this->app->register(RouteServiceProvider::class);
        $this->app->register(BootstrapModuleServiceProvider::class);
        $this->app->register(ViewComposerServiceProvider::class);
    }
535017
function register(app) {
    //Check if registered twice
    if (applicationCurrent === app) {
        return;
    }

    //Only one application can be registered
    if (applicationCurrent) {
        throw new core.Error({
            code: 'application-registered',
            message: 'An application was already registered'
        });
    }

    //Set all handlers
    Interface.ensure(app, IApplication);
    applicationCurrent = app;

    currentHandlers.SIGINT = function () {
        console.log('Application interrupted');
        app.exit();
    };

    /*
     FIXME: Eclipse bug
     currentHandlers.SIGTERM = function () {
        console.log('Killing in the name of!');
        unregister();
        process.exit();
    };*/

    currentHandlers.uncaughtException = function (error) {
        app.handleError(error);
    };

    currentHandlers.exit = function () {
        exports.unregister();
    };

    EVENTS.forEach(function (event) {
        if (currentHandlers[event]) {
            process.on(event, currentHandlers[event]);
        }
    });

    //Start application
    applicationCurrent.start();
}