Component Revision with new Logging Infrastructure - #11841
Open
schmitz-ilias wants to merge 24 commits into
Open
Component Revision with new Logging Infrastructure#11841schmitz-ilias wants to merge 24 commits into
schmitz-ilias wants to merge 24 commits into
Conversation
…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
…s services Introduces ILIAS\AccessControl\Services interface and AccessControlServicesImpl, which lazily instantiate ilRbacReview, ilRbacSystem, ilRbacAdmin, and ilAccess. AccessControl.php wires the interface via define/implement. AllModernComponents bridges the four services into DIC under their legacy keys (rbacreview, rbacsystem, rbacadmin, ilAccess). initAccessHandling() in ilInitialisation is emptied; the DIC keys are now populated before ilInitialisation runs.
Introduces ILIAS\Logging\Services interface and ServicesImpl into the component bootstrap. Logging.php now declares and implements Services, making the logger factory injectable via the component system. Init.php and AllModernComponents wire the new service and expose it as $DIC['ilLoggerFactory'], replacing the manual Pimple binding that was hardcoded in ilInitialisation::initILIAS().
…rvices ilGlobalPageTemplate and ilSessionReminderGUI previously type-hinted ilLoggerFactory directly. Since $DIC['ilLoggerFactory'] now returns ILIAS\Logging\ServicesImpl, update both properties and constructor parameters to ILIAS\Logging\Services.
…h injected LoggingServices IRSSEventLogObserver was wired with a global \$DIC closure because ilLogger was not yet bootstrapped. Now that ILIAS\Logging\Services is available, use \$use[LoggingServices::class] directly and drop both the global \$DIC access and the TODO comment.
…gging as soon as possible
…e instead, fix unit tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates #11430 to use the new Logging infrastructure introduced with a7d20b8. I undid some of the previous changes and removed most of the newly introduced wrappers in Logging. I also had to make small changes to a bunch of unit tests, all of which make too many assumptions about the dependencies of the (now deprecated)
ilLoggerFactory.I hope this is helpful, let me know if we can do anything else in Logging to help the process along.
Cheers, Tim