You are here

public function SettingsFactory::getPartner in Lockr 8.3

Same name and namespace in other branches
  1. 8.4 src/SettingsFactory.php \Drupal\Lockr\SettingsFactory::getPartner()
  2. 4.x 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 (defined('PANTHEON_BINDING')) {
    $cert_path = '/srv/bindings/' . PANTHEON_BINDING . '/certs/binding.pem';
    if (!is_file($cert_path)) {

      // Pantheon is rolling out a new file system layout for their
      // containers.
      // This is the new path where certs will live.
      // XXX: When rollout is complete, the old path can be phased out.
      $cert_path = '/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;
}