mirror of
https://github.com/FriendsOfTYPO3/tea.git
synced 2024-11-27 00:56:13 +01:00
2502 lines
69 KiB
Text
2502 lines
69 KiB
Text
|
#!/usr/bin/env php
|
|||
|
<?php declare(strict_types=1);
|
|||
|
if (version_compare('7.3.0', PHP_VERSION, '>')) {
|
|||
|
fwrite(
|
|||
|
STDERR,
|
|||
|
sprintf(
|
|||
|
'This version of PHPCPD requires PHP 7.3 (or later).' . PHP_EOL .
|
|||
|
'You are using PHP %s%s.' . PHP_EOL,
|
|||
|
PHP_VERSION,
|
|||
|
defined('PHP_BINARY') ? ' (' . PHP_BINARY . ')' : ''
|
|||
|
)
|
|||
|
);
|
|||
|
|
|||
|
die(1);
|
|||
|
}
|
|||
|
|
|||
|
if ($_SERVER['SCRIPT_NAME'] != '-') {
|
|||
|
$phar = realpath($_SERVER['SCRIPT_NAME']);
|
|||
|
} else {
|
|||
|
$files = get_included_files();
|
|||
|
$phar = $files[0];
|
|||
|
}
|
|||
|
|
|||
|
define('__PHPCPD_PHAR__', str_replace(DIRECTORY_SEPARATOR, '/', $phar));
|
|||
|
define('__PHPCPD_PHAR_ROOT__', 'phar://phpcpd-6.0.3.phar');
|
|||
|
|
|||
|
spl_autoload_register(
|
|||
|
function ($class)
|
|||
|
{
|
|||
|
static $classes = NULL;
|
|||
|
|
|||
|
if ($classes === NULL) {
|
|||
|
$classes = array(
|
|||
|
'sebastianbergmann\\cliparser\\ambiguousoptionexception' => '/sebastian-cli-parser/exceptions/AmbiguousOptionException.php',
|
|||
|
'sebastianbergmann\\cliparser\\exception' => '/sebastian-cli-parser/exceptions/Exception.php',
|
|||
|
'sebastianbergmann\\cliparser\\optiondoesnotallowargumentexception' => '/sebastian-cli-parser/exceptions/OptionDoesNotAllowArgumentException.php',
|
|||
|
'sebastianbergmann\\cliparser\\parser' => '/sebastian-cli-parser/Parser.php',
|
|||
|
'sebastianbergmann\\cliparser\\requiredoptionargumentmissingexception' => '/sebastian-cli-parser/exceptions/RequiredOptionArgumentMissingException.php',
|
|||
|
'sebastianbergmann\\cliparser\\unknownoptionexception' => '/sebastian-cli-parser/exceptions/UnknownOptionException.php',
|
|||
|
'sebastianbergmann\\fileiterator\\facade' => '/phpunit-php-file-iterator/Facade.php',
|
|||
|
'sebastianbergmann\\fileiterator\\factory' => '/phpunit-php-file-iterator/Factory.php',
|
|||
|
'sebastianbergmann\\fileiterator\\iterator' => '/phpunit-php-file-iterator/Iterator.php',
|
|||
|
'sebastianbergmann\\phpcpd\\application' => '/src/CLI/Application.php',
|
|||
|
'sebastianbergmann\\phpcpd\\arguments' => '/src/CLI/Arguments.php',
|
|||
|
'sebastianbergmann\\phpcpd\\argumentsbuilder' => '/src/CLI/ArgumentsBuilder.php',
|
|||
|
'sebastianbergmann\\phpcpd\\argumentsbuilderexception' => '/src/Exceptions/ArgumentsBuilderException.php',
|
|||
|
'sebastianbergmann\\phpcpd\\codeclone' => '/src/CodeClone.php',
|
|||
|
'sebastianbergmann\\phpcpd\\codeclonefile' => '/src/CodeCloneFile.php',
|
|||
|
'sebastianbergmann\\phpcpd\\codeclonemap' => '/src/CodeCloneMap.php',
|
|||
|
'sebastianbergmann\\phpcpd\\codeclonemapiterator' => '/src/CodeCloneMapIterator.php',
|
|||
|
'sebastianbergmann\\phpcpd\\detector\\detector' => '/src/Detector/Detector.php',
|
|||
|
'sebastianbergmann\\phpcpd\\detector\\strategy\\abstractstrategy' => '/src/Detector/Strategy/AbstractStrategy.php',
|
|||
|
'sebastianbergmann\\phpcpd\\detector\\strategy\\defaultstrategy' => '/src/Detector/Strategy/DefaultStrategy.php',
|
|||
|
'sebastianbergmann\\phpcpd\\exception' => '/src/Exceptions/Exception.php',
|
|||
|
'sebastianbergmann\\phpcpd\\log\\abstractxmllogger' => '/src/Log/AbstractXmlLogger.php',
|
|||
|
'sebastianbergmann\\phpcpd\\log\\pmd' => '/src/Log/PMD.php',
|
|||
|
'sebastianbergmann\\phpcpd\\log\\text' => '/src/Log/Text.php',
|
|||
|
'sebastianbergmann\\timer\\duration' => '/phpunit-php-timer/Duration.php',
|
|||
|
'sebastianbergmann\\timer\\exception' => '/phpunit-php-timer/exceptions/Exception.php',
|
|||
|
'sebastianbergmann\\timer\\noactivetimerexception' => '/phpunit-php-timer/exceptions/NoActiveTimerException.php',
|
|||
|
'sebastianbergmann\\timer\\resourceusageformatter' => '/phpunit-php-timer/ResourceUsageFormatter.php',
|
|||
|
'sebastianbergmann\\timer\\timer' => '/phpunit-php-timer/Timer.php',
|
|||
|
'sebastianbergmann\\timer\\timesincestartofrequestnotavailableexception' => '/phpunit-php-timer/exceptions/TimeSinceStartOfRequestNotAvailableException.php',
|
|||
|
'sebastianbergmann\\version' => '/sebastian-version/Version.php'
|
|||
|
);
|
|||
|
}
|
|||
|
|
|||
|
$class = strtolower($class);
|
|||
|
|
|||
|
if (isset($classes[$class])) {
|
|||
|
require 'phar://phpcpd-6.0.3.phar' . $classes[$class];
|
|||
|
}
|
|||
|
}
|
|||
|
);
|
|||
|
|
|||
|
Phar::mapPhar('phpcpd-6.0.3.phar');
|
|||
|
|
|||
|
if (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == '--manifest') {
|
|||
|
print file_get_contents(__PHPCPD_PHAR_ROOT__ . '/manifest.txt');
|
|||
|
exit;
|
|||
|
}
|
|||
|
|
|||
|
exit((new \SebastianBergmann\PHPCPD\Application)->run($_SERVER['argv']));
|
|||
|
|
|||
|
__HALT_COMPILER(); ?>
|
|||
|
|