You are here

public function SettingsFactory::getPartner in Lockr 4.x

Same name and namespace in other branches
  1. 8.4 src/SettingsFactory.php \Drupal\Lockr\SettingsFactory::getPartner()
  2. 8.3 src/SettingsFactory.php \Drupal\Lockr\SettingsFactory::getPartner()

Gets the detected Lockr partner information.

Return value

array|null The partner information, or NULL if no partner is detected.

1 call to SettingsFactory::getPartner()
SettingsFactory::getSettings in src/SettingsFactory.php
Creates a new Lockr settings object from Drupal settings.

File

src/SettingsFactory.php, line 99

Class

SettingsFactory
Creates settings objects for lockr clients.

Namespace

Drupal\lockr

Code

public function getPartner() {
  if (isset($_ENV['PANTHEON_ENVIRONMENT'])) {
    $cert_path = '/certs/binding.pem';
    if (!is_file($cert_path) && defined('PANTHEON_BINDING')) {
      $cert_path = '/srv/bindings/' . PANTHEON_BINDING . '/certs/binding.pem';
    }
    return [
      'name' => 'pantheon',
      'title' => 'Pantheon',
      'description' => "The Pantheor is strong with this one.\n          We're detecting you're on Pantheon and a friend of theirs is a friend of ours.\n          Welcome to Lockr.",
      'cert' => $cert_path,
    ];
  }
  return NULL;
}