Skip to content
Snippets Groups Projects
Commit bcd3e33e authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Print output when run from cmdline..

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1389 44740490-163a-0410-bde0-09ae8108e29a
parent cd963db0
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,7 @@ foreach($argv as $a) { ...@@ -51,7 +51,7 @@ foreach($argv as $a) {
} }
} }
$aggregator = new sspmod_statistics_Aggregator(); $aggregator = new sspmod_statistics_Aggregator(TRUE);
$aggregator->dumpConfig(); $aggregator->dumpConfig();
$results = $aggregator->aggregate($debug); $results = $aggregator->aggregate($debug);
......
...@@ -12,11 +12,14 @@ class sspmod_statistics_Aggregator { ...@@ -12,11 +12,14 @@ class sspmod_statistics_Aggregator {
private $statrules; private $statrules;
private $offset; private $offset;
private $fromcmdline;
/** /**
* Constructor * Constructor
*/ */
public function __construct() { public function __construct($fromcmdline = FALSE) {
$this->fromcmdline = $fromcmdline;
$this->statconfig = SimpleSAML_Configuration::getConfig('module_statistics.php'); $this->statconfig = SimpleSAML_Configuration::getConfig('module_statistics.php');
$this->statdir = $this->statconfig->getValue('statdir'); $this->statdir = $this->statconfig->getValue('statdir');
...@@ -70,9 +73,9 @@ class sspmod_statistics_Aggregator { ...@@ -70,9 +73,9 @@ class sspmod_statistics_Aggregator {
$content = $logparser->parseContent($logline); $content = $logparser->parseContent($logline);
$action = trim($content[5]); $action = trim($content[5]);
if (($i % 10000) == 0) { if ($this->fromcmdline && ($i % 10000) == 0) {
echo("Read line " . $i . "\n"); echo("Read line " . $i . "\n");
} }
if ($debug) { if ($debug) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment