Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Silence warning in readCacheFile() #3438

Merged

Conversation

kdambekalns
Copy link
Member

@kdambekalns kdambekalns commented Jan 23, 2025

readCacheFile() in SimpleFileBackend does fopen(). It wraps it into a try-catch clause and checks the result, but it still produces a warning if the file does not exist:

Warning: fopen(/application/Data/Temporary/…): Failed to open stream: No such file or directory

The only way to suppress that warning is to use the shut-up operator (@) in this place. Given that everything that can go wrong here is taken care of, I think this is fine.

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

readCacheFile() in SimpleFileBackend does fopen(). It wraps it
into a try-catch clause and checks the result, but it still produces
a warning if the file does not exist:

`Warning: fopen(/application/Data/Temporary/…): Failed to open stream: No such file or directory`

The only way to suppress that warning is to use the shut-up
operator (`@`) in this place. Given that everything that can go
wrong here is taken care of, I think this is fine.
Copy link
Contributor

@dlubitz dlubitz left a comment

Choose a reason for hiding this comment

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

Makes sense.

@kdambekalns kdambekalns merged commit 2788f1a into neos:8.3 Jan 23, 2025
11 checks passed
@kdambekalns kdambekalns deleted the bugfix/fopen-warning-in-readCacheFile branch January 23, 2025 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants