ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
StreamAccess.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 
33 {
34  public const PHP_MEMORY = 'php://memory';
36 
37  public function __construct(
38  string $storage_base_path,
39  StorageHandlerFactory $storage_handler_factory
40  ) {
41  $this->storage_handler_factory = $storage_handler_factory;
42  }
43 
44  public function populateRevision(Revision $revision): Revision
45  {
46  $stream = $this->storage_handler_factory->getHandlerForRevision($revision)->getStream($revision);
47 
48  return $revision->withStreamResolver(new StreamResolver($stream));
49  }
50 
51  public function populateFlavour(
52  Flavour $flavour,
53  FileStream $file_stream,
54  int $index
55  ): Flavour {
56  return $flavour->withStreamResolver(
57  $index,
58  new StreamResolver($file_stream)
59  );
60  }
61 }
withStreamResolver(int $index, ?StreamResolver $stream_resolver=null)
Definition: Flavour.php:66
withStreamResolver(?StreamResolver $stream_resolver=null)
populateFlavour(Flavour $flavour, FileStream $file_stream, int $index)
__construct(string $storage_base_path, StorageHandlerFactory $storage_handler_factory)
The base interface for all filesystem streams.
Definition: FileStream.php:31