bug #25978 Deterministic proxy names (lstrojny)

This PR was merged into the 3.4 branch.

Discussion
----------

Deterministic proxy names

Proxy class names should be deterministic and independent of spl_object_hash() which is somewhat random to better support reproducible builds. See #25958

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

b173b81f46 Proxy class names should be deterministic and independent of spl_object_hash() which is somewhat random
This commit is contained in:
Fabien Potencier 2018-01-31 12:32:49 +01:00
commit 5f770d77e8

View File

@ -108,7 +108,7 @@ EOF;
*/
private function getProxyClassName(Definition $definition)
{
return preg_replace('/^.*\\\\/', '', $definition->getClass()).'_'.substr(hash('sha256', spl_object_hash($definition).$this->salt), -7);
return preg_replace('/^.*\\\\/', '', $definition->getClass()).'_'.substr(hash('sha256', $definition->getClass().$this->salt), -7);
}
/**