Menu

[r311]: / trunk / runFromWeb.php  Maximize  Restore  History

Download this file

50 lines (37 with data), 1.2 kB

 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
41
42
43
44
45
46
47
48
49
50
<?php
define("PHPCHECKSTYLE_HOME_DIR", dirname(__FILE__));
require_once "vendor/autoload.php";
// default values
$options['format'] = "array"; // default format
// Get user selection
$sourceDir = $_POST['sourceDir'];
$resultDir = $_POST['resultDir'];
$configFile = $_POST['configFile'];
$lange = $_POST['lang'];
if ($_POST['excludeFile']!="") {
$expFile = explode(',', $_POST['excludeFile']);
$options['exclude'] = $expFile;
}
else {
$options['exclude'] = array();
}
//
$formats = explode(',', $options['format']);
$sources = explode(',', $sourceDir);
// @TODO: Make this an includeable file
$configFile = array(
'indentation' => array(
"type" => "spaces",
"number" => 2
)
);
// Launch PHPCheckstyle
$style = new PHPCheckstyle\PHPCheckstyle($formats, $resultDir, $configFile, null, false, true);
if (file_exists(__DIR__ . '/src/PHPCheckstyle/Lang/' . $options['lang'] . '.ini')) {
$style->setLang($options['lang']);
}
$style->processFiles($sources, $options['exclude']);
echo "<pre>".print_r($style->_reporter->reporters[0]->outputFile, TRUE)."</pre>";
echo "Reporting Completed.</BR></BR>";
echo 'Display Results : <a href="'.$resultDir.'">'.$resultDir.'</a>';
?>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.