-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreport-converter
executable file
·36 lines (29 loc) · 1 KB
/
report-converter
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
#!/usr/bin/env php
<?php
/**
* This file is part of the Sarif-PHP-Converters package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Laurent Laville
* @since Release 1.0.0
*/
gc_disable(); // performance boost
require_once __DIR__ . '/autoload.php';
if ($argc > 2 && 'convert' === $argv[1] && strpos($argv[2], '-h') === false) {
$source = strtolower($argv[2]);
$loaders = [
implode(DIRECTORY_SEPARATOR, [__DIR__, 'vendor-bin', $source, 'vendor', 'autoload.php'])
];
if ('ecs' === $source) {
$loaders[] = implode(DIRECTORY_SEPARATOR, [__DIR__, 'vendor-bin', 'phpcs', 'vendor', 'autoload.php']);
$loaders[] = implode(DIRECTORY_SEPARATOR, [__DIR__, 'vendor-bin', 'phpcs-fixer', 'vendor', 'autoload.php']);
}
foreach ($loaders as $loader) {
if (file_exists($loader)) {
require_once $loader;
}
}
}
require_once __DIR__ . '/report-converter.php';