Skip to content

Commit 350f35b

Browse files
committed
Make kernel build time optionally deterministic
1 parent 450789d commit 350f35b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Dumper/PhpDumper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ public function dump(array $options = array())
119119
'debug' => true,
120120
'hot_path_tag' => 'container.hot_path',
121121
'inline_class_loader_parameter' => 'container.dumper.inline_class_loader',
122+
'build_time' => time(),
122123
), $options);
123124

124125
$this->namespace = $options['namespace'];
@@ -216,7 +217,7 @@ public function dump(array $options = array())
216217
array_pop($code);
217218
$code["Container{$hash}/{$options['class']}.php"] = substr_replace($files[$options['class'].'.php'], "<?php\n\nnamespace Container{$hash};\n", 0, 6);
218219
$namespaceLine = $this->namespace ? "\nnamespace {$this->namespace};\n" : '';
219-
$time = time();
220+
$time = $options['build_time'];
220221
$id = hash('crc32', $hash.$time);
221222

222223
$code[$options['class'].'.php'] = <<<EOF

0 commit comments

Comments
 (0)