Skip to content

YamlWriterTask: a write failure is ignored, the path is output as if the file had been written #345

Closed

Description

@njoubert-cleverage

YamlWriterTask (yaml_writer) does not check the result of file_put_contents(). When the parent directory does not exist (or is not writable), PHP only raises a warning, which becomes an exception in debug mode only: in production, the task outputs the path as if the file had been written, and the next tasks work on a missing file.

It is also inconsistent with json_stream_writer and csv_writer, which create the parent directory.

Fix: create the parent directory if needed (as JsonStreamFile), and throw a RuntimeException when the file cannot be written.

Found during the global audit after the 5.4 release (process-bundle-audit.md #102).

Activity

  1. added a commit that references this issue on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions