register

@return  mixed
183405
public function register()
    {
        if (version_compare(phpversion(), '5.4.0', '>=')) {
            // param2 is $register_shutdown, if false please call register_shutdown_function('session_write_close') before session_start()
            session_set_save_handler($this, true);
        } else {
            session_set_save_handler(
                array($this, 'open'),
                array($this, 'close'),
                array($this, 'read'),
                array($this, 'write'),
                array($this, 'destroy'),
                array($this, 'gc')
            );
        }
    }
1235211
public function register()
    {
        Paginator::viewFactoryResolver(function () {
            return $this->app['view'];
        });

        Paginator::currentPathResolver(function () {
            return $this->app['request']->url();
        });

        Paginator::currentPageResolver(function ($pageName = 'page') {
            $page = $this->app['request']->input($pageName);

            if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) {
                return (int) $page;
            }

            return 1;
        });
    }
705399
public function register()
    {
        $app = $this->app;

        // register spec path for app
        $app['path.specs'] = $app->basePath().'/resources/specs';

        // register spec repository
        $app->singleton('specs', function ($app) {
            $loader = new Repository\FileLoader($app['files'], $app['path.specs']);

            return new Repository\NamespacedRepository($loader);
        });

        // register addon environment
        $app->instance('addon', $this->addonEnvironment = new AddonEnvironment($app));
        $app->alias('addon', AddonEnvironment::class);

        // register addon generator
        $app->singleton('addon.generator', function ($app) {
            return new AddonGenerator();
        });
        $app->alias('addon.generator', AddonGenerator::class);

        // register database migrator
        $app->singleton('database.migrator', function ($app) {
            return new Migrator($app['db'], $app['config']);
        });
        $app->alias('database.migrator', Migrator::class);

        $app['events']->fire(new AddonWorldCreated($this->addonEnvironment));

        $this->registerClassResolvers();

        (new AddonRegistrar)->register($app, $this->addonEnvironment->addons());

        $app['events']->fire(new AddonRegistered($this->addonEnvironment));
    }
199737
public function register()
    {
        $this->mergeConfigFrom(__DIR__ . '/../../../config/settings.php', 'settings');

        $this->app->singleton('settings.key_generator', function ($app) {
            return $app->make($app['config']['settings.key_generator']);
        });

        $this->app->singleton('settings.context_serializer', function ($app) {
            return $app->make($app['config']['settings.context_serializer']);
        });

        $this->app->singleton('settings.value_serializer', function ($app) {
            return $app->make($app['config']['settings.value_serializer']);
        });

        $this->app->singleton('settings.factory', function ($app) {
            return new Factory($app);
        });

        $this->app->singleton('settings.repository', function ($app) {
            return $app['settings.factory']->driver();
        });

        $this->app->singleton('settings', function ($app) {
            $settings = new Settings(
                $app['settings.repository'],
                $app['settings.key_generator'],
                $app['settings.value_serializer']
            );

            $settings->setCache($app['cache.store']);
            $settings->setEncrypter($app['encrypter']);
            $settings->setDispatcher($app['events']);

            $app['config']['settings.cache'] ? $settings->enableCache() : $settings->disableCache();
            $app['config']['settings.encryption'] ? $settings->enableEncryption() : $settings->disableEncryption();
            $app['config']['settings.events'] ? $settings->enableEvents() : $settings->disableEvents();

            return $settings;
        });

        $this->registerAliases();

        $this->registerCommands();
    }
117508
public function register()
    {
        $this->app->resolving('db', function ($db) {
            $db->extend('rethinkdb', function ($config) {
                return new Connection($config);
            });
        });

        $this->app->singleton('command.rethink-migrate.make', function ($app) {

            $creator = new MigrationCreator($app['files']);
            $composer = $app['composer'];

            return new MigrateMakeCommand($creator, $composer);
        });

        $this->commands('command.rethink-migrate.make');

        $this->app->singleton('command.rethink-model.make', function ($app) {
            return new ModelMakeCommand($app['files']);
        });

        $this->commands('command.rethink-model.make');
    }
1348058
public function register()
    {
        $app = $this->app;

        // Add Custom Tpl extension (.tpl)
        $this->app['view']->addExtension('tpl.php',
            'tpl',
            function() use ($app) {
                $cache = $app['path.storage'].'/framework/views';

                $compiler = new Arx\classes\view\engines\tpl\TplCompiler($app['files'], $cache);

                return new CompilerEngine($compiler);
            }
        );

        // Add Shortcode handler
        $this->app['shortcode'] = $this->app->share(function($app)
        {
            return new Arx\classes\Shortcode();
        });

        $this->app->singleton('notify', function () {
            return $this->app->make('Arx\classes\Notify');
        });

        $this->registerFacades();
        $this->registerProviders();
        $this->registerCommands();
    }
820094
public function register()
	        {

		$this->mergeConfigFrom(
		                __DIR__ . '/config/config.php', 'extras'
		            );

		$this->app->bind(
		                'Extras', function () {
			return new Extras();
		}
		);

		$this->app->bind(
		                'Gmap', function () {
			return new Maps();
		}
		);

		$this->app->bind('Socialize', function () {
			return new Socializer();
		}
		);

		$this->app->bind('twitterauth', function () {
			return new TwitterAuth();
		}
		);

		$this->loadProviders();

		$this->loadAliases();


	}
1152793
public function register()
    {
        /*
        |--------------------------------------------------------------------------
        | Providers
        |--------------------------------------------------------------------------
        */

        $this->app->register(\Collective\Html\HtmlServiceProvider::class);

        /*
        |--------------------------------------------------------------------------
        | Register the Utilities
        |--------------------------------------------------------------------------
        */

        $this->app->singleton('FormMaker', function () {
            return new FormMaker();
        });

        $this->app->singleton('InputMaker', function () {
            return new InputMaker();
        });

        $loader = AliasLoader::getInstance();

        $loader->alias('FormMaker', \Grafite\FormMaker\Facades\FormMaker::class);
        $loader->alias('InputMaker', \Grafite\FormMaker\Facades\InputMaker::class);

        // Thrid party
        $loader->alias('Form', \Collective\Html\FormFacade::class);
        $loader->alias('HTML', \Collective\Html\HtmlFacade::class);

        /*
        |--------------------------------------------------------------------------
        | Blade Directives
        |--------------------------------------------------------------------------
        */

        // Form Maker
        Blade::directive('form_maker_table', function ($expression) {
            return "<?php echo FormMaker::fromTable($expression); ?>";
        });

        Blade::directive('form_maker_array', function ($expression) {
            return "<?php echo FormMaker::fromArray($expression); ?>";
        });

        Blade::directive('form_maker_object', function ($expression) {
            return "<?php echo FormMaker::fromObject($expression); ?>";
        });

        Blade::directive('form_maker_columns', function ($expression) {
            return "<?php echo FormMaker::getTableColumns($expression); ?>";
        });

        // Label Maker
        Blade::directive('input_maker_label', function ($expression) {
            return "<?php echo InputMaker::label($expression); ?>";
        });

        Blade::directive('input_maker_create', function ($expression) {
            return "<?php echo InputMaker::create($expression); ?>";
        });
    }
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);
		};
	}
276449
public static function register()
    {
        self::$list = [];
        //
        self::$list['post'] = !isset($_POST) ?: $_POST;
        self::$list['get'] = !isset($_GET) ?: $_GET;
        self::$list['session'] = !isset($_SESSION) ?: $_SESSION;
        self::$list['cookie'] = !isset($_COOKIE) ?: $_COOKIE;
        self::$list['files'] = !isset($_FILES) ?: $_FILES;
        self::$list['server'] = !isset($_SERVER) ?: $_SERVER;
        self::$list['env'] = !isset($_ENV) ?: $_ENV;
        self::$list['request'] = !isset($_REQUEST) ?: $_REQUEST;
        //
        return self::$list;
    }
176140
public function register() {
        $this->loadConfiguration();

        /** Register language repository . */
        $this->app->bind('lang-db-repo', function() {
            return new LanguageRepository(
                new Language()
            );
        });

        /** Register translations repository . */
        $this->app->bind('translations-db-repo', function() {
            return new TranslationsRepository(
                new Translation()
            );
        });

        /** Register driver manager */
        $this->app->bind('driver-translator-manager', function() {
            return (new Manager(
                config('laravel-translator')
            ));
        });

        /** Register translator . */
        $this->app->singleton('laravel-translator', function($app) {
            return new Translator(
                config('laravel-translator'),
                $app['driver-translator-manager']
            );
        });
    }
1049298
public function register()
    {
        if (! $this->isInstalled()) {
            $this->app['command.twostream.install'] = $this->app->share(function ($app) {
                return new Install($this->getAppNamespace());
            });
            
            return $this->commands(['command.twostream.install']);
        }
        
        parent::register();
        
        $this->app['command.twostream.listen'] = $this->app->share(function ($app) {
            return new Server($app);
        });
        
        $this->app['command.twostream.stop'] = $this->app->share(function ($app) {
            return new Stop();
        });
        
        $this->commands($this->commands);
        
        $this->mergeConfigFrom(
            __DIR__ . '/../config/twostream.php', 'twostream'
        );
        
        $this->app->singleton(Factory::class, function ($app) {
            $config = array_dot($this->app['config']['twostream']);
            
            return new TwoStream($config);
        });
        
        $this->app->singleton(ReadOnly::class, function ($app) {
            return new ReadOnly($this->app['config']['session.cookie']);
        });
    }
388057
public function register()
    {
        $this->app->singleton('mailer', function () {
            $view = $this->app->make('Illuminate\Contracts\View\Factory');
            $logger = $this->app->make('Psr\Log\LoggerInterface');
            $swift = new \Swift_Mailer(new LogTransport($logger));
            $events = $this->app->make('Illuminate\Contracts\Events\Dispatcher');

            $mailer = new Mailer($view, $swift, $events);
            $mailer->setLogger($logger);

            return $mailer;
        });

        $this->app->alias('mailer', 'Illuminate\Contracts\Mail\Mailer');
    }
599745
public function register()
    {
        $this->app->register(AdminEventServiceProvider::class);
        $this->app->register(ImageServiceProvider::class);
        $this->app->register(WidgetServiceProvider::class);
        $this->app->register(DoctrineSupportServiceProvider::class);

        $loader = AliasLoader::getInstance();
        $loader->alias('Admin', AdminFacade::class);

        $this->app->singleton('admin', function () {
            return new Admin();
        });

        $this->loadHelpers();

        $this->registerAlertComponents();
        $this->registerFormFields();
        $this->registerWidgets();

        $this->registerConfigs();

        if ($this->app->runningInConsole()) {
            $this->registerPublishableResources();
            $this->registerConsoleCommands();
        }

        if (!$this->app->runningInConsole() || config('app.env') == 'testing') {
            $this->registerAppCommands();
        }
    }
268776
public function register()
    {
        // Register config
        $this->registerConfig();

        // Bind SidebarResolver
        $this->app->bind('Maatwebsite\Sidebar\Infrastructure\SidebarResolver', function (Application $app) {

            $resolver = SidebarResolverFactory::getClassName(
                $app['config']->get('sidebar.cache.method')
            );

            return $app->make($resolver);
        });

        // Bind SidebarFlusher
        $this->app->bind('Maatwebsite\Sidebar\Infrastructure\SidebarFlusher', function (Application $app) {

            $resolver = SidebarFlusherFactory::getClassName(
                $app['config']->get('sidebar.cache.method')
            );

            return $app->make($resolver);
        });

        // Bind manager
        $this->app->singleton('Maatwebsite\Sidebar\SidebarManager');

        // Bind Menu
        $this->app->bind(
            'Maatwebsite\Sidebar\Menu',
            'Maatwebsite\Sidebar\Domain\DefaultMenu'
        );

        // Bind Group
        $this->app->bind(
            'Maatwebsite\Sidebar\Group',
            'Maatwebsite\Sidebar\Domain\DefaultGroup'
        );

        // Bind Item
        $this->app->bind(
            'Maatwebsite\Sidebar\Item',
            'Maatwebsite\Sidebar\Domain\DefaultItem'
        );

        // Bind Badge
        $this->app->bind(
            'Maatwebsite\Sidebar\Badge',
            'Maatwebsite\Sidebar\Domain\DefaultBadge'
        );

        // Bind Append
        $this->app->bind(
            'Maatwebsite\Sidebar\Append',
            'Maatwebsite\Sidebar\Domain\DefaultAppend'
        );

        // Bind Renderer
        $this->app->bind(
            'Maatwebsite\Sidebar\Presentation\SidebarRenderer',
            'Maatwebsite\Sidebar\Presentation\Illuminate\IlluminateSidebarRenderer'
        );
    }
300465
public function register()
    {
        $this->loadViewsFrom(__DIR__ . '/resources/views', 'pagination');

        Paginator::viewFactoryResolver(function () {
            return $this->container['view'];
        });

        Paginator::currentPathResolver(function () {
            return $this->container['request']->fullurl();
        });

        Paginator::currentPageResolver(function ($pageName = 'page') {
            $page = $this->container['request']->input($pageName);

            if (filter_var($page, FILTER_VALIDATE_INT) !== false && (int) $page >= 1) {
                return $page;
            }

            return 1;
        });
    }
1213680
public function register()
    {
        // Bind the Class
        $this->app->bind('helper', function () {
            return $this->app->make(Helper::class);
        });

        // Register an Alias of the Facade
        $this->app->booting(function () {
            $loader = AliasLoader::getInstance();
            $loader->alias('Helper', HelperFacade::class);
        });
    }