Пример #1
0
 /**
  * Create a new Sentry object.
  *
  * @param  \Cartalyst\Sentry\Users\ProviderInterface $userProvider
  * @param  \Cartalyst\Sentry\Groups\ProviderInterface $groupProvider
  * @param  \Cartalyst\Sentry\Throttling\ProviderInterface $throttleProvider
  * @param  \Cartalyst\Sentry\Sessions\SessionInterface $session
  * @param  \Cartalyst\Sentry\Cookies\CookieInterface $cookie
  * @param  string $ipAddress
  * @return void
  */
 public function __construct(UserProviderInterface $userProvider = null, GroupProviderInterface $groupProvider = null, ThrottleProviderInterface $throttleProvider = null, SessionInterface $session = null, CookieInterface $cookie = null, $ipAddress = null)
 {
     $this->userProvider = $userProvider ?: new UserProvider(new NativeHasher());
     $this->groupProvider = $groupProvider ?: new GroupProvider();
     // make the Synergixe User model work for setup with provider...
     $this->userProvider->setModel('Synergixe\\App\\Models\\User');
     $this->throttleProvider = $throttleProvider ?: new ThrottleProvider($this->userProvider);
     // make the Synergixe Throttle model work for setup with provider...
     $this->throttleProvider->setModel('Synergixe\\App\\Models\\Throttle');
     $this->session = $session ?: new NativeSession();
     $this->cookie = $cookie ?: new NativeCookie();
     if (isset($ipAddress)) {
         $this->ipAddress = $ipAddress;
     }
 }