Browse Source

The ArchiveManager should return the written path for library usage

Nils Adermann 12 years ago
parent
commit
935f7271f8

+ 1 - 1
src/Composer/Package/Archiver/ArchiveManager.php

@@ -118,6 +118,6 @@ class ArchiveManager
 
         // Create the archive
         $sourceRef = $package->getSourceReference();
-        $usableArchiver->archive($sourcePath, $target, $format, $sourceRef, $package->getArchiveExcludes());
+        return $usableArchiver->archive($sourcePath, $target, $format, $sourceRef, $package->getArchiveExcludes());
     }
 }

+ 2 - 0
src/Composer/Package/Archiver/ArchiverInterface.php

@@ -29,6 +29,8 @@ interface ArchiverInterface
      * @param string $sourceRef The reference of the source to archive or null
      *                          for the current reference
      * @param array  $excludes  A list of patterns for files to exclude
+     *
+     * @return string The path to the written archive file
      */
     public function archive($sources, $target, $format, $sourceRef = null, $excludes = array());
 

+ 1 - 0
src/Composer/Package/Archiver/PharArchiver.php

@@ -60,6 +60,7 @@ class PharArchiver implements ArchiverInterface
                 })
                 ->ignoreVCS(true);
             $phar->buildFromIterator($finder->getIterator(), $sources);
+            return $target;
         } catch (\UnexpectedValueException $e) {
             $message = sprintf("Could not create archive '%s' from '%s': %s",
                 $target,