Register the hasher used by Sentry.

@return void
184464
protected function registerHasher()
	{
		$this->app->singleton('sentry.hasher', function($app)
		{
			$hasher = $app['config']->get('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.");
		});
	}
105230
protected function updateHash()
    {
        $hash = $this->getClassName() . '_' . $this->getObjectId();
        $base64Hash = base64_encode($hash);

        $this->hash = $base64Hash;
    }
123563
protected function registerUserRepository()
    {
        $this->app->singleton('userrepository', function ($app) {
            $model = $app['config']['sentry.users.model'];
            $user = new $model();

            $validator = $app['validator'];

            return new UserRepository($user, $validator);
        });

        $this->app->alias('userrepository', UserRepository::class);
    }
995038
protected function registerUsers()
    {
        $this->registerHasher();

        $this->app->singleton( 'sentinel.users', function ( $app )
        {
            return new IlluminateUserRepository(
                $app['sentinel.hasher'],
                $app['events'],
                User::class
            );
        } );
    }
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);
		});
	}
428284
public function register()
    {
        $loader = AliasLoader::getInstance();

        // Register aliases
        foreach ($this->getAliases() as $alias => $class) {
            $loader->alias($alias, $class);
        }

        // Register service containers
        foreach ($this->getServiceContainers() as $abstract => $concrete) {
            $this->app->singleton($abstract, $concrete);
        }
    }
338823
public function hasher()
	{
		is_null($this->hasher) and $this->hasher = new \PHPSecLib\Crypt_Hash();

		return $this->hasher;
	}
490412
protected static function register()
    {
        if (!self::$registered) {
            // set up __autoload
            $autoload = spl_autoload_functions();
            spl_autoload_register(__CLASS__.'::load');
            if (function_exists('__autoload') && ($autoload === false)) {
                // __autoload() was being used, but now would be ignored, add
                // it to the autoload stack
                spl_autoload_register('__autoload');
            }
        }
        self::$registered = true;
    }
808713
protected function registerDispatcher()
    {
        $this->app->singleton(Dispatcher::class, function() {
            return new Dispatcher(
                $this->app->make('files'), $this->app->make('html'), $this->app->make('antares.asset.resolver'), $this->app->make('path.public')
            );
        });

        $this->app->alias(Dispatcher::class, 'antares.asset.dispatcher');
    }
69672
protected function registerReminders()
    {
        $this->app->singleton('sentinel.reminders', function ($app) {
            $config = $app['config']->get('cartalyst.sentinel.reminders');

            return new IlluminateReminderRepository(
                $app['sentinel.users'], $config['model'], $config['expires']
            );
        });
    }
505843
protected function registerAliases()
    {
        $loader = AliasLoader::getInstance();
        foreach ($this->get('aliases', []) as $aliasName => $aliasClass) {
            $loader->alias($aliasName, $aliasClass);
        }
    }
1288769
private function hashHashable()
    {
        $hasher = new BcryptHasher;
        $filtered = array_filter($this->attributes);

        foreach ($filtered as $key => $value)
        {
            if (in_array($key, $this->hashable) && $value != $this->getOriginal($key))
            {
                $this->attributes[$key] = $hasher->make($value);
            }
        }
    }
156414
public function registerWorker()
    {
        Resque::redis()->sadd('workers', $this);
        Resque::redis()->set('worker:' . (string)$this . ':started', strftime('%a %b %d %H:%M:%S %Z %Y'));
    }
237203
public function onRegisterFromCache()
    {
        if ($this->isCachingEnabled()) {
            $blockId = $this->getEnvOption('id');
        
            $cacheKeyAssets = ['blockassets', $blockId];
            $cacheKeyAssetBundles = ['blockassetbundles', $blockId];
        
            $assets = Yii::$app->cache->get($cacheKeyAssets) ?: [];
            $assetBundles = Yii::$app->cache->get($cacheKeyAssetBundles) ?: [];
        
            PhpBlockView::registerToAppView($assets, $assetBundles);
        }
    }
283491
protected function registerExecutor()
    {
        $this->app->singleton('backup.executor', function (Container $app) {
            $logger = $app['log'];

            return new Executor($logger);
        });

        $this->app->alias('backup.executor', Executor::class);
    }
262884
protected function registerHashCheckCommand($command)
    {
        $this->app->singleton($command, function ($app) {
            return new Commands\HashCheckCommand($app);
        });
    }
1125391
public function register() {
        if (!$this->registered) {
            spl_autoload_register([$this, 'autoLoad'], $throw=true, $prepend=false);
            $this->registered = true;
        }
        return $this;
    }