function acquia_spi_get_platform in Acquia Connector 7.3
Same name and namespace in other branches
- 6.2 acquia_spi/acquia_spi.module \acquia_spi_get_platform()
- 6 acquia_spi/acquia_spi.module \acquia_spi_get_platform()
- 7 acquia_spi/acquia_spi.module \acquia_spi_get_platform()
- 7.2 acquia_spi/acquia_spi.module \acquia_spi_get_platform()
Gather platform specific information.
Return value
array An associative array keyed by a platform information type.
2 calls to acquia_spi_get_platform()
- acquia_spi_boot in acquia_spi/
acquia_spi.module - Implements hook_boot().
- acquia_spi_get in acquia_spi/
acquia_spi.module - Gather site profile information about this site.
File
- acquia_spi/
acquia_spi.module, line 1484 - Send site profile information (NSPI) and system data to Acquia Insight.
Code
function acquia_spi_get_platform() {
$server = $_SERVER;
// Database detection depends on the structure starting with the database.
$db_class = 'DatabaseTasks_' . Database::getConnection()
->driver();
$db_tasks = new $db_class();
// Webserver detection is based on name being before the slash, and
// version being after the slash.
preg_match('!^([^/]+)(/.+)?$!', $server['SERVER_SOFTWARE'], $webserver);
if (isset($webserver[1]) && stristr($webserver[1], 'Apache') && function_exists('apache_get_version')) {
$webserver[2] = apache_get_version();
}
// Get some basic PHP vars.
$php_quantum = array(
'memory_limit' => ini_get('memory_limit'),
'register_globals' => 'Off',
'post_max_size' => ini_get('post_max_size'),
'max_execution_time' => ini_get('max_execution_time'),
'upload_max_filesize' => ini_get('upload_max_filesize'),
'error_log' => ini_get('error_log'),
'error_reporting' => ini_get('error_reporting'),
'display_errors' => ini_get('display_errors'),
'log_errors' => ini_get('log_errors'),
'session.cookie_domain' => ini_get('session.cookie_domain'),
'session.cookie_lifetime' => ini_get('session.cookie_lifetime'),
'newrelic.appname' => ini_get('newrelic.appname'),
'sapi' => php_sapi_name(),
);
$platform = array(
'php' => PHP_VERSION,
'webserver_type' => isset($webserver[1]) ? $webserver[1] : '',
'webserver_version' => isset($webserver[2]) ? $webserver[2] : '',
'php_extensions' => get_loaded_extensions(),
'php_quantum' => $php_quantum,
'database_type' => $db_tasks
->name(),
'database_version' => Database::getConnection()
->version(),
'system_type' => php_uname('s'),
// php_uname() only accepts one character, so need to concatenate ourselves.
'system_version' => php_uname('r') . ' ' . php_uname('v') . ' ' . php_uname('m') . ' ' . php_uname('n'),
);
// Never send NULL (or FALSE?) - that causes hmac errors.
foreach ($platform as $key => $value) {
if (empty($platform[$key])) {
$platform[$key] = '';
}
}
return $platform;
}