You are here

class SecurepagesPathProcessor in Secure Pages 8

Securepages path processor.

This path processor applies a configured secure base URL. It is useful for sites that have multiple insecure base URLs and an SSL certificate valid only for one secure base URL.

Hierarchy

Expanded class hierarchy of SecurepagesPathProcessor

1 string reference to 'SecurepagesPathProcessor'
securepages.services.yml in ./securepages.services.yml
securepages.services.yml
1 service uses SecurepagesPathProcessor
securelogin.path_processor in ./securepages.services.yml
Drupal\securepages\SecurepagesPathProcessor

File

src/SecurepagesPathProcessor.php, line 22
Contains Drupal\securepages\SecurepagesPathProcessor.

Namespace

Drupal\securepages
View source
class SecurepagesPathProcessor implements OutboundPathProcessorInterface {

  /**
   * The configured secure login base URL.
   */
  protected $baseUrl;

  /**
   * Constructs secure login path processor.
   */
  public function __construct(ConfigFactoryInterface $config_factory) {
    $this->baseUrl = $config_factory
      ->get('securepages.settings')
      ->get('basepath_ssl');
  }

  /**
   * {@inheritdoc}
   */
  public function processOutbound($path, &$options = [], Request $request = NULL, BubbleableMetadata $bubbleable_metadata = NULL) {
    if (!empty($options['https']) && $this->baseUrl) {
      $options['absolute'] = TRUE;
      $options['base_url'] = $this->baseUrl;
    }
    return $path;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
SecurepagesPathProcessor::$baseUrl protected property The configured secure login base URL.
SecurepagesPathProcessor::processOutbound public function Processes the outbound path. Overrides OutboundPathProcessorInterface::processOutbound
SecurepagesPathProcessor::__construct public function Constructs secure login path processor.