private function generateFiles()
{
/* hook */
$temp = tmpfile();
fprintf($temp, "<?php\nreturn new %s(__DIR__);\n", get_class($this));
rewind($temp);
(yield "pharext_package.php" => $temp);
/* deps */
$dependencies = $this->sxe->xpath("/pecl:package/pecl:dependencies/pecl:required/pecl:package");
foreach ($dependencies as $key => $dep) {
if ($glob = glob("{$this->path}/{$dep->name}-*.ext.phar*")) {
usort($glob, function ($a, $b) {
return version_compare(substr($a, strpos(".ext.phar", $a)), substr($b, strpos(".ext.phar", $b)));
});
(yield end($glob));
}
}
/* files */
(yield realpath($this->file));
foreach ($this->sxe->xpath("//pecl:file") as $file) {
(yield realpath($this->path . "/" . $this->dirOf($file) . "/" . $file["name"]));
}
}