Skip to content

Clean up WOFF temporary files - #160

Open
dajiaohuang wants to merge 1 commit into
dompdf:masterfrom
dajiaohuang:fix/159-clean-temp-file
Open

dajiaohuang wants to merge 1 commit into
dompdf:masterfrom
dajiaohuang:fix/159-clean-temp-file

Conversation

@dajiaohuang

@dajiaohuang dajiaohuang commented Oct 1, 2026 •

Copy link
Copy Markdown

Summary

  • Replace the named temp file in BinaryStream::getTempFile(false) with the tmpfile() stream.
  • PHP removes the disk-backed temporary file when its stream closes or the script ends, preventing WOFF loads from leaving files in the system temp directory.
  • Addresses sys tmp dir left over files #159. The separate custom temp-directory request in Feature request: custom sys_get_temp_dir #154 is unchanged.

Validation

  • git diff --check passed.
  • PHP CLI is unavailable in this environment; tests and syntax lint were not run.

@bsweeney bsweeney left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the idea of the original logic was to provide some tracking of temp files created by FontLib. However, without the addition of tracking and removal of created temp files the previous logic was insufficient for a clean run. I think this is an acceptable compromise until we have a chance to better build out the temp file infrastructure.

@bsweeney bsweeney added this to the 1.0.3 milestone Oct 1, 2026
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.

2 participants