support for running .ext.phars without ext/phar
[pharext/pharext] / src / pharext / Packager.php
index cd3b4d660fdd62e70bec8e3459946a41c684b34f..10542e489a74611366a2033e9e0600e8afad71fa 100644 (file)
@@ -157,7 +157,7 @@ class Packager implements Command
                                        );
                                        if ($bytes_pct == 1) {
                                                $done = true;
-                                               printf("\n");
+                                               $this->info("\n");
                                        }
                                }
                        });
@@ -243,20 +243,13 @@ class Packager implements Command
         */
        private function createPackage() {
                try {
-                       if (($glob = glob($this->source->getBaseDir()."/LICENSE*"))) {
-                               $license = file_get_contents(current($glob));
-                       } else {
-                               $this->warn("Could not find any LICENSE.* files!\n");
-                               $license = "UNKNOWN\n";
-                       }
                        $meta = array_merge(Metadata::all(), [
                                "name" => $this->args->name,
                                "release" => $this->args->release,
-                               "license" => $license,
-                               "stub" => "pharext_installer.php",
+                               "license" => $this->source->getLicense(),
                                "type" => $this->args->zend ? "zend_extension" : "extension",
                        ]);
-                       $file = (new Task\PharBuild($this->source, $meta))->run($this->verbosity());
+                       $file = (new Task\PharBuild($this->source, __DIR__."/../pharext_installer.php", $meta))->run($this->verbosity());
                } catch (\Exception $e) {
                        $this->error("%s\n", $e->getMessage());
                        exit(self::EBUILD);