Created
April 28, 2016 15:18
-
-
Save geerlingguy/d127ca618e12de3639190d80054b2e5c to your computer and use it in GitHub Desktop.
Acquia Cloud Site Factory Environment Detection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Acquia Cloud Site Factory Environment detection examples. | |
*/ | |
// This may require the ACSF module to be installed. | |
// @see https://www.drupal.org/project/acsf | |
$site settings = [ | |
'site' => '', | |
'env' => '', | |
]; | |
if (!empty($GLOBALS['gardens_site_settings'])) { | |
$site_settings = $GLOBALS['gardens_site_settings']; | |
} | |
// $stage will print the current environment name. | |
require_once '/var/www/site-scripts/site-info.php'; | |
list($name, $group, $stage, $secret) = ah_site_info(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems like the code in 16-18 is preferred in terms of reliability and non-dependence on the ACSF connector module. Regardless, there are a couple ways you can get at environment config.