Only replace version in Composer.php, fix user agent
parent
4e4fc257e6
commit
78edca3ad6
|
@ -126,7 +126,7 @@ class Compiler
|
||||||
|
|
||||||
private function addFile($phar, $file, $strip = true)
|
private function addFile($phar, $file, $strip = true)
|
||||||
{
|
{
|
||||||
$path = str_replace(dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR, '', $file->getRealPath());
|
$path = strtr(str_replace(dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR, '', $file->getRealPath()), '\\', '/');
|
||||||
|
|
||||||
$content = file_get_contents($file);
|
$content = file_get_contents($file);
|
||||||
if ($strip) {
|
if ($strip) {
|
||||||
|
@ -135,8 +135,10 @@ class Compiler
|
||||||
$content = "\n".$content."\n";
|
$content = "\n".$content."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$content = str_replace('@package_version@', $this->version, $content);
|
if ($path === 'src/Composer/Composer.php') {
|
||||||
$content = str_replace('@release_date@', $this->versionDate, $content);
|
$content = str_replace('@package_version@', $this->version, $content);
|
||||||
|
$content = str_replace('@release_date@', $this->versionDate, $content);
|
||||||
|
}
|
||||||
|
|
||||||
$phar->addFromString($path, $content);
|
$phar->addFromString($path, $content);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue