function drupal_generate_test_ua

cis7 bootstrap.inc drupal_generate_test_ua($prefix)
cle7 bootstrap.inc drupal_generate_test_ua($prefix)
elmsmedia7 bootstrap.inc drupal_generate_test_ua($prefix)
icor7 bootstrap.inc drupal_generate_test_ua($prefix)
meedjum_blog7 bootstrap.inc drupal_generate_test_ua($prefix)
mooc7 bootstrap.inc drupal_generate_test_ua($prefix)

Generates a user agent string with a HMAC and timestamp for simpletest.

2 calls to drupal_generate_test_ua()
DrupalWebTestCase::curlInitialize in modules/simpletest/drupal_web_test_case.php
Initializes the cURL connection.
drupal_http_request in includes/common.inc
Performs an HTTP request.

File

includes/bootstrap.inc, line 2546
Functions that need to be loaded on every Drupal request.

Code

function drupal_generate_test_ua($prefix) {
  static $key;

  if (!isset($key)) {
    // We use the salt from settings.php to make the HMAC key, since
    // the database is not yet initialized and we can't access any Drupal variables.
    // The file properties add more entropy not easily accessible to others.
    $key = drupal_get_hash_salt() . filectime(__FILE__) . fileinode(__FILE__);
  }
  // Generate a moderately secure HMAC based on the database credentials.
  $salt = uniqid('', TRUE);
  $check_string = $prefix . ';' . time() . ';' . $salt;
  return $check_string . ';' . drupal_hmac_base64($check_string, $key);
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.