You are here

uri.php in Acquia Cloud Site Factory Connector 8.2

Same filename and directory in other branches
  1. 8 acsf_init/lib/cloud_hooks/acquia/uri.php

File

acsf_init/lib/cloud_hooks/acquia/uri.php
View source
<?php

/**
 * @file
 * Prints a drush-compatible uri, given a site, env and db_role.
 */
$site = $argv[1];
$env = $argv[2];
$db_role = $argv[3];

// Get the db connection.
require dirname(__FILE__) . '/../acquia/db_connect.php';
$connection = get_db($site, $env, $db_role);

// Get the site name from the database.
$result = execute_query($connection, 'SELECT value FROM acsf_variables WHERE name = "acsf_site_info"');
mysqli_close($connection);
if ($result === FALSE || !isset($result[0]['value'])) {
  error('Could not retrieve the site standard_domain from the database.');
}
else {
  $site_data = unserialize($result[0]['value']);
  $standard_domain = $site_data['standard_domain'];
  echo "{$standard_domain}";
}