Definition at line 8 of file StatDataset.php.
◆ __construct()
sspmod_statistics_StatDataset::__construct |
( |
|
$statconfig, |
|
|
|
$ruleconfig, |
|
|
|
$ruleid, |
|
|
|
$timeres, |
|
|
|
$fileslot |
|
) |
| |
◆ aggregateSummary()
sspmod_statistics_StatDataset::aggregateSummary |
( |
| ) |
|
Definition at line 111 of file StatDataset.php.
References $key, $res, and array.
114 $this->summary =
array();
115 foreach ($this->results as $slot =>
$res) {
117 if (array_key_exists(
$key, $this->summary)) {
118 $this->summary[
$key] += $value;
120 $this->summary[
$key] = $value;
124 asort($this->summary);
125 $this->summary = array_reverse($this->summary,
true);
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
◆ availDelimiters()
sspmod_statistics_StatDataset::availDelimiters |
( |
| ) |
|
◆ calculateMax()
sspmod_statistics_StatDataset::calculateMax |
( |
| ) |
|
◆ getAxis()
sspmod_statistics_StatDataset::getAxis |
( |
| ) |
|
Definition at line 183 of file StatDataset.php.
References $axis, $i, $res, and array.
185 $slotsize = $this->timeresconfig->getValue(
'slot');
186 $dateformat_period = $this->timeresconfig->getValue(
'dateformat-period');
187 $dateformat_intra = $this->timeresconfig->getValue(
'dateformat-intra');
188 $axislabelint = $this->timeresconfig->getValue(
'axislabelint');
192 $xentries = count($this->results);
196 foreach ($this->results as $slot =>
$res) {
198 if ($slot % $axislabelint == 0) {
199 $axis[] = $this->datehandlerTick->prettyDateSlot($slot, $slotsize, $dateformat_intra);
200 $axispos[] = ((
$i) / ($xentries - 1));
206 $axis[] = $this->datehandlerTick->prettyDateSlot($lastslot + 1, $slotsize, $dateformat_intra);
208 return array(
'axis' =>
$axis,
'axispos' => $axispos);
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
◆ getDebugData()
sspmod_statistics_StatDataset::getDebugData |
( |
| ) |
|
Definition at line 95 of file StatDataset.php.
References $delimiter, $res, and array.
99 $slotsize = $this->timeresconfig->getValue(
'slot');
100 $dateformat_intra = $this->timeresconfig->getValue(
'dateformat-intra');
102 foreach ($this->results as $slot => &
$res) {
103 $debugdata[$slot] =
array(
104 $this->datehandlerTick->prettyDateSlot($slot, $slotsize, $dateformat_intra),
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
◆ getDelimiter()
sspmod_statistics_StatDataset::getDelimiter |
( |
| ) |
|
◆ getDelimiterPresentation()
sspmod_statistics_StatDataset::getDelimiterPresentation |
( |
| ) |
|
Definition at line 234 of file StatDataset.php.
References $config, $t, array, availDelimiters(), SimpleSAML_Configuration\getInstance(), and SimpleSAML\Module\resolveClass().
Referenced by getDelimiterPresentationPie().
242 if ($this->ruleconfig->hasValue(
'fieldPresentation')) {
243 $fieldpresConfig = $this->ruleconfig->getConfigItem(
'fieldPresentation');
245 $fieldpresConfig->getValue(
'class'),
246 'Statistics_FieldPresentation' 248 if (!class_exists($classname)) {
249 throw new Exception(
'Could not find field presentation plugin ['.$classname.
']: No class found');
251 $presentationHandler =
new $classname($availdelimiters, $fieldpresConfig->getValue(
'config'),
$t);
253 return $presentationHandler->getPresentation();
Create styles array
The data for the language used.
static resolveClass($id, $type, $subclass=null)
Resolve module class.
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
◆ getDelimiterPresentationPie()
sspmod_statistics_StatDataset::getDelimiterPresentationPie |
( |
| ) |
|
Definition at line 259 of file StatDataset.php.
References $key, array, getDelimiterPresentation(), and getTopDelimiters().
265 foreach ($topdelimiters as
$key) {
267 if (array_key_exists($key, $delimiterPresentation)) {
268 $keyName = $delimiterPresentation[
$key];
270 $pieaxis[] = $keyName;
272 $pieaxis[] =
'Others';
Create styles array
The data for the language used.
getDelimiterPresentation()
◆ getFileSlot()
sspmod_statistics_StatDataset::getFileSlot |
( |
| ) |
|
◆ getMax()
sspmod_statistics_StatDataset::getMax |
( |
| ) |
|
◆ getPercentValues()
sspmod_statistics_StatDataset::getPercentValues |
( |
| ) |
|
Definition at line 214 of file StatDataset.php.
References $dataset, $i, $res, and array.
218 foreach ($this->results as $slot =>
$res) {
219 if (array_key_exists($this->delimiter,
$res)) {
220 if (
$res[$this->delimiter] === null) {
223 $dataset[] = number_format(100 *
$res[$this->delimiter] / $this->max, 2);
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
◆ getPieData()
sspmod_statistics_StatDataset::getPieData |
( |
| ) |
|
Definition at line 154 of file StatDataset.php.
References $piedata, array, and getTopDelimiters().
160 foreach ($topdelimiters as $td) {
161 $sum += $this->summary[$td];
162 $piedata[] = number_format(100 * $this->summary[$td] / $this->summary[
'_'], 2);
164 $piedata[] = number_format(100 - 100 * ($sum / $this->summary[
'_']), 2);
Create styles array
The data for the language used.
◆ getResults()
sspmod_statistics_StatDataset::getResults |
( |
| ) |
|
◆ getSummary()
sspmod_statistics_StatDataset::getSummary |
( |
| ) |
|
◆ getTimeRes()
sspmod_statistics_StatDataset::getTimeRes |
( |
| ) |
|
◆ getTopDelimiters()
sspmod_statistics_StatDataset::getTopDelimiters |
( |
| ) |
|
◆ loadData()
sspmod_statistics_StatDataset::loadData |
( |
| ) |
|
Definition at line 276 of file StatDataset.php.
References $i, $rule, array, and SimpleSAML\Utils\Arrays\arrayize().
Referenced by __construct().
278 $statdir = $this->statconfig->getValue(
'statdir');
281 foreach ($rules as
$rule) {
283 $resultFileName = $statdir.
'/'.$rule.
'-'.$this->timeres.
'-'.$this->fileslot.
'.stat';
284 if (!file_exists($resultFileName)) {
285 throw new Exception(
'Aggregated statitics file ['.$resultFileName.
'] not found.');
287 if (!is_readable($resultFileName)) {
288 throw new Exception(
'Could not read statitics file ['.$resultFileName.
']. Bad file permissions?');
290 $resultfile = file_get_contents($resultFileName);
291 $newres = unserialize($resultfile);
292 if (empty($newres)) {
293 throw new Exception(
'Aggregated statistics in file ['.$resultFileName.
'] was empty.');
295 $resarray[] = $newres;
298 $combined = $resarray[0];
299 $count = count($resarray);
301 for (
$i = 1;
$i < $count;
$i++) {
302 $combined = $this->combine($combined, $resarray[
$i]);
305 $this->results = $combined;
static arrayize($data, $index=0)
Put a non-array variable into an array.
Create styles array
The data for the language used.
◆ setDelimiter()
sspmod_statistics_StatDataset::setDelimiter |
( |
|
$delimiter = '_' | ) |
|
◆ $datehandlerFile
sspmod_statistics_StatDataset::$datehandlerFile |
|
protected |
◆ $datehandlerTick
sspmod_statistics_StatDataset::$datehandlerTick |
|
protected |
◆ $delimiter
sspmod_statistics_StatDataset::$delimiter |
|
protected |
◆ $fileslot
sspmod_statistics_StatDataset::$fileslot |
|
protected |
◆ $max
sspmod_statistics_StatDataset::$max |
|
protected |
◆ $results
sspmod_statistics_StatDataset::$results |
|
protected |
◆ $ruleconfig
sspmod_statistics_StatDataset::$ruleconfig |
|
protected |
◆ $ruleid
sspmod_statistics_StatDataset::$ruleid |
|
protected |
◆ $statconfig
sspmod_statistics_StatDataset::$statconfig |
|
protected |
◆ $summary
sspmod_statistics_StatDataset::$summary |
|
protected |
◆ $timeres
sspmod_statistics_StatDataset::$timeres |
|
protected |
◆ $timeresconfig
sspmod_statistics_StatDataset::$timeresconfig |
|
protected |
The documentation for this class was generated from the following file:
- libs/composer/vendor/simplesamlphp/simplesamlphp/modules/statistics/lib/StatDataset.php