Skip to content

Bizarre clash between Patchwork and PasswordLib #6

@Spudley

Description

@Spudley

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:
Patchwork\Preprocessor\Stream::stream_set_option is not implemented

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions