Permalink
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (33 sloc) 928 Bytes
#!/usr/bin/env php
<?php
if ($_SERVER['SCRIPT_NAME'] != '-') {
$phar = realpath($_SERVER['SCRIPT_NAME']);
} else {
$files = get_included_files();
$phar = $files[0];
}
define('__PHPLOC_PHAR__', str_replace(DIRECTORY_SEPARATOR, '/', $phar));
define('__PHPLOC_PHAR_ROOT__', 'phar://___PHAR___');
spl_autoload_register(
function ($class)
{
static $classes = NULL;
if ($classes === NULL) {
$classes = array(
___CLASSLIST___
);
}
$class = strtolower($class);
if (isset($classes[$class])) {
require 'phar://___PHAR___' . $classes[$class];
}
}
);
Phar::mapPhar('___PHAR___');
if (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == '--manifest') {
print file_get_contents(__PHPLOC_PHAR_ROOT__ . '/manifest.txt');
exit;
}
$application = new SebastianBergmann\PHPLOC\CLI\Application;
$application->run();
__HALT_COMPILER();