ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\Filesystem\Stream\Streams Class Reference

Class Streams. More...

+ Collaboration diagram for ILIAS\Filesystem\Stream\Streams:

Public Member Functions

 ofZipResource (\ZipArchive $zip, int $index)
 

Static Public Member Functions

static ofString (string $string)
 Creates a new stream with an initial value. More...
 
static ofResource ($resource)
 Wraps an already created resource with the stream abstraction. More...
 
static ofPsr7Stream (StreamInterface $stream)
 Create a FileStream from a Psr7 compliant stream. More...
 

Detailed Description

Class Streams.

Stream factory which enables the user to create streams without the knowledge of the concrete class.

Author
Nicolas Schäfli ns@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Since
5.3
Version
1.1.0

Definition at line 33 of file Streams.php.

Member Function Documentation

◆ ofPsr7Stream()

static ILIAS\Filesystem\Stream\Streams::ofPsr7Stream ( StreamInterface  $stream)
static

Create a FileStream from a Psr7 compliant stream.

Please not that the stream must be detached from the psr7 stream in order to create the filesystem stream.

Parameters
StreamInterface$streamThe stream which should be parsed into a FileStream.
Returns
FileStream The newly created stream.

Definition at line 82 of file Streams.php.

References ILIAS\Filesystem\Stream\Stream\detach().

Referenced by ILIAS\FileUpload\FileUploadImpl\moveFilesTo(), ILIAS\FileUpload\FileUploadImpl\moveOneFileTo(), and ILIAS\FileUpload\FileUploadImpl\process().

83  {
84  $resource = $stream->detach();
85  return self::ofResource($resource);
86  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ofResource()

static ILIAS\Filesystem\Stream\Streams::ofResource (   $resource)
static

Wraps an already created resource with the stream abstraction.

The stream abstraction only supports streams which are opened with fopen.

Parameters
resource$resourceThe resource which should be wrapped.
Returns
FileStream The newly created stream which wraps the given resource.
See also
fopen()

Definition at line 65 of file Streams.php.

Referenced by ILIAS\ResourceStorage\Resource\ResourceBuilder\extractStream(), ILIAS\ResourceStorage\Consumer\StreamAccess\StreamInfoFactory\fromAccessKey(), ilDclFileuploadRecordFieldModel\parseValue(), ilStudyProgrammeType\processAndStoreIconFile(), ILIAS\Filesystem\Provider\FlySystem\FlySystemFileStreamAccess\readStream(), ILIAS\ResourceStorage\Consumer\DownloadMultipleConsumer\run(), ILIAS\ResourceStorage\Flavours\AccessTokenTest\testRealStream(), and ILIAS\ResourceStorage\Flavours\AccessTokenTest\testStreamAccessInfoOutsideDirectory().

66  {
67  if (!is_resource($resource)) {
68  throw new \InvalidArgumentException('The argument $resource must be of type resource but was "' . gettype($resource) . '"');
69  }
70 
71  return new Stream($resource);
72  }
+ Here is the caller graph for this function:

◆ ofString()

static ILIAS\Filesystem\Stream\Streams::ofString ( string  $string)
static

Creates a new stream with an initial value.

Please note that the whole stream is stored within memory.

Parameters
string$stringThe string which should be written as initial value.
Returns
FileStream The newly created in memory stream.

Definition at line 43 of file Streams.php.

Referenced by ilPropertyFormGUI\checkInput(), ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\executeCommand(), ilECSSettingsGUI\exportImported(), ilECSSettingsGUI\exportReleased(), ILIAS\ResourceStorage\AbstractBaseTest\getDummyStream(), ilChatroomAuthInputGUI\getRandomValues(), ILIAS\GlobalScreen\Client\Notifications\handleRerender(), ilDataCollectionGlobalTemplate\printToStdout(), ILIAS\COPage\Editor\Server\Response\send(), ILIAS\Export\PrintProcessGUI\send(), ILIAS\FileUpload\Processor\SVGPreProcessorTest\testMaliciousSVG(), ILIAS\ResourceStorage\Flavours\AccessTokenTest\testMemoryStream(), ILIAS\FileUpload\Processor\WhitelistExtensionPreProcessorTest\testProcessWhichShouldSucceed(), ILIAS\FileUpload\Processor\WhitelistFileHeaderPreProcessorTest\testProcessWhichShouldSucceed(), ILIAS\FileUpload\Processor\BlacklistFileHeaderPreProcessorTest\testProcessWhichShouldSucceed(), ILIAS\FileUpload\Processor\FilenameOverridePreProcessorTest\testProcessWhichShouldSucceed(), ILIAS\FileUpload\Processor\BlacklistExtensionPreProcessorTest\testProcessWhichShouldSucceed(), ILIAS\FileUpload\FileUploadImplTest\testProcessWhichShouldSucceed(), ILIAS\FileUpload\Processor\BlacklistExtensionPreProcessorTest\testProcessWithBlacklistedEmptyExtensionWhichShouldGetRejected(), ILIAS\FileUpload\Processor\BlacklistExtensionPreProcessorTest\testProcessWithBlacklistedExtensionWhichShouldGetRejected(), ILIAS\FileUpload\FileUploadImplTest\testProcessWithFailedUploadWhichShouldGetRejected(), ILIAS\FileUpload\Processor\WhitelistFileHeaderPreProcessorTest\testProcessWithHeaderMismatchWhichShouldGetRejected(), ILIAS\FileUpload\Processor\BlacklistFileHeaderPreProcessorTest\testProcessWithHeaderMismatchWhichShouldGetRejected(), ILIAS\FileUpload\Processor\WhitelistExtensionPreProcessorTest\testProcessWithoutExtensionWhichShouldSucceed(), ILIAS\FileUpload\Processor\WhitelistExtensionPreProcessorTest\testProcessWithoutWhitelistedExtensionWhichShouldGetRejected(), Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest\testPutStreamWhichShouldSucceed(), Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest\testPutStreamWithDetachedStreamWhichShouldFail(), Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest\testPutStreamWithGeneralFailureWhichShouldFail(), ILIAS\FileUpload\Processor\SVGPreProcessorTest\testSaneSVG(), ILIAS\FileUpload\Processor\SVGPreProcessorTest\testSomeComplexSaneSVG(), Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest\testUpdateStreamWhichShouldSucceed(), Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest\testUpdateStreamWithDetachedStreamWhichShouldFail(), Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest\testUpdateStreamWithGeneralFailureWhichShouldFail(), Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest\testUpdateStreamWithMissingFileWhichShouldFail(), Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest\testWriteStreamWhichShouldSucceed(), Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest\testWriteStreamWithDetachedStreamWhichShouldFail(), Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest\testWriteStreamWithExistingFileWhichShouldFail(), and Filesystem\Provider\FlySystem\FlySystemFileStreamAccessTest\testWriteStreamWithFailingAdapterWhichShouldFail().

44  {
45  if (!is_string($string)) {
46  throw new \InvalidArgumentException('The argument $string must be of type string but was "' . gettype($string) . '"');
47  }
48 
49  $stream = new Stream(fopen('php://memory', 'rw'));
50  $stream->write($string);
51  return $stream;
52  }
+ Here is the caller graph for this function:

◆ ofZipResource()

ILIAS\Filesystem\Stream\Streams::ofZipResource ( \ZipArchive  $zip,
int  $index 
)

Definition at line 88 of file Streams.php.

88  : void
89  {
90  }

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