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

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,)
 

Detailed Description

Definition at line 55 of file File.php.

Member Function Documentation

◆ init()

ILIAS\File::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 
)

Creating a file object is one activity, not a sequence of calls: the file comes with the call, the object is created, put into the tree and given its content - or nothing is left behind.

Listing what is below a node is a matter of the repository, not of this component, so it is not contributed as an Activity. It stays as code, because listing files is that listing plus what a file is.

Reading a file of the repository is guarded by the read permission on the object; the resource behind it is then delivered by the according activity of the ResourceStorage, which trusts this check.

Everything else a file object can do: its data, its versions, where it lives, and whether it lives at all.

Packing a container performs the listing and the delivery of every single file, so it cannot pack what a user may not read.

Whoever pulls one of these: perform() checks nothing, that is the contract of an Activity - it is the door for code that has checked already. With anything that comes from a request, use maybePerformAs(), or isAllowedToPerform() first.

Reimplemented from ILIAS\Component.

Definition at line 57 of file File.php.

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 }
An public asset that is a resource of some component.
Definition: OfComponent.php:27
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.

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