You are here

public static function CasServerConfig::createFromModuleConfig in CAS 8

Same name and namespace in other branches
  1. 2.x src/CasServerConfig.php \Drupal\cas\CasServerConfig::createFromModuleConfig()

Initialize an object from the CAS module config.

Parameters

\Drupal\Core\Config\Config $config: The config object for the CAS module.

Return value

\Drupal\cas\CasServerConfig The initialized value object.

8 calls to CasServerConfig::createFromModuleConfig()
CasProxyHelper::getProxyTicket in src/Service/CasProxyHelper.php
Get a proxy ticket using a proxy granting ticket.
CasProxyHelper::getServerProxyUrl in src/Service/CasProxyHelper.php
Format a CAS Server proxy ticket request URL.
CasRedirector::buildRedirectResponse in src/Service/CasRedirector.php
Determine login URL response.
CasServerConfigTest::testCasServerGuzzleConnectionOptions in tests/src/Unit/CasServerConfigTest.php
Test getCasServerGuzzleConnectionOptions.
CasServerConfigTest::testGetServerBaseUrl in tests/src/Unit/CasServerConfigTest.php
Test getServerBaseUrl.

... See full list

File

src/CasServerConfig.php, line 83

Class

CasServerConfig
Class CasServerConfig.

Namespace

Drupal\cas

Code

public static function createFromModuleConfig(Config $config) {
  $obj = new self();
  $obj
    ->setProtocolVersion($config
    ->get('server.version'));
  $obj
    ->setHttpScheme($config
    ->get('server.protocol'));
  $obj
    ->setHostname($config
    ->get('server.hostname'));
  $obj
    ->setPort($config
    ->get('server.port'));
  $obj
    ->setPath($config
    ->get('server.path'));
  $obj
    ->setVerify($config
    ->get('server.verify'));
  $obj
    ->setCustomRootCertBundlePath($config
    ->get('server.cert'));
  $obj
    ->setConnectionTimeout($config
    ->get('advanced.connection_timeout'));
  return $obj;
}