ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\FileDelivery Class Reference
+ Inheritance diagram for ILIAS\FileDelivery:
+ Collaboration diagram for ILIAS\FileDelivery:

Public Member Functions

 init (array|\ArrayAccess &$define, array|\ArrayAccess &$implement, array|\ArrayAccess &$use, array|\ArrayAccess &$contribute, array|\ArrayAccess &$seek, array|\ArrayAccess &$provide, array|\ArrayAccess &$pull, array|\ArrayAccess &$internal,)
 
 init (array|\ArrayAccess &$define, array|\ArrayAccess &$implement, array|\ArrayAccess &$use, array|\ArrayAccess &$contribute, array|\ArrayAccess &$seek, array|\ArrayAccess &$provide, array|\ArrayAccess &$pull, array|\ArrayAccess &$internal,)
 
 init (array|\ArrayAccess &$define, array|\ArrayAccess &$implement, array|\ArrayAccess &$use, array|\ArrayAccess &$contribute, array|\ArrayAccess &$seek, array|\ArrayAccess &$provide, array|\ArrayAccess &$pull, array|\ArrayAccess &$internal,)
 

Data Fields

trait HttpServiceAware
 Trait HttpServiceAware. More...
 

Detailed Description

Definition at line 45 of file FileDelivery.php.

Member Function Documentation

◆ init()

ILIAS\FileDelivery::init ( array|\ArrayAccess &  $define,
array|\ArrayAccess &  $implement,
array|\ArrayAccess &  $use,
array|\ArrayAccess &  $contribute,
array|\ArrayAccess &  $seek,
array|\ArrayAccess &  $provide,
array|\ArrayAccess &  $pull,
array|\ArrayAccess &  $internal 
)

Every activity that delivers a file builds its result with this, so all of them look alike to their consumers - see the activities of the ResourceStorage.

Reimplemented from ILIAS\Component.

Definition at line 47 of file FileDelivery.php.

56 : void {
57 $define[] = DataSigning::class;
58 $define[] = FileDeliveryServices::class;
59
60 $contribute[Agent::class] = static fn() => new \ILIAS\FileDelivery\Setup\Agent(
61 $pull[Factory::class]
62 );
63
64 $contribute[PublicAsset::class] = fn() => new Endpoint($this, "deliver.php");
65
66 // INITIALIZATION OF SERVICES
67 // The delivery method is baked into an artefact at setup time, so the
68 // builder is picked without a DB or ini read.
69 $internal[ResponseBuilder::class] = static fn() => ResponseBuilderFactory::fromArtefact();
70
71 // Both the content domain and the ILIAS domain (derived from http_path)
72 // are baked into the artefact at setup time, so no ini read is needed.
73 $internal[IsolationConfig::class] = static fn() => IsolationConfig::fromArtefact();
74
75 $internal[PHPResponseBuilder::class] = (static fn() => new PHPResponseBuilder());
76
77 $internal[DataSigning::class] = static fn() => new DataSigner(
79 );
80
81 $implement[DataSigning::class] = static fn() => $internal[DataSigning::class];
82
83 $internal[StreamDelivery::class] = (static fn() => new StreamDelivery(
84 $use[DataSigning::class],
85 $use[GlobalHttpState::class],
86 $internal[ResponseBuilder::class],
87 $internal[PHPResponseBuilder::class],
88 $internal[IsolationConfig::class],
89 ));
90
91 $internal[LegacyDelivery::class] = (static fn() => new LegacyDelivery(
92 $use[GlobalHttpState::class],
93 $internal[ResponseBuilder::class],
94 $internal[PHPResponseBuilder::class],
95 $internal[IsolationConfig::class],
96 ));
97
98 $internal[FileDeliveryServices::class] = (static fn() => new Services(
99 $internal[StreamDelivery::class],
100 $internal[LegacyDelivery::class],
101 $use[DataSigning::class],
102 $use[GlobalHttpState::class],
103 $internal[IsolationConfig::class],
104 $use[HttpPathProvider::class],
105 ));
106
107 $implement[FileDeliveryServices::class] = static fn() => $internal[FileDeliveryServices::class];
108
109 $contribute[EntryPoint::class] = static fn() => new \ILIAS\FileDelivery\EntryPoint(
110 $internal[FileDeliveryServices::class],
111 $use[GlobalHttpState::class],
112 );
113
119 $internal[FilePayloadFactory::class] = static fn() => new FilePayloadFactory();
120 $provide[FilePayloadFactory::class] = static fn() => $internal[FilePayloadFactory::class];
121 }
An endpoint is a PHP file that produces output via HTTP.
Definition: Endpoint.php:29
Builds the payload of a delivering activity and describes its shape.
static fromArtefact(?string $path=null)
Load the configuration from the static artefact written by the setup.
static fromArtefact(string $path)
Load a rotation from a static PHP artefact written by the setup, newest key first.

Field Documentation

◆ HttpServiceAware

trait ILIAS\FileDelivery::HttpServiceAware
Initial value:
{
private static $http

Trait HttpServiceAware.

This trait provide a convenient way to consume the global http state and aids to reduce code duplication.

Please only use this trait if you need the global http state from a static context! Otherwise consider to pass the http global state via constructor (DI).

Author
Nicolas Schäfli ns@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0
Since
5.3

@Internal

Definition at line 38 of file HttpServiceAware.php.


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