ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjSearchSettingsReadmeGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21use ILIAS\FileDelivery\Services as FileDelivery;
23
25{
26 protected const string PATH = __DIR__ . '/../../../../WebServices/RPC/lib/README.md';
27
29 protected FileDelivery $file_delivery;
30
31 public function __construct(
33 FileDelivery $file_delivery
34 ) {
35 $this->ctrl = $ctrl;
36 $this->file_delivery = $file_delivery;
37 }
38
39 public function executeCommand(): void
40 {
41 $cmd = $this->ctrl->getCmd();
42
43 switch ($cmd) {
44 case 'deliverFile':
45 $this->deliverFile();
46 break;
47
48 default:
50 'Invalid command for ilObjSearchSettingsReadmeGUI: ' . $cmd
51 );
52 }
53 }
54
55 protected function deliverFile(): void
56 {
57 $this->file_delivery->delivery()->inline(
58 Streams::ofResource(fopen(self::PATH, 'rb')),
59 basename(self::PATH),
60 'text/markdown'
61 );
62 }
63}
Stream factory which enables the user to create streams without the knowledge of the concrete class.
Definition: Streams.php:32
__construct(ilCtrlInterface $ctrl, FileDelivery $file_delivery)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...