Skip to content

WIP: Proposal/12/component revision some components#11430

Open
chfsx wants to merge 17 commits intoILIAS-eLearning:trunkfrom
srsolutionsag:proposal/12/component-revision-some-components
Open

WIP: Proposal/12/component revision some components#11430
chfsx wants to merge 17 commits intoILIAS-eLearning:trunkfrom
srsolutionsag:proposal/12/component-revision-some-components

Conversation

@chfsx
Copy link
Copy Markdown
Member

@chfsx chfsx commented Apr 16, 2026

I’ll be adding a bit more over the next few days, but I think this is a good starting point for others. I’ll also write a few lines about my experiences – for example, what I had to implement in some cases just to make any progress at all, and also what is likely to be of a temporary nature and should be removed at some point.
I’ll also share my experiences with Claude Code regarding the migration of components, which can at least take care of a large part of the legwork.

chfsx added 17 commits April 16, 2026 14:01
…asses

Introduce bootstrapped configuration services: IliasIni, ClientIdProvider,
Directories, ServerConfiguration, ClientIni and related repositories. Wire
all into the component bootstrap so consumers can inject them via $use[].
…cyProxy

Add External (bootstrapped DB interface for component injection) and
DBLegacyProxy (bridges $DIC->database() into the bootstrap container so
components can $use[External::class] without full migration).
Wire HTTP services into bootstrap ($define GlobalHttpState, expose via
$implement). Extract header configuration into HeaderSettings interface
with ini-backed and legacy-proxy implementations.
…interfaces

Wire all filesystem variants (storage, web, temp, customizing, libs, nodemodules)
into bootstrap as individually injectable services. Extract FilesystemConfig as
bootstrapped interface backed by lazy DB reads. Replace FilenameSanitizerImpl
with DefaultFilenameSanitizer that accepts bootstrapped FilesystemConfig.
…vices interface

Introduce FileDeliveryServices interface ($define) and DataSigning interface
for token signing. Remove Init.php (absorbed into bootstrap). Add EntryPoint
for deliver.php. ilSecureTokenSrcBuilder now accepts FileDeliveryServices.
…esPolicy

Move ilFileServicesPolicy to ILIAS\FileServices\Policy\FileServicesPolicy with
lazy initialization (no DB reads in constructor). Old class becomes deprecated
alias. Remove ilFileServicesFilenameSanitizer (absorbed into DefaultFilenameSanitizer).
Migrate IRSS from InitResourceStorage/DIC to component bootstrap. Introduce
IRSSServices interface ($define). Break ResourceBuilder↔Migrator circular dep
via \Closure remover. Make ConsumerFactory DIC-access lazy. Stub out
ilWACSignedResourceStorage. IRSSEventLogObserver accepts \Closure logger
provider for fully lazy logger resolution. Observers contributed via $seek.
…leanup

Wire all newly bootstrapped services (Environment, Database, HTTP, Filesystem,
FileDelivery, FileServices, ResourceStorage) into AllModernComponents so they
are available via $DIC legacy bridge. Remove initResourceStorage() from
ilInitialisation. Update InitResourceStorage/InitHttpServices for new
constructor signatures.
Adapt Container to expose bootstrapped services alongside legacy Pimple bindings.
Update File component classes to use new bootstrapped service interfaces
(FilesystemStorage, FileDeliveryServices, IRSSServices) instead of DIC lookups.
…Environment services

- Refactor ilIniFile to deprecated wrapper backed by IniFileConfigurationRepository;
  delegates all I/O to the repository, legacy API preserved for backward compat
- Wire IliasIni + ClientIni into AllModernComponents (pure DIC bindings only —
  no logic, no constants, no GLOBALS); expose as $DIC['ilIliasIniFile'] / 'ilClientIniFile'
- Move all legacy constant and GLOBALS population to ilInitialisation:
  defineLegacyConstantsFromIliasIni(\ilIniFile) and defineLegacyConstantsFromClientIni(\ilIniFile)
  called from restored initIliasIniFile() / initClientIniFile() via global $DIC
- Remove calls to initIliasIniFile() / initClientIniFile() were already gone;
  restore them in initCore() / initClient() using bootstrapped $DIC services
- Drop Directories + ClientIdProvider from Init wiring; CLIENT_DATA_DIR / CLIENT_WEB_DIR
  built directly from ILIAS_DATA_DIR / ILIAS_ABSOLUTE_PATH / ILIAS_WEB_DIR / CLIENT_ID
Introduce PreProcessorCollection + PreProcessorCollectionImpl so
PreProcessorManagerImpl receives bootstrapped processors via constructor.
Each component contributes PreProcessor instances via $contribute/$seek:

- Filesystem: FilenameSanitizerPreProcessor, InsecureFilenameSanitizerPreProcessor,
  SVGBlacklistPreProcessor (moved from ILIAS\FileUpload\Processor,
  deprecated aliases kept for backward compat)
- FileServices: FileServicesPreProcessor (renamed from ilFileServicesPreProcessor,
  lazy DB read in checkPath(), no DB call in constructor)
- VirusScanner: VirusScannerPreProcessor (renamed from ilVirusScannerPreProcessor,
  factory resolved lazily via Closure to handle unconfigured scanner)

ilInitialisation::initFileUploadService() emptied and deprecated.
…ith $contribute/$seek

- Create StaticURLServices interface; Services implements it
- Define URIBuilder service; StandardURIBuilder implements it
- Context: remove final, accept \Closure factory (safe at build time)
- HandlerService: accept \Closure|array for lazy handler loading
- StaticURL.php: full bootstrap wiring; contribute LegacyGotoHandler + ShortlinksHandler; seek Handler::class
- Each component contributes its Handler via $contribute[Handler::class]:
  Authentication, Badge, Calendar, Certificate, Contact, Exercise, File, Blog, Style, Test, User
- Authentication/StaticUrlHandler, File/ilFileStaticURLHandler, User/StaticURLHandler: lazy DIC init in constructors
- SetupAgent: remove getBuildObjective() (no more artifact to build)
- ArtifactObjective: mark deprecated
- AllModernComponents: expose $DIC['static_url'] and $DIC['static_url.uri_builder']
- ilInitialisation::initHTTPServices(): remove legacy Init::init() call
- StaticURL\Init: mark deprecated
@chfsx
Copy link
Copy Markdown
Member Author

chfsx commented Apr 16, 2026

And of course I will have a look at the tests now :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant