From 3d0ce85db2d2198bbfca0ef535121dd43c992aff Mon Sep 17 00:00:00 2001 From: Matthieu Moquet Date: Mon, 27 Aug 2012 09:33:04 +0200 Subject: [PATCH] Moved archive Dumpers into its own Archiver package --- .../ArchiverInterface.php} | 6 +++--- .../BaseDumper.php => Archiver/BaseArchiver.php} | 4 ++-- .../{Dumper/TarDumper.php => Archiver/TarArchiver.php} | 8 ++++---- .../{Dumper/ZipDumper.php => Archiver/ZipArchiver.php} | 8 ++++---- .../DumperTest.php => Archiver/ArchiverTest.php} | 8 ++++---- .../TarDumperTest.php => Archiver/TarArchiverTest.php} | 10 +++++----- .../ZipDumperTest.php => Archiver/ZipArchiverTest.php} | 10 +++++----- 7 files changed, 27 insertions(+), 27 deletions(-) rename src/Composer/Package/{Dumper/DumperInterface.php => Archiver/ArchiverInterface.php} (80%) rename src/Composer/Package/{Dumper/BaseDumper.php => Archiver/BaseArchiver.php} (97%) rename src/Composer/Package/{Dumper/TarDumper.php => Archiver/TarArchiver.php} (90%) rename src/Composer/Package/{Dumper/ZipDumper.php => Archiver/ZipArchiver.php} (89%) rename tests/Composer/Test/Package/{Dumper/DumperTest.php => Archiver/ArchiverTest.php} (88%) rename tests/Composer/Test/Package/{Dumper/TarDumperTest.php => Archiver/TarArchiverTest.php} (78%) rename tests/Composer/Test/Package/{Dumper/ZipDumperTest.php => Archiver/ZipArchiverTest.php} (78%) diff --git a/src/Composer/Package/Dumper/DumperInterface.php b/src/Composer/Package/Archiver/ArchiverInterface.php similarity index 80% rename from src/Composer/Package/Dumper/DumperInterface.php rename to src/Composer/Package/Archiver/ArchiverInterface.php index 03a0aa5f9..20566140a 100644 --- a/src/Composer/Package/Dumper/DumperInterface.php +++ b/src/Composer/Package/Archiver/ArchiverInterface.php @@ -8,18 +8,18 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ -namespace Composer\Package\Dumper; +namespace Composer\Package\Archiver; use Composer\Package\PackageInterface; /** * @author Till Klampaeckel */ -interface DumperInterface +interface ArchiverInterface { /** * Return value depends on implementation - e.g. generating a tar or zip the - * method currently returns void, the ArrayDumper returns an array. + * method currently returns void, the ArrayArchiver returns an array. * * @param PackageInterface $package * diff --git a/src/Composer/Package/Dumper/BaseDumper.php b/src/Composer/Package/Archiver/BaseArchiver.php similarity index 97% rename from src/Composer/Package/Dumper/BaseDumper.php rename to src/Composer/Package/Archiver/BaseArchiver.php index 093e5a3f9..7d9c26d80 100644 --- a/src/Composer/Package/Dumper/BaseDumper.php +++ b/src/Composer/Package/Archiver/BaseArchiver.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Composer\Package\Dumper; +namespace Composer\Package\Archiver; use Composer\Package\PackageInterface; use Composer\Util\ProcessExecutor; @@ -22,7 +22,7 @@ use Composer\Factory; /** * @author Till Klampaeckel */ -abstract class BaseDumper implements DumperInterface +abstract class BaseArchiver implements ArchiverInterface { /** * Format: zip or tar. diff --git a/src/Composer/Package/Dumper/TarDumper.php b/src/Composer/Package/Archiver/TarArchiver.php similarity index 90% rename from src/Composer/Package/Dumper/TarDumper.php rename to src/Composer/Package/Archiver/TarArchiver.php index 4de76c7ab..72b134e8e 100644 --- a/src/Composer/Package/Dumper/TarDumper.php +++ b/src/Composer/Package/Archiver/TarArchiver.php @@ -9,17 +9,17 @@ * file that was distributed with this source code. */ -namespace Composer\Package\Dumper; +namespace Composer\Package\Archiver; -use Composer\Package\Dumper\BaseDumper; -use Composer\Package\Dumper\DumperInterface; +use Composer\Package\Archiver\BaseArchiver; +use Composer\Package\Archiver\ArchiverInterface; use Composer\Package\PackageInterface; use Composer\Util\ProcessExecutor; /** * @author Ulf Härnhammar */ -class TarDumper extends BaseDumper +class TarArchiver extends BaseArchiver { protected $format = 'tar'; diff --git a/src/Composer/Package/Dumper/ZipDumper.php b/src/Composer/Package/Archiver/ZipArchiver.php similarity index 89% rename from src/Composer/Package/Dumper/ZipDumper.php rename to src/Composer/Package/Archiver/ZipArchiver.php index 6ab55839d..9a6dcf7d3 100644 --- a/src/Composer/Package/Dumper/ZipDumper.php +++ b/src/Composer/Package/Archiver/ZipArchiver.php @@ -9,17 +9,17 @@ * file that was distributed with this source code. */ -namespace Composer\Package\Dumper; +namespace Composer\Package\Archiver; -use Composer\Package\Dumper\BaseDumper; -use Composer\Package\Dumper\DumperInterface; +use Composer\Package\Archiver\BaseArchiver; +use Composer\Package\Archiver\ArchiverInterface; use Composer\Package\PackageInterface; use Composer\Util\ProcessExecutor; /** * @author Till Klampaeckel */ -class ZipDumper extends BaseDumper +class ZipArchiver extends BaseArchiver { protected $format = 'zip'; diff --git a/tests/Composer/Test/Package/Dumper/DumperTest.php b/tests/Composer/Test/Package/Archiver/ArchiverTest.php similarity index 88% rename from tests/Composer/Test/Package/Dumper/DumperTest.php rename to tests/Composer/Test/Package/Archiver/ArchiverTest.php index 6db54ea69..e8f64cc86 100644 --- a/tests/Composer/Test/Package/Dumper/DumperTest.php +++ b/tests/Composer/Test/Package/Archiver/ArchiverTest.php @@ -9,13 +9,13 @@ * file that was distributed with this source code. */ -namespace Composer\Test\Package\Dumper; +namespace Composer\Test\Package\Archiver; use Composer\Package\MemoryPackage; use Composer\Util\Filesystem; use Composer\Util\ProcessExecutor; -abstract class DumperTest extends \PHPUnit_Framework_TestCase +abstract class ArchiverTest extends \PHPUnit_Framework_TestCase { /** * @var \Composer\Util\Filesystem @@ -36,7 +36,7 @@ abstract class DumperTest extends \PHPUnit_Framework_TestCase { $this->fs = new Filesystem; $this->process = new ProcessExecutor; - $this->testdir = sys_get_temp_dir() . '/composer_dumpertest_git_repository' . mt_rand(); + $this->testdir = sys_get_temp_dir() . '/composer_archivertest_git_repository' . mt_rand(); } protected function getTestDir() @@ -83,7 +83,7 @@ abstract class DumperTest extends \PHPUnit_Framework_TestCase protected function setupPackage() { $td = $this->getTestDir(); - $package = new MemoryPackage('dumpertest/dumpertest', 'master', 'master'); + $package = new MemoryPackage('archivertest/archivertest', 'master', 'master'); $package->setSourceUrl("file://$td"); $package->setSourceReference('master'); $package->setSourceType('git'); diff --git a/tests/Composer/Test/Package/Dumper/TarDumperTest.php b/tests/Composer/Test/Package/Archiver/TarArchiverTest.php similarity index 78% rename from tests/Composer/Test/Package/Dumper/TarDumperTest.php rename to tests/Composer/Test/Package/Archiver/TarArchiverTest.php index cd9917732..23cd09e64 100644 --- a/tests/Composer/Test/Package/Dumper/TarDumperTest.php +++ b/tests/Composer/Test/Package/Archiver/TarArchiverTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Composer\Test\Package\Dumper; +namespace Composer\Test\Package\Archiver; -use Composer\Package\Dumper\TarDumper; +use Composer\Package\Archiver\TarArchiver; -class TarDumperTest extends DumperTest +class TarArchiverTest extends ArchiverTest { public function testThis() { @@ -22,7 +22,7 @@ class TarDumperTest extends DumperTest $name = $this->getPackageFileName($package); $temp = sys_get_temp_dir(); - $tar = new TarDumper($temp); + $tar = new TarArchiver($temp); $tar->dump($package); $dist = sprintf('%s/%s.tar', @@ -38,6 +38,6 @@ class TarDumperTest extends DumperTest */ public function testException() { - new TarDumper("/totally-random-" . time()); + new TarArchiver("/totally-random-" . time()); } } diff --git a/tests/Composer/Test/Package/Dumper/ZipDumperTest.php b/tests/Composer/Test/Package/Archiver/ZipArchiverTest.php similarity index 78% rename from tests/Composer/Test/Package/Dumper/ZipDumperTest.php rename to tests/Composer/Test/Package/Archiver/ZipArchiverTest.php index 2fe71eb69..5d2fa40af 100644 --- a/tests/Composer/Test/Package/Dumper/ZipDumperTest.php +++ b/tests/Composer/Test/Package/Archiver/ZipArchiverTest.php @@ -9,11 +9,11 @@ * file that was distributed with this source code. */ -namespace Composer\Test\Package\Dumper; +namespace Composer\Test\Package\Archiver; -use Composer\Package\Dumper\ZipDumper; +use Composer\Package\Archiver\ZipArchiver; -class ZipDumperTest extends DumperTest +class ZipArchiverTest extends ArchiverTest { public function testThis() { @@ -22,7 +22,7 @@ class ZipDumperTest extends DumperTest $name = $this->getPackageFileName($package); $temp = sys_get_temp_dir(); - $zip = new ZipDumper($temp); + $zip = new ZipArchiver($temp); $zip->dump($package); $dist = sprintf('%s/%s.zip', @@ -38,6 +38,6 @@ class ZipDumperTest extends DumperTest */ public function testException() { - new ZipDumper("/totally-random-" . time()); + new ZipArchiver("/totally-random-" . time()); } }