Remove dependency of "file_system" service on "logger"

Created on 21 December 2016, about 8 years ago
Updated 27 June 2024, 8 months ago

Problem/Motivation

Currently, file_system service depends on three other services:

  file_system:
    class: Drupal\Core\File\FileSystem
    arguments: ['@stream_wrapper_manager', '@settings', '@logger.channel.file']

Inside of Drupal\Core\File\FileSystem class, instance of logger is used only once in the chmod() method to log error when chmod() PHP function returns FALSE.

Not only this is a side effect, but an instance of logger.channel.file contains references to other services: requests stack, current user object. And from the source of Drupal\Core\Logger\LoggerChannel::log() method, it looks like it can even execute a database query.

Logger makes dependency tree of file_system service unnecessary complicated, and I would expect such a low-level service to have as little side-effects as possible.

Remaining tasks

None

User interface changes

None.

API changes

Change of Drupal\Core\File\FileSystem::__construct() signature.
FileSystem no longer logs any errors. This is up to the caller.

Data model changes

None.

πŸ“Œ Task
Status

Fixed

Version

10.3 ✨

Component
File systemΒ  β†’

Last updated about 4 hours ago

Created by

πŸ‡¨πŸ‡¦Canada 20th

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024