ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
SVGDummyMachine.php
Go to the documentation of this file.
1 <?php
2 
20 
26 
31 {
32  public function __construct()
33  {
34  $this->load(
35  'svg_color_changing_machine',
36  'svg_color_changing'
37  );
38  }
39 
40 
41  public function processStream(
42  FileInformation $information,
43  FileStream $stream,
44  FlavourDefinition $for_definition
45  ): \Generator {
46  $content = (string)$stream;
47 
48  $from_color = ':' . $for_definition->getColor() . ';';
49  $to_color = ':' . $for_definition->getToColor() . ';';
50  $content = str_replace($from_color, $to_color, $content);
51 
52  yield new Result(
53  $for_definition,
54  Streams::ofString($content)
55  );
56  }
57 }
processStream(FileInformation $information, FileStream $stream, FlavourDefinition $for_definition)
__construct()
FlavourMachines must be able to be created without further dependencies.
load(string $id, string $can_handle_definition_id=null, string $depends_on_engine=NoEngine::class)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static ofString(string $string)
Creates a new stream with an initial value.
Definition: Streams.php:41
The base interface for all filesystem streams.
Definition: FileStream.php:31