ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\ResourceStorage\Flavours\DummyMachine Class Reference
+ Inheritance diagram for ILIAS\ResourceStorage\Flavours\DummyMachine:
+ Collaboration diagram for ILIAS\ResourceStorage\Flavours\DummyMachine:

Public Member Functions

 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)
 

Private Attributes

string $depends_on_engine = NoEngine::class
 
string $id = self::class
 
string $can_handle_definition_id = null
 

Additional Inherited Members

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

Detailed Description

Definition at line 31 of file DummyMachine.php.

Constructor & Destructor Documentation

◆ __construct()

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

FlavourMachines must be able to be created without further dependencies.

Reimplemented from ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\AbstractMachine.

Reimplemented in ILIAS\ResourceStorage\Flavours\BrokenDummyMachine, and ILIAS\ResourceStorage\Flavours\SVGDummyMachine.

Definition at line 47 of file DummyMachine.php.

48 {
50 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ canHandleDefinition()

ILIAS\ResourceStorage\Flavours\DummyMachine::canHandleDefinition ( FlavourDefinition  $definition)

Check if a corresponding configuration can be processed by this Machine.

Implements ILIAS\ResourceStorage\Flavour\Machine\FlavourMachine.

Definition at line 57 of file DummyMachine.php.

57 : bool
58 {
59 if ($this->can_handle_definition_id === null) {
60 return true;
61 }
62 return $this->can_handle_definition_id === $definition->getId();
63 }

References ILIAS\ResourceStorage\Flavour\Definition\FlavourDefinition\getId().

+ Here is the call graph for this function:

◆ dependsOnEngine()

ILIAS\ResourceStorage\Flavours\DummyMachine::dependsOnEngine ( )

Return the class name of the Engine that is required for this Machine to work.

Returning null will result in a NullEngine passed to the Machine.

Implements ILIAS\ResourceStorage\Flavour\Machine\FlavourMachine.

Definition at line 65 of file DummyMachine.php.

65 : ?string
66 {
68 }

◆ getId()

ILIAS\ResourceStorage\Flavours\DummyMachine::getId ( )
Returns
string max. 64 characters, MUST be unique and NOT a class-related magic-constant. E.g. you can generate a random one with $ php -r"echo hash('sha256', uniqid());" | pbcopy in your shell and paste string in your getId() implementation.

If you ever change the ID, FlavourDefinitions may no longer process anything with your machine that previously designated you as the processing machine.

Implements ILIAS\ResourceStorage\Flavour\Machine\FlavourMachine.

Definition at line 52 of file DummyMachine.php.

52 : string
53 {
54 return $this->id;
55 }

References $id.

◆ load()

ILIAS\ResourceStorage\Flavours\DummyMachine::load ( string  $id,
?string  $can_handle_definition_id = null,
string  $depends_on_engine = NoEngine::class 
)

Definition at line 37 of file DummyMachine.php.

41 : void {
42 $this->id = $id;
43 $this->depends_on_engine = $depends_on_engine;
44 $this->can_handle_definition_id = $can_handle_definition_id;
45 }

Referenced by ILIAS\ResourceStorage\Flavours\SVGDummyMachine\__construct().

+ Here is the caller graph for this function:

◆ processStream()

ILIAS\ResourceStorage\Flavours\DummyMachine::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).

Implements ILIAS\ResourceStorage\Flavour\Machine\FlavourMachine.

Reimplemented in ILIAS\ResourceStorage\Flavours\SVGDummyMachine.

Definition at line 71 of file DummyMachine.php.

75 : \Generator {
76 yield new NonStoreableResult($for_definition, $stream);
77 }

Field Documentation

◆ $can_handle_definition_id

string ILIAS\ResourceStorage\Flavours\DummyMachine::$can_handle_definition_id = null
private

Definition at line 35 of file DummyMachine.php.

◆ $depends_on_engine

string ILIAS\ResourceStorage\Flavours\DummyMachine::$depends_on_engine = NoEngine::class
private

Definition at line 33 of file DummyMachine.php.

◆ $id

string ILIAS\ResourceStorage\Flavours\DummyMachine::$id = self::class
private

Definition at line 34 of file DummyMachine.php.


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