do not exit on compression failure
authorMichael Wallner <mike@php.net>
Thu, 5 Mar 2015 08:12:26 +0000 (09:12 +0100)
committerMichael Wallner <mike@php.net>
Thu, 5 Mar 2015 08:12:26 +0000 (09:12 +0100)
bin/pharext
src/pharext/Packager.php

index aa352e6dbfe579226d5fb4fdd002a19603d28cd6..1d0ed19cfaa22712c9e73d3f8071c7730db041ed 100755 (executable)
Binary files a/bin/pharext and b/bin/pharext differ
index 4379bb6ee093c78ed63bfa19776ffbf0e49707ba..a848e2d39ce672fc5a0ff67dfb652376d526c2e8 100644 (file)
@@ -158,13 +158,21 @@ class Packager implements Command
                        }
                        if ($this->args->gzip) {
                                $this->info("Compressing with gzip ... ");
-                               $package->compress(Phar::GZ);
-                               $this->info("OK\n");
+                               try {
+                                       $package->compress(Phar::GZ);
+                                       $this->info("OK\n");
+                               } catch (\Exception $e) {
+                                       $this->error("%s\n", $e->getMessage());
+                               }
                        }
                        if ($this->args->bzip) {
                                $this->info("Compressing with bzip ... ");
-                               $package->compress(Phar::BZ2);
-                               $this->info("OK\n");
+                               try {
+                                       $package->compress(Phar::BZ2);
+                                       $this->info("OK\n");
+                               } catch (\Exception $e) {
+                                       $this->error("%s\n", $e->getMessage());
+                               }
                        }
                        
                        unset($package);