From: Michael Wallner Date: Fri, 15 May 2015 13:13:10 +0000 (+0200) Subject: use new metadata api X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=efea782d7086c58432477ce2847d2be1d8b25fa6;p=pharext%2Fpharext.org use new metadata api --- diff --git a/app/Controller/Github/Hook/Receive.php b/app/Controller/Github/Hook/Receive.php index c53878c..ec0d9fc 100644 --- a/app/Controller/Github/Hook/Receive.php +++ b/app/Controller/Github/Hook/Receive.php @@ -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 ", \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; } diff --git a/app/views/layout.phtml b/app/views/layout.phtml index 383ae22..6bf5eb4 100644 --- a/app/views/layout.phtml +++ b/app/views/layout.phtml @@ -46,10 +46,7 @@ © 2015 m6w6 <mike@php.net> — Powered by pharext - +