Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Bizarre clash between Patchwork and PasswordLib #6
Okay, this is weird.
I have Patchwork and PasswordLib (https://github.com/ircmaxell/PHP-PasswordLib) installed together, in a unit testing script, under phpUnit.
Patchwork is being used for tests, and PasswordLib is part of the system under test.
Test scripts that call funtions that reference PasswordLib::verifyPasswordHash are failing with the following exception:
Note: this happens on our Jenkins server (Debian Squeeze, php 5.3.3-7+squeeze15). It does NOT happen when I run the same test scripts on my Windows PC. (php 5.3.8).
It is particularly odd as the test in question doesn't actually make any calls to Patchwork. Merely having patchwork included is sufficient to trigger the error.
The trace message is helpful -- it leads me to a line in PasswordLib where it calls the PHP built-in function stream_set_read_buffer(). This line seems to be triggering a call to Patchwork stream_set_option(), and thus causing the exception.
I have worked around the problem by commenting out the call to stream_set_read_buffer() in PasswordLib; it isn't critical to the operation of the library, and all seems to be working okay so I'm not desperate for an immediate fix, but it would be good to get an understanding of what's going on.
I hope that I've given sufficent information here to help you track down the problem.
Bah, seems like my lazy coding has eventually turned against me. I had left a method in the Patchwork's stream wrapper (