-$package = new \Phar($tmpname, 0, "pharext.phar");
-$package->buildFromDirectory(dirname(__DIR__)."/src", "/^.*\.php$/");
-$package->setDefaultStub("pharext_packager.php");
-$package->setStub("#!/usr/bin/php -dphar.readonly=0\n".$package->getStub());
-unset($package);
+$file = (new pharext\Task\PharBuild(null, [
+ "header" => sprintf("pharext v%s (c) Michael Wallner <mike@php.net>", pharext\VERSION),
+ "version" => pharext\VERSION,
+ "name" => "pharext",
+ "date" => date("Y-m-d"),
+ "stub" => "pharext_packager.php",
+ "license" => file_get_contents(__DIR__."/../LICENSE")
+], false))->run();