back to dev
[pharext/pharext] / build / pharext.php
1 <?php
2
3 /**
4 * Creates bin/pharext, invoked through the Makefile
5 */
6
7 set_include_path(dirname(__DIR__)."/src:".get_include_path());
8 spl_autoload_register(function($c) {
9 return include strtr($c, "\\_", "//") . ".php";
10 });
11
12 $file = (new pharext\Task\PharBuild(null, __DIR__."/../src/pharext_packager.php", pharext\Metadata::all() + [
13 "name" => "pharext",
14 "license" => file_get_contents(__DIR__."/../LICENSE")
15 ], false))->run();
16
17 if (getenv("SIGN")) {
18 $pass = (new pharext\Task\Askpass)->run();
19 $sign = new pharext\Task\PharSign($file, __DIR__."/pharext.key", $pass);
20 $pkey = $sign->run();
21 $pkey->exportPublicKey(__DIR__."/../bin/pharext.pubkey");
22 }
23
24 /* we do not need the extra logic of Task\PharRename */
25 rename($file, __DIR__."/../bin/pharext");