6 require_once __DIR__
."/../vendor/autoload.php";
9 fprintf(STDERR
, "Usage: cd ref-<ns> && %s <ns> <stub.php>\n", $argv[0]);
13 $namespace = $argv[1];
14 require_once $argv[2];
16 if (!file_exists("$namespace.mdref")) {
17 fprintf(STDERR
, "Missing $namespace.mdref; generated default.\n");
18 file_put_contents("$namespace.mdref", "./%s");
20 if (!file_exists("$namespace.md")) {
21 fprintf(STDERR
, "Missing $namespace.md; hard linking README.md\n");
22 link(dirname($argv[2]) . "/README.md", "$namespace.md");
25 $inspector = new Inspector
;
26 $inspector->inspectNamespace($namespace);
28 $generator = new Generator
;
29 $generator->generateFunctions($inspector->getFunctions());
30 $generator->generateClasses($inspector->getClasses());