ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
File.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS;
22
54
55class File implements Component
56{
57 public function init(
58 array | \ArrayAccess &$define,
59 array | \ArrayAccess &$implement,
60 array | \ArrayAccess &$use,
61 array | \ArrayAccess &$contribute,
62 array | \ArrayAccess &$seek,
63 array | \ArrayAccess &$provide,
64 array | \ArrayAccess &$pull,
65 array | \ArrayAccess &$internal,
66 ): void {
67 $implement[DownloadLimit::class] = static fn() =>
68 new General(
69 $pull[Connection::class]
70 );
71
72 $contribute[Agent::class] = static fn() =>
73 new \ilFileObjectAgent(
74 $pull[Factory::class]
75 );
76
77 $contribute[PublicAsset::class] = fn() =>
78 new OfComponent($this, "default_file_icons", "assets");
79
80 $contribute[\ILIAS\StaticURL\Handler\Handler::class] = static fn() =>
81 new \ilFileStaticURLHandler();
82
88 $internal[RepositoryProvider::class] = static fn() => new RepositoryProvider(
89 $use[Access::class],
90 $use[RBAC::class],
91 );
92
93 $internal[CreateFile::class] = static fn() => new CreateFile(
94 $pull[FileParameter::class],
95 $internal[RepositoryProvider::class],
96 $pull[Parameter::class],
97 );
98
99 $internal[ReplaceFileContent::class] = static fn() => new ReplaceFileContent(
100 $pull[FileParameter::class],
101 $internal[RepositoryProvider::class],
102 $pull[Parameter::class],
103 );
104
110 $internal[ListContainerContent::class] = static fn() => new ListContainerContent(
111 $internal[RepositoryProvider::class],
112 $pull[Parameter::class],
113 );
114
115 $internal[ListFiles::class] = static fn() => new ListFiles(
116 $internal[RepositoryProvider::class],
117 $internal[ListContainerContent::class],
118 $pull[Parameter::class],
119 );
120
126 $internal[DeliverFileObject::class] = static fn() => new DeliverFileObject(
127 $internal[RepositoryProvider::class],
128 $pull[DeliverResource::class],
129 $pull[FilePayloadFactory::class],
130 $pull[Parameter::class],
131 );
132
137 $internal[UpdateFileMetadata::class] = static fn() => new UpdateFileMetadata(
138 $internal[RepositoryProvider::class],
139 $pull[Parameter::class],
140 );
141
142 $internal[DeleteFile::class] = static fn() => new DeleteFile(
143 $internal[RepositoryProvider::class],
144 $pull[Parameter::class],
145 );
146
147 $internal[MoveFile::class] = static fn() => new MoveFile(
148 $internal[RepositoryProvider::class],
149 $pull[Parameter::class],
150 );
151
152 $internal[CopyFile::class] = static fn() => new CopyFile(
153 $internal[RepositoryProvider::class],
154 $pull[Parameter::class],
155 );
156
157 $internal[ListFileVersions::class] = static fn() => new ListFileVersions(
158 $internal[RepositoryProvider::class],
159 $pull[StorageProvider::class],
160 $pull[Parameter::class],
161 );
162
163 $internal[DeliverFileVersion::class] = static fn() => new DeliverFileVersion(
164 $internal[RepositoryProvider::class],
165 $pull[StorageProvider::class],
166 $pull[FilePayloadFactory::class],
167 $pull[Parameter::class],
168 );
169
174 $internal[DownloadContainerAsZip::class] = static fn() =>
176 $internal[ListFiles::class],
177 $internal[DeliverFileObject::class],
178 $pull[FilePayloadFactory::class],
179 $pull[Parameter::class],
180 );
181
188 $provide[CreateFile::class] = static fn() => $internal[CreateFile::class];
189 $provide[ReplaceFileContent::class] = static fn() =>
190 $internal[ReplaceFileContent::class];
191 $provide[ListFiles::class] = static fn() => $internal[ListFiles::class];
192 $provide[ListContainerContent::class] = static fn() =>
193 $internal[ListContainerContent::class];
194 $provide[DeliverFileObject::class] = static fn() =>
195 $internal[DeliverFileObject::class];
196
197 $contribute[Activity::class] = static fn() => $internal[CreateFile::class];
198 $contribute[Activity::class] = static fn() => $internal[ReplaceFileContent::class];
199 $contribute[Activity::class] = static fn() => $internal[ListFiles::class];
200 $contribute[Activity::class] = static fn() => $internal[DeliverFileObject::class];
201 $contribute[Activity::class] = static fn() => $internal[UpdateFileMetadata::class];
202 $contribute[Activity::class] = static fn() => $internal[DeleteFile::class];
203 $contribute[Activity::class] = static fn() => $internal[MoveFile::class];
204 $contribute[Activity::class] = static fn() => $internal[CopyFile::class];
205 $contribute[Activity::class] = static fn() => $internal[ListFileVersions::class];
206 $contribute[Activity::class] = static fn() => $internal[DeliverFileVersion::class];
207 $contribute[Activity::class] = static fn() => $internal[DownloadContainerAsZip::class];
208
209 $contribute[LanguageFileDirectory::class] = fn() => new ComponentLanguageFileDirectory(
210 $this,
211 'file'
212 );
213 }
214}
An public asset that is a resource of some component.
Definition: OfComponent.php:27
Builds data types.
Definition: Factory.php:36
Builds the payload of a delivering activity and describes its shape.
A file as a parameter of an activity: how it is described, and how it is read.
Copy a file object into another container.
Definition: CopyFile.php:45
Create a file object in the repository - in one call.
Definition: CreateFile.php:54
Delete a file object.
Definition: DeleteFile.php:45
Deliver the content of a file object of the repository.
Deliver an earlier version of a file object.
Deliver the files of a container as one zip archive.
List what is in a container of the repository.
List the versions of a file object.
List the files in a container of the repository.
Definition: ListFiles.php:47
Move a file object to another container.
Definition: MoveFile.php:44
Give an existing file object new content - in one call.
The bits of the repository the file activities need: the tree to check where a file may go and access...
Change title and description of a file object.
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,)
Definition: File.php:57
Deliver a resource of the ResourceStorage.
Hands the ResourceStorage to the activities: the few reads they need, in a shape that can be mocked.
Public access-handling service of the AccessControl component.
Definition: Access.php:31
Public RBAC service of the AccessControl component.
Definition: RBAC.php:30
An Activity is an action on the domain layer action of a component.
Definition: Activity.php:41
An public asset is a file or folder that should be served via the web.
Definition: PublicAsset.php:27
Wrapper for the Setup to work, as they require a namespace.
Definition: Connection.php:27
The global limit for the sum of file sizes a ZIP download may collect.
A directory of language files with a path and a prefix for them.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.