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.

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

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  }
getString($name, $default=self::REQUIRED_OPTION)
This function retrieves a string configuration option.
static resolveClass($id, $type, $subclass=null)
Resolve module class.
Definition: Module.php:169
+ Here is the call graph for this function:

◆ initOutputs()

static SimpleSAML_Stats::initOutputs ( )
staticprivate

Initialize the outputs.

Definition at line 50 of file Stats.php.

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

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  }
$config
Definition: bootstrap.php:15
catch(Exception $e) if(isset($_POST['cancel'])) if(isset($_POST['continue'])) $cfg
static getInstance($instancename='simplesaml')
Get a configuration file by its instance name.
+ Here is the call 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.

References $data, and $out.

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().

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) {
79  self::initOutputs();
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  }
$data
Definition: bench.php:6
+ 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: