You are here

public static function Settings::getHashSalt in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Site/Settings.php \Drupal\Core\Site\Settings::getHashSalt()

Gets a salt useful for hardening against SQL injection.

Return value

string A salt based on information in settings.php, not in the database.

Throws

\RuntimeException

12 calls to Settings::getHashSalt()
CsrfTokenGenerator::computeToken in core/lib/Drupal/Core/Access/CsrfTokenGenerator.php
Generates a token based on $value, the token seed, and the private key.
DrupalKernelTest::setUp in core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php
Performs setup tasks before each individual test method is run.
EntityAutocomplete::processEntityAutocomplete in core/lib/Drupal/Core/Entity/Element/EntityAutocomplete.php
Adds entity autocomplete functionality to a form element.
EntityAutocompleteController::handleAutocomplete in core/modules/system/src/Controller/EntityAutocompleteController.php
Autocomplete the label of an entity.
EntityAutocompleteTest::getAutocompleteResult in core/modules/system/src/Tests/Entity/EntityAutocompleteTest.php
Returns the result of an Entity reference autocomplete request.

... See full list

File

core/lib/Drupal/Core/Site/Settings.php, line 139
Contains \Drupal\Core\Site\Settings.

Class

Settings
Read only settings that are initialized with the class.

Namespace

Drupal\Core\Site

Code

public static function getHashSalt() {
  $hash_salt = self::$instance
    ->get('hash_salt');

  // This should never happen, as it breaks user logins and many other
  // services. Therefore, explicitly notify the user (developer) by throwing
  // an exception.
  if (empty($hash_salt)) {
    throw new \RuntimeException('Missing $settings[\'hash_salt\'] in settings.php.');
  }
  return $hash_salt;
}