Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EnvPlaceholderParameterBag.php

function EnvPlaceholderParameterBag::getEnvPlaceholderUniquePrefix

Gets the common env placeholder prefix for env vars created by this bag.

1 call to EnvPlaceholderParameterBag::getEnvPlaceholderUniquePrefix()
EnvPlaceholderParameterBag::get in vendor/symfony/dependency-injection/ParameterBag/EnvPlaceholderParameterBag.php
Gets a service container parameter.

File

vendor/symfony/dependency-injection/ParameterBag/EnvPlaceholderParameterBag.php, line 64

Class

EnvPlaceholderParameterBag
@author Nicolas Grekas <p@tchwork.com>

Namespace

Symfony\Component\DependencyInjection\ParameterBag

Code

public function getEnvPlaceholderUniquePrefix() : string {
    if (!isset($this->envPlaceholderUniquePrefix)) {
        $reproducibleEntropy = unserialize(serialize($this->parameters));
        array_walk_recursive($reproducibleEntropy, function (&$v) {
            $v = null;
        });
        $this->envPlaceholderUniquePrefix = 'env_' . substr(hash('xxh128', serialize($reproducibleEntropy)), -16);
    }
    return $this->envPlaceholderUniquePrefix;
}
RSS feed
Powered by Drupal