You are here

function lockr_get_partner in Lockr 7.3

Same name and namespace in other branches
  1. 7 lockr.module \lockr_get_partner()
  2. 7.2 lockr.module \lockr_get_partner()

Returns the detected partner, if available.

5 calls to lockr_get_partner()
drush_lockr_register in ./lockr.drush.inc
Registers the site with lockr.
lockr_admin_page in ./lockr.admin.inc
lockr_admin_register_form_submit in ./lockr.admin.inc
lockr_admin_status in include/status.inc
@file Status callback for Lockr admin page.
lockr_settings in ./lockr.module
Returns the Lockr settings for this site.

File

./lockr.module, line 51
Hook implementations and callbacks for lockr.

Code

function lockr_get_partner() {
  if (defined('PANTHEON_BINDING')) {
    $desc = <<<EOL
The Pantheor is strong with this one.
We're detecting you're on Pantheon and a friend of theirs is a friend of ours.
Welcome to Lockr.
EOL;
    $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' => t('Pantheon'),
      'description' => $desc,
      'cert' => $cert_path,
    ];
  }
  return NULL;
}