use new metadata api
authorMichael Wallner <mike@php.net>
Fri, 15 May 2015 13:13:10 +0000 (15:13 +0200)
committerMichael Wallner <mike@php.net>
Fri, 15 May 2015 13:13:10 +0000 (15:13 +0200)
app/Controller/Github/Hook/Receive.php
app/views/layout.phtml

index c53878c614123c602cad9aad19140821a03831f6..ec0d9fc35e24d82575acedc4b4116f021d9f1f13 100644 (file)
@@ -8,10 +8,9 @@ use app\Model\Accounts;
 use app\Web;
 use http\Params;
 use pharext\Task;
+use pharext\Metadata;
 use pharext\SourceDir;
 
-require_once __DIR__."/../../../../vendor/m6w6/pharext/src/pharext/Version.php";
-
 class Receive implements Controller
 {
        private $app;
@@ -93,19 +92,16 @@ class Receive implements Controller
        }
        
        private function createReleaseAsset($release, $repo) {
-               $source = (new Task\GitClone($repo->clone_url, $release->tag_name))->run();
-               $iterator = new SourceDir\Git($source);
-               $meta = [
-                       "header" => sprintf("pharext v%s (c) Michael Wallner <mike@php.net>", \pharext\VERSION),
-                       "version" => \pharext\VERSION,
-                       "date" => date("Y-m-d"),
+               $dir = (new Task\GitClone($repo->clone_url, $release->tag_name))->run();
+               $src = new SourceDir\Git($dir);
+               $meta = Metadata::all() + [
                        "name" => $repo->name,
                        "release" => $release->tag_name,
-                       "license" => @file_get_contents(current(glob($iterator->getBaseDir()."/LICENSE*"))),
+                       "license" => $src->getLicense(),
                        "stub" => "pharext_installer.php",
                        "type" => false ? "zend_extension" : "extension",
                ];
-               $file = (new Task\PharBuild($iterator, $meta))->run();
+               $file = (new Task\PharBuild($src, $meta))->run();
                return $file;
        }
        
index 383ae220022e3964618e040c57c86986a62b6f62..6bf5eb497b3ccd602d8653e67eccf411b5a3c113 100644 (file)
                                        &copy; 2015 <abbr title="Michael Wallner">m6w6</abbr> 
                                        <addr>&lt;mike&#x40;php&#x2e;net&gt;</addr>
                                        &mdash; Powered by <a href="//github.com/m6w6/pharext">pharext
-                                       <?php
-                                       include_once __DIR__."/../../vendor/m6w6/pharext/src/pharext/Version.php";
-                                       echo pharext\VERSION;
-                                       ?>
+                                       <?= \pharext\Metadata::version() ?>
                                        </a>
                                </p>
                        </div>