Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Commit

Permalink
Lazy load options
Browse files Browse the repository at this point in the history
  • Loading branch information
bakura10 committed Nov 29, 2013
1 parent ca5ceea commit 4484a59
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@
],

'zfc_rbac' => [
'unauthorized_strategy' => [],
'redirect_strategy' => [],

// Plugin managers
'guard_manager' => [],
'role_provider_manager' => [],
Expand Down
8 changes: 8 additions & 0 deletions src/ZfcRbac/Options/ModuleOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ public function setUnauthorizedStrategy(array $unauthorizedStrategy)
*/
public function getUnauthorizedStrategy()
{
if (null === $this->unauthorizedStrategy) {
$this->unauthorizedStrategy = new UnauthorizedStrategyOptions();
}

return $this->unauthorizedStrategy;
}

Expand All @@ -324,6 +328,10 @@ public function setRedirectStrategy(array $redirectStrategy)
*/
public function getRedirectStrategy()
{
if (null === $this->redirectStrategy) {
$this->redirectStrategy = new RedirectStrategyOptions();
}

return $this->redirectStrategy;
}

Expand Down

0 comments on commit 4484a59

Please sign in to comment.