Skip to content

Commit

Permalink
Fix the version displayed in the PHAR (humbug#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry authored Jun 9, 2019
1 parent 621e97a commit e699999
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ function create_application(): Application

function get_php_scoper_version(): string
{
// Since PHP-Scoper relies on COMPOSER_ROOT_VERSION the version parsed by PackageVersions, we rely on Box
// placeholders in order to get the right version for the PHAR.
if (0 === strpos(__FILE__, 'phar:')) {
return '@git_version_placeholder@';
}

$rawVersion = Versions::getVersion('humbug/php-scoper');

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

0 comments on commit e699999

Please sign in to comment.