Last active
July 8, 2016 13:11
-
-
Save mickaelperrin/2654acec92d7b34abdadabef75f50613 to your computer and use it in GitHub Desktop.
Patch for composer to use temporary folder when extracting packages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Composer/Downloader/ArchiveDownloader.php b/src/Composer/Downloader/ArchiveDownloader.php | |
index abe1b68..dac64cd 100644 | |
--- a/src/Composer/Downloader/ArchiveDownloader.php | |
+++ b/src/Composer/Downloader/ArchiveDownloader.php | |
@@ -30,7 +30,7 @@ | |
*/ | |
public function download(PackageInterface $package, $path) | |
{ | |
- $temporaryDir = $this->config->get('vendor-dir').'/composer/'.substr(md5(uniqid('', true)), 0, 8); | |
+ $temporaryDir = $this->config->get('vendor-dir').'/composer/.tmp/'.substr(md5(uniqid('', true)), 0, 8); | |
$retries = 3; | |
while ($retries--) { | |
$fileName = parent::download($package, $path); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Setup the Composer installer with a patch to exclude temp files / folders to be sync with lsyncd | |
COPY ./composer.patch /tmp | |
RUN php -r "readfile('https://getcomposer.org/installer');" > /tmp/composer-setup.php \ | |
&& php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer --snapshot && rm -rf /tmp/composer-setup.php \ | |
&& git clone https://github.com/composer/composer.git /tmp/composer \ | |
&& cd /tmp/composer \ | |
&& composer install \ | |
&& mv /tmp/composer.patch /tmp/composer \ | |
&& cd /tmp/composer \ | |
&& patch -p1 < /tmp/composer/composer.patch \ | |
&& php -d phar.readonly=false /tmp/composer/bin/compile \ | |
&& mv composer.phar /usr/local/bin/composer \ | |
&& chmod +x /usr/local/bin/composer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment