ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\ResourceStorage\Flavours\SVGDummyMachine Class Reference
+ Inheritance diagram for ILIAS\ResourceStorage\Flavours\SVGDummyMachine:
+ Collaboration diagram for ILIAS\ResourceStorage\Flavours\SVGDummyMachine:

Public Member Functions

 __construct ()
 FlavourMachines must be able to be created without further dependencies. More...
 
 processStream (FileInformation $information, FileStream $stream, FlavourDefinition $for_definition)
 
- Public Member Functions inherited from ILIAS\ResourceStorage\Flavours\DummyMachine
 load (string $id, ?string $can_handle_definition_id=null, string $depends_on_engine=NoEngine::class)
 
 __construct ()
 FlavourMachines must be able to be created without further dependencies. More...
 
 getId ()
 
 canHandleDefinition (FlavourDefinition $definition)
 Check if a corresponding configuration can be processed by this Machine. More...
 
 dependsOnEngine ()
 Return the class name of the Engine that is required for this Machine to work. More...
 
 processStream (FileInformation $information, FileStream $stream, FlavourDefinition $for_definition)
 
- Public Member Functions inherited from ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\AbstractMachine
 __construct ()
 FlavourMachines must be able to be created without further dependencies. More...
 
 withEngine (Engine $engine)
 The demanded Engine will be passed here. More...
 
 getEngine ()
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\AbstractMachine
Engine $engine = null
 

Detailed Description

Definition at line 30 of file SVGDummyMachine.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\ResourceStorage\Flavours\SVGDummyMachine::__construct ( )

FlavourMachines must be able to be created without further dependencies.

Implements ILIAS\ResourceStorage\Flavour\Machine\FlavourMachine.

Definition at line 32 of file SVGDummyMachine.php.

References ILIAS\ResourceStorage\Flavours\DummyMachine\load().

33  {
34  $this->load(
35  'svg_color_changing_machine',
36  'svg_color_changing'
37  );
38  }
load(string $id, ?string $can_handle_definition_id=null, string $depends_on_engine=NoEngine::class)
+ Here is the call graph for this function:

Member Function Documentation

◆ processStream()

ILIAS\ResourceStorage\Flavours\SVGDummyMachine::processStream ( FileInformation  $information,
FileStream  $stream,
FlavourDefinition  $for_definition 
)
Parameters
FileInformation$informationof the original File.
FileStream$streamof the original File.
FlavourDefinition$for_definitionthe definition for which the stream should be processed.
Returns
Result[]| For each "thing" that the machine generates, a result can be returned. E.g. when extracting 5 images from a PDF, 5 results are returned (Generator).

Implements ILIAS\ResourceStorage\Flavour\Machine\FlavourMachine.

Definition at line 42 of file SVGDummyMachine.php.

References ILIAS\Filesystem\Stream\Streams\ofString().

46  : \Generator {
47  $content = (string) $stream;
48 
49  $from_color = ':' . $for_definition->getColor() . ';';
50  $to_color = ':' . $for_definition->getToColor() . ';';
51  $content = str_replace($from_color, $to_color, $content);
52 
53  yield new Result(
54  $for_definition,
55  Streams::ofString($content)
56  );
57  }
static ofString(string $string)
Creates a new stream with an initial value.
Definition: Streams.php:41
+ Here is the call graph for this function:

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