From b4e5db1c7055ede2952cb8f77f03cc9aafe00f09 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 7 Jun 2019 17:24:34 +0200 Subject: [PATCH] Revert "Allow overriding self-update target file with envvar COMPOSER_SELF_UPDATE_TARGET" Revert "Add docs for COMPOSER_SELF_UPDATE_TARGET, refs #8151" This reverts commit e7eecc6901698ea352bff11ccabe5a1b6a6122c6. This reverts commit faa7c5eea2de7e053f38c0726c01147531687361. --- doc/03-cli.md | 4 ---- src/Composer/Command/SelfUpdateCommand.php | 4 ---- 2 files changed, 8 deletions(-) diff --git a/doc/03-cli.md b/doc/03-cli.md index 5fc527c49..6460e9e1d 100644 --- a/doc/03-cli.md +++ b/doc/03-cli.md @@ -917,10 +917,6 @@ if you use Composer as super user at all times like in docker containers. If set, the value is used as php's memory_limit. -### COMPOSER_SELF_UPDATE_TARGET - -If set, makes the self-update command write the new Composer phar file into that path instead of overwriting itself. Useful for updating Composer on read-only filesystem. - ### COMPOSER_MIRROR_PATH_REPOS If set to 1, this env changes the default path repository strategy to `mirror` instead diff --git a/src/Composer/Command/SelfUpdateCommand.php b/src/Composer/Command/SelfUpdateCommand.php index 226aafeb5..78b27460e 100644 --- a/src/Composer/Command/SelfUpdateCommand.php +++ b/src/Composer/Command/SelfUpdateCommand.php @@ -351,10 +351,6 @@ TAGSPUBKEY @copy($localFilename, $backupTarget); } - if ($targetFilename = getenv('COMPOSER_SELF_UPDATE_TARGET')) { - $localFilename = realpath($targetFilename) ?: $targetFilename; - } - rename($newFilename, $localFilename); return null;