Implement packager and installer hooks
[pharext/pharext] / src / pharext_install.tpl.php
1 <?='<?php'?>
2
3 /**
4 * Generated by pharext v<?=pharext\VERSION?> at <?=date("Y-m-d H:i:i T")?>.
5 */
6 namespace pharext;
7
8 return function(Installer $installer) {
9 $args = $installer->getArgs();
10 <?php foreach ($configure as $cfg) : ?>
11
12 $args->compile([[
13 null,
14 "<?=$cfg["name"]?>",
15 "<?=ucfirst($cfg["prompt"])?>",
16 CliArgs::OPTARG,
17 <?php if (strlen($cfg["default"])) : ?>
18 "<?=$cfg["default"]?>"
19 <?php else : ?>
20 NULL
21 <?php endif; ?>
22
23 ]]);
24 <?php endforeach; ?>
25
26 return function(Installer $installer) {
27 $args = $installer->getArgs();
28 <?php foreach ($configure as $cfg) : ?>
29
30 if (isset($args["<?=$cfg["name"]?>"])) {
31 $args->configure = "--<?=$cfg["name"]?>=".$args["<?=$cfg["name"]?>"];
32 }
33 <?php endforeach; ?>
34
35 };
36 };