[PR #349] [MERGED] fixed resource check for multithreaded usage #1095

Closed
opened 2026-03-04 03:05:04 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Seldaek/monolog/pull/349
Author: @zelgerj
Created: 4/7/2014
Status: Merged
Merged: 4/8/2014
Merged by: @Seldaek

Base: masterHead: master


📝 Commits (1)

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/Monolog/Handler/StreamHandler.php (+1 -1)

📄 Description

If you use the logger in a multithreaded php application based on pthreads it will show up fwrite() expects parameter 1 to be resource, integer given when doing logs. This comes because a stream resource taken to a thread context won't be null. The fix is to do a explicit check if it isn't a resource. I'am on the integration of monolog to our PHP WebServer at the moment so it would be nice if you can accept that pull request shortly :)

Cheers!
Johann


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Seldaek/monolog/pull/349 **Author:** [@zelgerj](https://github.com/zelgerj) **Created:** 4/7/2014 **Status:** ✅ Merged **Merged:** 4/8/2014 **Merged by:** [@Seldaek](https://github.com/Seldaek) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`a1e7f2a`](https://github.com/Seldaek/monolog/commit/a1e7f2a6fb01618d10c35b9996f2758003318f5c) fixed resource check ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/Monolog/Handler/StreamHandler.php` (+1 -1) </details> ### 📄 Description If you use the logger in a multithreaded php application based on pthreads it will show up `fwrite() expects parameter 1 to be resource, integer given` when doing logs. This comes because a stream resource taken to a thread context won't be null. The fix is to do a explicit check if it isn't a resource. I'am on the integration of monolog to our [`PHP WebServer`](https://github.com/techdivision/TechDivision_WebServer) at the moment so it would be nice if you can accept that pull request shortly :) Cheers! Johann --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 03:05:04 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#1095
No description provided.