ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 
 __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...
 
 withEngine (Engine $engine)
 The demanded Engine will be passed here. More...
 
 getEngine ()
 
 processStream (FileInformation $information, FileStream $stream, FlavourDefinition $for_definition)
 

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.

Reimplemented from ILIAS\ResourceStorage\Flavours\DummyMachine.

Definition at line 32 of file SVGDummyMachine.php.

33 {
35 $this->load(
36 'svg_color_changing_machine',
37 'svg_color_changing'
38 );
39 }
load(string $id, ?string $can_handle_definition_id=null, string $depends_on_engine=NoEngine::class)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), and ILIAS\ResourceStorage\Flavours\DummyMachine\load().

+ 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[]|\Generator 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).

Reimplemented from ILIAS\ResourceStorage\Flavours\DummyMachine.

Definition at line 43 of file SVGDummyMachine.php.

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

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