17 function __construct($git_url, $tag_name, $pkg_name, $options) {
18 $dir = (new Task\
GitClone($git_url, $tag_name))->run();
19 $src = !empty($options["pecl"])
20 ?
new SourceDir\
Pecl($dir)
21 : new SourceDir\
Git($dir);
24 $this->release
= $tag_name;
25 $this->name
= $pkg_name;
26 $this->zend
= !empty($options["zend"]);
28 /* override with package info from SourceDir */
29 foreach ($src->getPackageInfo() as $key => $val) {
43 $meta = Metadata
::all() +
[
44 "name" => $this->name
,
45 "release" => $this->release
,
46 "license" => $this->source
->getLicense(),
47 "type" => $this->zend ?
"zend_extension" : "extension",
49 /* needed for the packager, so the pharstub task can find includes */
50 set_include_path(__DIR__
."/../../vendor/m6w6/pharext/src:".get_include_path());
51 $stub = __DIR__
."/../../vendor/m6w6/pharext/src/pharext_installer.php";
52 $this->file
= (new Task\
PharBuild($this->source
, $stub, $meta))->run();
54 return sprintf("%s-%s.ext.phar", $this->name
, $this->release
);
57 function __toString() {
58 return (string) $this->file
;
69 function getRelease() {
70 return $this->release
;