ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
SafeStorage.php
Go to the documentation of this file.
1 <?php
2 
3 namespace League\Flysystem;
4 
5 final class SafeStorage
6 {
10  private $hash;
11 
15  protected static $safeStorage = [];
16 
17  public function __construct()
18  {
19  $this->hash = spl_object_hash($this);
20  static::$safeStorage[$this->hash] = [];
21  }
22 
23  public function storeSafely($key, $value)
24  {
25  static::$safeStorage[$this->hash][$key] = $value;
26  }
27 
28  public function retrieveSafely($key)
29  {
30  if (array_key_exists($key, static::$safeStorage[$this->hash])) {
31  return static::$safeStorage[$this->hash][$key];
32  }
33  }
34 
35  public function __destruct()
36  {
37  unset(static::$safeStorage[$this->hash]);
38  }
39 }
hash(StreamInterface $stream, $algo, $rawOutput=false)
Calculate a hash of a Stream.
Definition: functions.php:406
$key
Definition: croninfo.php:18