1: <?php
2: 3: 4: 5: 6:
7:
8: namespace Peg\Custom\Command;
9:
10: use Peg\Custom\CommandLine\Option;
11: use Peg\Custom\CommandLine\OptionType;
12:
13: 14: 15:
16: class Generate extends \Peg\Custom\CommandLine\Command
17: {
18:
19: public function __construct()
20: {
21: parent::__construct("generate");
22:
23: $this->description = t("Generates the extension source code and configuration files.");
24:
25: $this->RegisterAction(new \Peg\Custom\Command\Action\Generate\ZendPHP);
26:
27: $format = new Option(array(
28: "long_name" => "format",
29: "short_name" => "f",
30: "type" => OptionType::STRING,
31: "required" => false,
32: "description" => t("Format of cached definition files. Default: json")
33: . "\n" . t("Allowed values:") . " json, php",
34: "default_value" => "json"
35: ));
36:
37: $this->AddOption($format);
38:
39: $engine = new Option(array(
40: "long_name" => "engine",
41: "short_name" => "e",
42: "type" => OptionType::STRING,
43: "required" => false,
44: "description" => t("The php engine to generate source code for. Default: zendphp")
45: . "\n" . t("Allowed values:") . " zendphp",
46: "default_value" => "zendphp"
47: ));
48:
49: $this->AddOption($engine);
50:
51: $verbose = new Option(array(
52: "long_name" => "verbose",
53: "short_name" => "v",
54: "type" => OptionType::FLAG,
55: "required" => false,
56: "description" => t("Turns verbosity on."),
57: "default_value" => "",
58: ));
59:
60: $this->AddOption($verbose);
61: }
62:
63: }