Example #1
0
    // GitHub URL
    $url = "https://github.com/" . $name . "/archive/master.zip";
} else {
    if (strcmp($repo, 'gc') == 0) {
        // Google Code URL
        $url = "https://code.google.com/p/" . $name;
    }
}
// Create Downloader instance
$myDownloader = new Downloader($repo, $url, $dir, $name);
if (strcmp($myDownloader->getProjectRepo(), 'gh') == 0) {
    // Download project from Github & unzip
    $myDownloader->downloadProjectGithub();
} else {
    if (strcmp($myDownloader->getProjectRepo(), 'gc') == 0) {
        // Download project from Google Code using hg command
        $myDownloader->downloadProjectGoogleCode();
    } else {
        echo "** ERROR: Repo must be gh for Github or gc for Google Code\n";
    }
}
// Umplify project
$myUmplificator = new Umplificator($myDownloader->getDestinationDir() . $myDownloader->getProjectName());
$myUmplificator->umplifyProject($umplificationLevel);
// Run Code Analyzer
$myCodeAnalyzer = new CodeAnalyzer($myDownloader->getDestinationDir() . $myDownloader->getProjectName());
$myCodeAnalyzer->getStats();
// Build graph
$myGrapher = new Grapher($myDownloader->getDestinationDir() . $myDownloader->getProjectName() . "/src-umple/");
$myGrapher->run();
$myGrapher->generateGraph();
Example #2
0
$options = getopt($shortopts);
$config_file = isset($options['c']) ? $options['c'] : 'default.conf';
$config = json_decode(file_get_contents(__DIR__ . '/../conf/' . $config_file), true);
if (!$config) {
    print "Requires config file to run\n";
    exit(-1);
}
if (!$config['server']) {
    print "Requires server option to run";
    exit(-1);
}
if (!$config['logging_ns']) {
    print "Requires logging ns option to run";
    exit(-1);
}
if (!$config['pending_dir']) {
    print "Requires pending dir option to run\n";
    exit;
}
$results_helper = new ResultsHelper($config['pending_dir']);
$runs = $results_helper->getRuns();
$client = new WebpagetestClient($config);
$results = $client->getResults($runs);
$logging_ns = $config['logging_ns'];
$splunkLogger = new SplunkLogger($config['splunkLog'], $logging_ns);
foreach ($results as $result) {
    $splunkLogger->log($result);
}
$graphite = $config['graphite'];
$grapher = new Grapher($graphite, $logging_ns);
$grapher->graphResults($results);