From 15a99f31b3aae3f3b688f10683c6cb943663d5b1 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 9 Jun 2014 13:11:25 +0200 Subject: [PATCH] Remove legacy cache handling --- src/Composer/Factory.php | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index 5a4747b48..d65bc44a8 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -127,39 +127,6 @@ class Factory } $config->setAuthConfigSource(new JsonConfigSource($file, true)); - // move old cache dirs to the new locations - $legacyPaths = array( - 'cache-repo-dir' => array('/cache' => '/http*', '/cache.svn' => '/*', '/cache.github' => '/*'), - 'cache-vcs-dir' => array('/cache.git' => '/*', '/cache.hg' => '/*'), - 'cache-files-dir' => array('/cache.files' => '/*'), - ); - $fs = new Filesystem; - foreach ($legacyPaths as $key => $oldPaths) { - foreach ($oldPaths as $oldPath => $match) { - $dir = $config->get($key); - if ('/cache.github' === $oldPath) { - $dir .= '/github.com'; - } - $oldPath = $config->get('home').$oldPath; - $oldPathMatch = $oldPath . $match; - if (is_dir($oldPath) && $dir !== $oldPath) { - if (!is_dir($dir)) { - if (!@mkdir($dir, 0777, true)) { - continue; - } - } - if (is_array($children = $fs->realpathGlob($oldPathMatch))) { - foreach ($children as $child) { - @rename($child, $dir.'/'.basename($child)); - } - } - if ($config->get('cache-dir') != $oldPath) { - @rmdir($oldPath); - } - } - } - } - return $config; }