Output buffering issue in CLI

Created on 21 December 2023, 9 months ago
Updated 5 January 2024, 8 months ago

Problem/Motivation

In πŸ› Post-response task running (destructable services) are actually blocking; add test coverage and warn for common misconfiguration Fixed a new check was introduced in the system module's hook_requirements, to check if output buffering is enabled. Since ob_get_status() is called in the check, but ob_start() is never called in the CLI, the check fails when running vendor/bin/drush core:requirements for example.

Steps to reproduce

On any Drupal site running Drupal 10.2.x, run vendor/bin/drush core:requirements --fields=title,severity,sid,description,value, and it will give the output below, regardless of the setting in php.ini.

Output Buffering                 Warning    1     Output buffering [1] is not enabled. This may degrade Drupal's performance.                                                 
                                                  You can enable output buffering by default in your PHP settings [2].                                                        

                                                  [1] https://www.php.net/manual/en/function.ob-start.php                                                                     
                                                  [2] https://www.php.net/manual/en/outcontrol.configuration.php#ini.output-buffering

Proposed resolution

Do not run the check when PHP_SAPI === 'cli'

Remaining tasks

Write/commit the patch

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

πŸ› Bug report
Status

Closed: duplicate

Version

10.2 ✨

Component
SystemΒ  β†’

Last updated 1 day ago

No maintainer
Created by

πŸ‡§πŸ‡ͺBelgium Jelle_S Antwerp, Belgium

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024