Skip to content

Commit e699999

Browse files
authored
Fix the version displayed in the PHAR (#339)
1 parent 621e97a commit e699999

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/functions.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ function create_application(): Application
3636

3737
function get_php_scoper_version(): string
3838
{
39+
// Since PHP-Scoper relies on COMPOSER_ROOT_VERSION the version parsed by PackageVersions, we rely on Box
40+
// placeholders in order to get the right version for the PHAR.
41+
if (0 === strpos(__FILE__, 'phar:')) {
42+
return '@git_version_placeholder@';
43+
}
44+
3945
$rawVersion = Versions::getVersion('humbug/php-scoper');
4046

4147
[$prettyVersion, $commitHash] = explode('@', $rawVersion);

0 commit comments

Comments
 (0)