ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
Filesystem.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS;
22
57
58class Filesystem implements Component
59{
60 public function init(
61 array|\ArrayAccess &$define,
62 array|\ArrayAccess &$implement,
63 array|\ArrayAccess &$use,
64 array|\ArrayAccess &$contribute,
65 array|\ArrayAccess &$seek,
66 array|\ArrayAccess &$provide,
67 array|\ArrayAccess &$pull,
68 array|\ArrayAccess &$internal,
69 ): void {
70 // Sanitizing
71 $define[] = FilenameSanitizer::class;
72 // Configs
73 $define[] = DirectoryPathConfig::class;
74 $define[] = FilesystemConfig::class;
75 // Filesystems
76 $define[] = FilesystemWeb::class;
77 $define[] = FilesystemStorage::class;
78 $define[] = FilesystemTemp::class;
79 $define[] = FilesystemCustomizing::class;
80 $define[] = FilesystemLibs::class;
81 $define[] = FilesystemNodeModules::class;
82 $define[] = Filesystems::class;
83
84 // Sevices
85 $define[] = FilesystemFactory::class;
86
87 // Implementations
88 $implement[FilenameSanitizer::class] = static fn() => new DefaultFilenameSanitizer(
89 $use[FilesystemConfig::class]
90 );
91
92 $implement[DirectoryPathConfig::class] = static fn(
94 $use[IliasIni::class],
95 $use[ClientIni::class],
96 $use[ClientIdProvider::class]
97 );
98 $implement[FilesystemConfig::class] = static fn() => new DatabaseBackedFilesystemConfig(
99 $pull[Connection::class],
100 $use[UploadRestrictionBypass::class]
101 );
102
103 $implement[FilesystemFactory::class] = static fn(
105 $use[FilenameSanitizer::class],
106 $use[DirectoryPathConfig::class]
107 );
108
109 $implement[FilesystemWeb::class] = static fn() => new ConfiguredFilesystemWeb(
110 $use[FilesystemFactory::class]
111 );
112 $implement[FilesystemStorage::class] = static fn() => new ConfiguredFilesystemStorage(
113 $use[FilesystemFactory::class]
114 );
115 $implement[FilesystemTemp::class] = static fn() => new ConfiguredFilesystemTemp(
116 $use[FilesystemFactory::class]
117 );
118 $implement[FilesystemCustomizing::class] = static fn(
120 $use[FilesystemFactory::class]
121 );
122 $implement[FilesystemLibs::class] = static fn() => new ConfiguredFilesystemLibs(
123 $use[FilesystemFactory::class]
124 );
125 $implement[FilesystemNodeModules::class] = static fn(
127 $use[FilesystemFactory::class]
128 );
129
130 $implement[Filesystems::class] = static fn() => new FilesystemsImpl(
131 $use[FilesystemStorage::class],
132 $use[FilesystemWeb::class],
133 $use[FilesystemTemp::class],
134 $use[FilesystemCustomizing::class],
135 $use[FilesystemLibs::class],
136 $use[FilesystemNodeModules::class]
137 );
138
139 // ASSETS AND AGENTS
140 $contribute[Agent::class] = static fn() => new \ilFileSystemSetupAgent(
141 $pull[Factory::class]
142 );
143
144 // UPLOAD PRE-PROCESSORS
145 $contribute[PreProcessor::class] = static fn() => new FilenameSanitizerPreProcessor();
146 $contribute[PreProcessor::class] = static fn() => new InsecureFilenameSanitizerPreProcessor();
147 $contribute[PreProcessor::class] = static fn() => new SVGBlacklistPreProcessor();
148 }
149}
Builds data types.
Definition: Factory.php:36
The Filesystems implementation holds the configuration for the filesystem service.
The delegating filesystem factory delegates the instance creation to the factory of the concrete impl...
Standard implementation of the filename sanitizing interface.
PreProcessor which checks SVGs for scripts and other malicious content.
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: Filesystem.php:60
Wrapper for the Setup to work, as they require a namespace.
Definition: Connection.php:27
Typed read access to client.ini.php.
Definition: ClientIni.php:35
Typed read access to ilias.ini.php.
Definition: IliasIni.php:35
Tells whether the current user holds the permission of the file services administration to upload fil...
The Filesystems interface defines the access methods which can be used to fetch the different filesys...
Definition: Filesystems.php:30
The filename sanitizer verifies and fixes file name endings.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.