Posts

Showing posts with the label notifications

PHP Stream Notifications ❤ MongoDB

PHP Streams have several pretty nifty features that most people don't really know about; Filters , Wrappers , Context , and Notifications . Documenting these is a bit difficult, and getting the user to discover these features is even more problematic, as these things usually live outside of the normal path (function reference). Maybe I'll blog about these things in the future, but for now I want to talk about the Stream (context) Notifications  - or more specifically; Stream Notifications in the MongoDB extension for PHP. The Stream Notifications are essentially pretty simple: when a stream does something, it notifies something (a callback function) that it did something (notification codes, importance, message code, ..). Since this feature is a little neglected and people don't seem to know about it, this "something happened" isn't really a lot of things. When PHP reads from the http stream it will tell you if it came across a " redirect header ...