/** * Constructs a new generator object. * * @param \Drupal\Core\Routing\RouteProviderInterface $provider * The route provider to be searched for routes. * @param \Drupal\Core\PathProcessor\OutboundPathProcessorInterface $path_processor * The path processor to convert the system path to one suitable for urls. * @param \Drupal\Core\RouteProcessor\OutboundRouteProcessorInterface $route_processor * The route processor. * @param \Drupal\Core\Config\ConfigFactoryInterface $config * The config factory. * @param \Psr\Log\LoggerInterface $logger * An optional logger for recording errors. * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack * A request stack object. */ public function __construct(RouteProviderInterface $provider, OutboundPathProcessorInterface $path_processor, OutboundRouteProcessorInterface $route_processor, ConfigFactoryInterface $config, LoggerInterface $logger = NULL, RequestStack $request_stack) { parent::__construct($provider, $logger); $this->pathProcessor = $path_processor; $this->routeProcessor = $route_processor; $allowed_protocols = $config->get('system.filter')->get('protocols') ?: array('http', 'https'); UrlHelper::setAllowedProtocols($allowed_protocols); $this->requestStack = $request_stack; }
/** * Constructs a new generator object. * * @param \Drupal\Core\Routing\RouteProviderInterface $provider * The route provider to be searched for routes. * @param \Drupal\Core\PathProcessor\OutboundPathProcessorInterface $path_processor * The path processor to convert the system path to one suitable for urls. * @param \Drupal\Core\RouteProcessor\OutboundRouteProcessorInterface $route_processor * The route processor. * @param \Drupal\Core\Config\ConfigFactoryInterface $config * The config factory. * @param \Drupal\Core\Site\Settings $settings * The read only settings. * @param \Psr\Log\LoggerInterface $logger * An optional logger for recording errors. * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack * A request stack object. */ public function __construct(RouteProviderInterface $provider, OutboundPathProcessorInterface $path_processor, OutboundRouteProcessorInterface $route_processor, ConfigFactoryInterface $config, Settings $settings, LoggerInterface $logger = NULL, RequestStack $request_stack) { parent::__construct($provider, $logger); $this->pathProcessor = $path_processor; $this->routeProcessor = $route_processor; $this->mixedModeSessions = $settings->get('mixed_mode_sessions', FALSE); $allowed_protocols = $config->get('system.filter')->get('protocols') ?: array('http', 'https'); UrlHelper::setAllowedProtocols($allowed_protocols); $this->requestStack = $request_stack; $this->updateFromRequest(); }