Register the cookie driver used by Sentry.

@return void
326289
protected function registerCookie()
	{
		$this->app['sentry.cookie'] = $this->app->share(function($app)
		{
			$key = $app['config']['cartalyst/sentry::cookie.key'];

			/**
			 * We'll default to using the 'request' strategy, but switch to
			 * 'jar' if the Laravel version in use is 4.0.*
			 */

			$strategy = 'request';

			if (preg_match('/^4\.0\.\d*$/D', $app::VERSION))
			{
				$strategy = 'jar';
			}

			return new IlluminateCookie($app['request'], $app['cookie'], $key, $strategy);
		});
	}
267285
public function register()
	{
		$this->app->bindShared('cache', function($app)
		{
			return new CacheManager($app);
		});

		$this->app->bindShared('cache.store', function($app)
		{
			return $app['cache']->driver();
		});

		$this->app->bindShared('memcached.connector', function()
		{
			return new MemcachedConnector;
		});

		$this->registerCommands();
	}
376563
protected function registerHasher()
	{
		$this->app['sentry.hasher'] = $this->app->share(function($app)
		{
			$hasher = $app['config']['cartalyst/sentry::hasher'];

			switch ($hasher)
			{
				case 'native':
					return new NativeHasher;
					break;

				case 'bcrypt':
					return new BcryptHasher;
					break;

				case 'sha256':
					return new Sha256Hasher;
					break;

				case 'whirlpool':
					return new WhirlpoolHasher;
					break;
			}

			throw new \InvalidArgumentException("Invalid hasher [$hasher] chosen for Sentry.");
		});
	}
1120539
public function register()
    {
        $this->loadAdminAuthConfig();

        $this->registerRouteMiddleware();

        $this->commands($this->commands);

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

        $this->app->singleton(TerminalApplication::class, function ($app) {
            $config = $app['config']['terminal'];
            $artisan = new TerminalApplication($app, $app['events'], $app->version());
            $artisan->resolveCommands($config['commands']);

            return $artisan;
        });

        $this->app->singleton(Kernel::class, function ($app) {
            $config = $app['config']['terminal'];

            return new Kernel($app[TerminalApplication::class], array_merge($config, [
                'basePath' => base_path(),
                //'basePath' => cookie('cd_base_path'),
                'environment' => $app->environment(),
                'version' => $app->version(),
                'endpoint' => $app['url']->route('terminal.endpoint'),
            ]));
        });
    }
254279
public function register()
    {
        $this->app->singleton(DriverInterface::class, function () {
            return new RestDriver();
        });

        $this->app->singleton('Zarinpal', function () {
            $merchantID = config('services.zarinpal.merchantID', config('Zarinpal.merchantID', 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'));

            $zarinpal = new Zarinpal($merchantID, $this->app->make(DriverInterface::class));

            if (config('services.zarinpal.sandbox', false)) {
                $zarinpal->enableSandbox();
            }
            if (config('services.zarinpal.zarinGate', false)) {
                $zarinpal->isZarinGate();
            }

            return $zarinpal;
        });
    }
957705
protected function registerThrottleProvider()
	{
		$this->app['sentry.throttle'] = $this->app->share(function($app)
		{
			$model = $app['config']['cartalyst/sentry::throttling.model'];

			$throttleProvider = new ThrottleProvider($app['sentry.user'], $model);

			if ($app['config']['cartalyst/sentry::throttling.enabled'] === false)
			{
				$throttleProvider->disable();
			}

			if (method_exists($model, 'setAttemptLimit'))
			{
				$attemptLimit = $app['config']['cartalyst/sentry::throttling.attempt_limit'];

				forward_static_call_array(
					array($model, 'setAttemptLimit'),
					array($attemptLimit)
				);
			}
			if (method_exists($model, 'setSuspensionTime'))
			{
				$suspensionTime = $app['config']['cartalyst/sentry::throttling.suspension_time'];

				forward_static_call_array(
					array($model, 'setSuspensionTime'),
					array($suspensionTime)
				);
			}
			
			// Define the User model to use for relationships.
			if (method_exists($model, 'setUserModel'))
			{
				$userModel = $app['config']['cartalyst/sentry::users.model'];

				forward_static_call_array(
					array($model, 'setUserModel'),
					array($userModel)
				);
			}

			return $throttleProvider;
		});
	}
1002573
public function register()
	{
		$this->app['laravel-head'] = $this->app->share(function($app)
		{
			return new LaravelHead;
		});

		$this->app->booting(function()
		{
			$loader = \Illuminate\Foundation\AliasLoader::getInstance();
			$loader->alias('Head', 'Gwnobots\LaravelHead\LaravelHeadFacade');
		});
	}
695433
public function register()
    {
        $this->setupDefaultDriver();

        $this->registerSessionManager();

        $this->registerSessionDriver();

        //
        $this->app->singleton('Nova\Session\Middleware\StartSession');
    }
169047
public function register()
    {
        $this->mergeConfigFrom(__DIR__ . '/config/config.php', 'tactician');

        $this->registerLocator();
        $this->registerExtractor();
        $this->registerInflector();
        $this->registerCommandHandler();
        $this->registerMiddleware();
        $this->registerCommandBus();
        $this->registerDispatcher();
    }
696887
protected function registerAuthenticator()
	{
		$this->app->singleton('auth', function ($app) {
			// Once the authentication service has actually been requested by the developer
			// we will set a variable in the application indicating such. This helps us
			// know that we need to set any queued cookies in the after event later.
			$app['auth.loaded'] = true;
			return new MultiManager($app);
		});
		$this->app->singleton('auth.driver', function ($app) {
			return $app['auth']->driver();
		});
	}
723255
protected function registerDriver()
    {
        $app = $this->app;

        $config  = $app['config'];

        $storage = $config->get('jitimage::cache.path');

        $driver = sprintf(
            '\Thapp\JitImage\Driver\%sDriver',
            $driverName = ucfirst($config->get('jitimage::driver', 'gd'))
        );

        $app->bind(
            'Thapp\JitImage\Cache\CacheInterface',
            function () use ($storage) {
                $cache = new \Thapp\JitImage\Cache\ImageCache(
                    new CachedImage,
                    //$this->app['Thapp\JitImage\ImageInterface'],
                    new Filesystem,
                    $storage . '/jit'
                );
                return $cache;
            }
        );


        $app->bind('Thapp\JitImage\Driver\SourceLoaderInterface', 'Thapp\JitImage\Driver\ImageSourceLoader');

        $app->bind('Thapp\JitImage\Driver\BinLocatorInterface', function () use ($config) {
            $locator = new \Thapp\JitImage\Driver\ImBinLocator;
            extract($config->get('jitimage::imagemagick', ['path' => '/usr/local/bin', 'bin' => 'convert']));

            $locator->setConverterPath(
                sprintf('%s%s%s', rtrim($path, DIRECTORY_SEPARATOR), DIRECTORY_SEPARATOR, $bin)
            );

            return $locator;
        });


        $this->app->bind('Thapp\JitImage\Driver\DriverInterface', function () use ($driver) {
            return $this->app->make($driver);
        });
        
        $this->app->bind('Thapp\JitImage\ImageInterface', function () use ($app) {
            return new ProxyImage(function () use ($app) {
                $image = new Image($app->make('Thapp\JitImage\Driver\DriverInterface'));
                $image->setQuality($app['config']->get('jitimage::quality', 80));
                return $image;
            });
        });

        //$this->app->extend(
        //    'Thapp\JitImage\ImageInterface',
        //    function ($image) {
        //        $image->setQuality($this->app['config']->get('jitimage::quality', 80));
        //        return $image;
        //    }
        //);

        $this->app['jitimage'] = $this->app->share(
            function () use ($app) {
                $resolver = $app->make('Thapp\JitImage\ResolverInterface');
                $image = new JitImage($resolver, \URL::to('/'));
                return $image;
            }
        );

        $this->app['jitimage.cache'] = $this->app->share(
            function () {
                return $this->app->make('Thapp\JitImage\Cache\CacheInterface');
            }
        );

        $this->registerFilter($driverName, $this->getFilters());
    }
466659
public function register()
    {
        $this->app->singleton(Parser::class, function ($app) {
            return new Parser(new ParsedownDriver(config('markdown') ?? []));
        });

        $this->app->bind('markdown', Parser::class);
    }
388244
public function register()
	{
		$this->app->singleton('driver', function() 
		{
			$db = $this->app['db']->connection()->getPdo();

			return new EloquentDriver($db, $this->app['Str']);
		});

		$this->app->bind('fixture', function()
		{
		    $fixture = Fixture::getInstance();
		    $fixture->setDriver($this->app['driver']);
		    $fixture->setConfig($this->app['config']->get('fixture-l4::config'));

		    return $fixture;
		});
	}
742600
public function registerKernels()
    {
        if (class_exists('Chronos\Content\Console\Kernel')) {
            $this->app->singleton('chronos.content.console.kernel', function($app) {
                $dispatcher = $app->make(Dispatcher::class);
                return new Kernel($app, $dispatcher);
            });

            $this->app->make('chronos.content.console.kernel');
        }
    }
443079
public function register(): void
    {
        if ($this->app instanceof Lumen) {
            $this->app->configure('sentry');
        }

        $this->mergeConfigFrom(__DIR__ . '/../../../config/sentry.php', static::$abstract);

        $this->configureAndRegisterClient($this->app['config'][static::$abstract]);

        if (($logManager = $this->app->make('log')) instanceof LogManager) {
            $logManager->extend('sentry', function ($app, array $config) {
                return (new LogChannel($app))($config);
            });
        }
    }
1061613
protected function registerSession()
	{
		$this->app['sentry.session'] = $this->app->share(function($app)
		{
			$key = $app['config']['cartalyst/sentry::cookie.key'];

			return new IlluminateSession($app['session.store'], $key);
		});
	}
42432
protected function registerAuthenticator()
    {
        $this->app->singleton('auth', function ($app) {
            // Once the authentication service has actually been requested by the developer
            // we will set a variable in the application indicating such. This helps us
            // know that we need to set any queued cookies in the after event later.
            $app['auth.loaded'] = true;

            return new AuthManager($app);
        });

        $this->app->singleton('auth.driver', function ($app) {
            return $app['auth']->guard();
        });
    }