ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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\GlobalScreen\Provider\__construct(), and ILIAS\ResourceStorage\Flavours\DummyMachine\load().

33  {
35  $this->load(
36  'svg_color_changing_machine',
37  'svg_color_changing'
38  );
39  }
__construct(Container $dic, ilPlugin $plugin)
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 43 of file SVGDummyMachine.php.

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

47  : \Generator {
48  $content = (string) $stream;
49 
50  $from_color = ':' . $for_definition->getColor() . ';';
51  $to_color = ':' . $for_definition->getToColor() . ';';
52  $content = str_replace($from_color, $to_color, $content);
53 
54  yield new Result(
55  $for_definition,
56  Streams::ofString($content)
57  );
58  }
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: