You are here

public function PathContext::__construct in Acquia Lift Connector 8

Same name and namespace in other branches
  1. 8.4 src/Service/Context/PathContext.php \Drupal\acquia_lift\Service\Context\PathContext::__construct()
  2. 8.3 src/Service/Context/PathContext.php \Drupal\acquia_lift\Service\Context\PathContext::__construct()

Constructor.

Parameters

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory service.

\Drupal\Core\Path\CurrentPathStack $current_path_stack: The current path service.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

\Drupal\acquia_lift\Service\Helper\PathMatcher $pathMatcher: The path matcher.

File

src/Service/Context/PathContext.php, line 74
Contains \Drupal\acquia_lift\Service\Context\PathContext.

Class

PathContext

Namespace

Drupal\acquia_lift\Service\Context

Code

public function __construct(ConfigFactoryInterface $config_factory, CurrentPathStack $current_path_stack, RequestStack $request_stack, PathMatcher $pathMatcher) {
  $settings = $config_factory
    ->get('acquia_lift.settings');
  $credential_settings = $settings
    ->get('credential');
  $identity_settings = $settings
    ->get('identity');
  $visibilitySettings = $settings
    ->get('visibility');
  $this->credentialSettings = $credential_settings;
  $this->identitySettings = $identity_settings;
  $this->requestPathPatterns = $visibilitySettings['path_patterns'];
  $this->currentPath = $current_path_stack
    ->getPath();
  $this->pathMatcher = $pathMatcher;
  $this
    ->setIdentityByRequest($request_stack);
}