From: Michael Wallner Date: Thu, 3 Sep 2015 11:24:48 +0000 (+0200) Subject: update pharext metadata X-Git-Tag: v4.1.0~5 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=1362aa73f36bfe77f4395d7904f1bf2c264533f8;p=pharext%2Fpharext update pharext metadata --- diff --git a/src/pharext/Updater.php b/src/pharext/Updater.php index d4ba5b8..f7972a1 100644 --- a/src/pharext/Updater.php +++ b/src/pharext/Updater.php @@ -4,8 +4,8 @@ namespace pharext; use Phar; use PharFileInfo; -use RecursiveIteratorIterator; use SplFileInfo; +use pharext\Exception; class Updater implements Command { @@ -101,6 +101,8 @@ class Updater implements Command $phar = new Phar($temp, Phar::CURRENT_AS_SELF); $phar->startBuffering(); + $meta = $phar->getMetadata(); + // replace current pharext files $core = (new Task\BundleGenerator)->run($this->verbosity()); $phar->buildFromIterator($core); @@ -120,6 +122,10 @@ class Updater implements Command "version" => Metadata::version(), "header" => Metadata::header(), ] + $phar->getMetadata()); + + $this->info("Updated pharext version from '%s' to '%s'\n", + isset($meta["version"]) ? $meta["version"] : "(unknown)", + $phar->getMetadata()["version"]); } private function updatePackage(SplFileInfo $file, Phar $phar = null) {