ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SimpleSAML_Stats Class Reference
+ Collaboration diagram for SimpleSAML_Stats:

Static Public Member Functions

static log ($event, array $data=array())
 Notify about an event. More...
 

Static Private Member Functions

static createOutput (SimpleSAML_Configuration $config)
 Create an output from a configuration object. More...
 
static initOutputs ()
 Initialize the outputs. More...
 

Static Private Attributes

static $initialized = false
 
static $outputs = null
 

Detailed Description

Definition at line 11 of file Stats.php.

Member Function Documentation

◆ createOutput()

static SimpleSAML_Stats::createOutput ( SimpleSAML_Configuration  $config)
staticprivate

Create an output from a configuration object.

Parameters
SimpleSAML_Configuration$configThe configuration object.
Returns
mixed A new instance of the configured class.

Definition at line 37 of file Stats.php.

38 {
39 $cls = $config->getString('class');
40 $cls = SimpleSAML\Module::resolveClass($cls, 'Stats_Output', 'SimpleSAML_Stats_Output');
41
42 $output = new $cls($config);
43 return $output;
44 }
static resolveClass($id, $type, $subclass=null)
Resolve module class.
Definition: Module.php:169
$config
Definition: bootstrap.php:15

References $config, Sabre\VObject\$output, and SimpleSAML\Module\resolveClass().

Referenced by initOutputs().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initOutputs()

static SimpleSAML_Stats::initOutputs ( )
staticprivate

Initialize the outputs.

Definition at line 50 of file Stats.php.

51 {
52
54 $outputCfgs = $config->getConfigList('statistics.out', array());
55
56 self::$outputs = array();
57 foreach ($outputCfgs as $cfg) {
58 self::$outputs[] = self::createOutput($cfg);
59 }
60 }
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
static createOutput(SimpleSAML_Configuration $config)
Create an output from a configuration object.
Definition: Stats.php:37
catch(Exception $e) if(isset( $_POST[ 'cancel'])) if(isset($_POST['continue'])) $cfg

References $cfg, $config, createOutput(), and SimpleSAML_Configuration\getInstance().

Referenced by log().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ log()

static SimpleSAML_Stats::log (   $event,
array  $data = array() 
)
static

Notify about an event.

Parameters
string$eventThe event.
array$dataEvent data. Optional.
Returns
void|boolean False if output is not enabled, void otherwise.

Definition at line 71 of file Stats.php.

72 {
73 assert(is_string($event));
74 assert(!isset($data['op']));
75 assert(!isset($data['time']));
76 assert(!isset($data['_id']));
77
78 if (!self::$initialized) {
80 self::$initialized = true;
81 }
82
83 if (empty(self::$outputs)) {
84 // not enabled
85 return;
86 }
87
88 $data['op'] = $event;
89 $data['time'] = microtime(true);
90
91 // the ID generation is designed to cluster IDs related in time close together
92 $int_t = (int) $data['time'];
93 $hd = openssl_random_pseudo_bytes(16);
94 $data['_id'] = sprintf('%016x%s', $int_t, bin2hex($hd));
95
96 foreach (self::$outputs as $out) {
97 $out->emit($data);
98 }
99 }
static initOutputs()
Initialize the outputs.
Definition: Stats.php:50
$data
Definition: bench.php:6

References $data, $out, and initOutputs().

Referenced by sspmod_saml_IdP_SAML2\handleAuthError(), sspmod_consent_Auth_Process_Consent\process(), sspmod_saml_IdP_SAML1\receiveAuthnRequest(), sspmod_saml_IdP_SAML2\receiveAuthnRequest(), sspmod_saml_IdP_SAML2\receiveLogoutMessage(), sspmod_saml_IdP_SAML2\sendLogoutRequest(), sspmod_saml_IdP_SAML2\sendLogoutResponse(), sspmod_saml_IdP_SAML1\sendResponse(), and sspmod_saml_IdP_SAML2\sendResponse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $initialized

SimpleSAML_Stats::$initialized = false
staticprivate

Definition at line 19 of file Stats.php.

◆ $outputs

SimpleSAML_Stats::$outputs = null
staticprivate

Definition at line 27 of file Stats.php.


The documentation for this class was generated from the following file: