ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Setup\Metrics\ArrayStorage Class Reference
+ Inheritance diagram for ILIAS\Setup\Metrics\ArrayStorage:
+ Collaboration diagram for ILIAS\Setup\Metrics\ArrayStorage:

Public Member Functions

 __construct ()
 
 store (string $key, Metric $metric)
 
 get ()
 
 asMetric ()
 
- Public Member Functions inherited from ILIAS\Setup\Metrics\Storage
 storeConfigBool (string $key, bool $value, string $description=null)
 
 storeConfigCounter (string $key, int $value, string $description=null)
 
 storeConfigGauge (string $key, $value, string $description=null)
 
 storeConfigTimestamp (string $key, \DateTimeImmutable $value, string $description=null)
 
 storeConfigText (string $key, string $value, string $description=null)
 
 storeStableBool (string $key, bool $value, string $description=null)
 
 storeStableCounter (string $key, int $value, string $description=null)
 
 storeStableGauge (string $key, $value, string $description=null)
 
 storeStableTimestamp (string $key, \DateTimeImmutable $value, string $description=null)
 
 storeStableText (string $key, string $value, string $description=null)
 
 storeVolatileBool (string $key, bool $value, string $description=null)
 
 storeVolatileCounter (string $key, int $value, string $description=null)
 
 storeVolatileGauge (string $key, $value, string $description=null)
 
 storeVolatileTimestamp (string $key, \DateTimeImmutable $value, string $description=null)
 
 storeVolatileText (string $key, string $value, string $description=null)
 

Protected Member Functions

 doStore (array $base, array $path, $metric)
 Recursive implementation of storing. More...
 
 doAsMetric (array $cur)
 

Protected Attributes

array $metrics
 

Detailed Description

Definition at line 23 of file ArrayStorage.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Setup\Metrics\ArrayStorage::__construct ( )

Definition at line 32 of file ArrayStorage.php.

33  {
34  $this->metrics = [];
35  }

Member Function Documentation

◆ asMetric()

ILIAS\Setup\Metrics\ArrayStorage::asMetric ( )

Definition at line 66 of file ArrayStorage.php.

References ILIAS\Setup\Metrics\ArrayStorage\doAsMetric().

66  : Metric
67  {
68  return $this->doAsMetric($this->metrics);
69  }
+ Here is the call graph for this function:

◆ doAsMetric()

ILIAS\Setup\Metrics\ArrayStorage::doAsMetric ( array  $cur)
protected

Definition at line 71 of file ArrayStorage.php.

References ILIAS\Setup\Metrics\Metric\STABILITY_MIXED, and ILIAS\Setup\Metrics\Metric\TYPE_COLLECTION.

Referenced by ILIAS\Setup\Metrics\ArrayStorage\asMetric().

71  : Metric
72  {
73  return new Metric(
76  array_map(
77  function ($v) {
78  if (is_array($v)) {
79  return $this->doAsMetric($v);
80  }
81  return $v;
82  },
83  $cur
84  )
85  );
86  }
+ Here is the caller graph for this function:

◆ doStore()

ILIAS\Setup\Metrics\ArrayStorage::doStore ( array  $base,
array  $path,
  $metric 
)
protected

Recursive implementation of storing.

Definition at line 49 of file ArrayStorage.php.

References $base, and ILIAS\LTI\ToolProvider\$key.

Referenced by ILIAS\Setup\Metrics\ArrayStorage\store().

49  : array
50  {
51  $key = array_shift($path);
52  if (count($path) == 0) {
53  $base[$key] = $metric;
54  return $base;
55  }
56 
57  $base[$key] = $this->doStore($base[$key] ?? [], $path, $metric);
58  return $base;
59  }
doStore(array $base, array $path, $metric)
Recursive implementation of storing.
$path
Definition: ltiservices.php:32
string $key
Consumer key/client ID value.
Definition: System.php:193
$base
Definition: index.php:4
+ Here is the caller graph for this function:

◆ get()

ILIAS\Setup\Metrics\ArrayStorage::get ( )

Definition at line 61 of file ArrayStorage.php.

References ILIAS\Setup\Metrics\ArrayStorage\$metrics.

61  : array
62  {
63  return $this->metrics;
64  }

◆ store()

ILIAS\Setup\Metrics\ArrayStorage::store ( string  $key,
Metric  $metric 
)

Implements ILIAS\Setup\Metrics\Storage.

Definition at line 40 of file ArrayStorage.php.

References $path, and ILIAS\Setup\Metrics\ArrayStorage\doStore().

40  : void
41  {
42  $path = explode(".", $key);
43  $this->metrics = $this->doStore($this->metrics, $path, $metric);
44  }
doStore(array $base, array $path, $metric)
Recursive implementation of storing.
$path
Definition: ltiservices.php:32
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

Field Documentation

◆ $metrics

array ILIAS\Setup\Metrics\ArrayStorage::$metrics
protected

Definition at line 30 of file ArrayStorage.php.

Referenced by ILIAS\Setup\Metrics\ArrayStorage\get().


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