File: apigen

package info (click to toggle)
php-apigen 4.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 828 kB
  • ctags: 1,763
  • sloc: php: 7,026; makefile: 23; sh: 17
file content (40 lines) | stat: -rwxr-xr-x 1,207 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/php
<?php

require 'ApiGen/autoload.php';


// Create temp dir
$tempDir = sys_get_temp_dir() . '/_apigen';
ApiGen\FileSystem\FileSystem::purgeDir($tempDir);


// Init debugger
Tracy\Debugger::$strictMode = TRUE;
if (isset($_SERVER['argv']) && ($tmp = array_search('--debug', $_SERVER['argv'], TRUE))) {
	Tracy\Debugger::enable(Tracy\Debugger::DEVELOPMENT);

} else {
	Tracy\Debugger::enable(Tracy\Debugger::PRODUCTION);
	Tracy\Debugger::$onFatalError[] = function() use ($tempDir) {
		echo "For more information turn on the debug mode using the --debug option.\n";
		ApiGen\FileSystem\FileSystem::deleteDir($tempDir);
	};
}


$configurator = new Nette\Configurator;
$configurator->setDebugMode( ! Tracy\Debugger::$productionMode);
$configurator->setTempDirectory($tempDir);
$configurator->addConfig(__DIR__ . '/../share/php/ApiGen/DI/config.neon');
$configurator->addParameters(['rootDir' => __DIR__ . '/../share/php/data/ApiGen']);
$container = $configurator->createContainer();


/** @var ApiGen\Console\Application $application */
$application = $container->getByType('ApiGen\Console\Application');
$application->run();


// Remove temp data
ApiGen\FileSystem\FileSystem::deleteDir($tempDir);