Miguel Santirso <miguel.santirso@gmail.com>
http://miguelsantirso.es

This is a modified version of Janrain's PHP OpenID library, fixed to make it work with PHP 5.3. This
modifications were made at October 2009. You should make sure first that there is not a newer and official
version that fixes this problems.

This is what I did to make it work.

I found the first hints to solve the problem in this [ticket at the library's
trac](http://trac.openidenabled.com/trac/ticket/337). More precisely, the second comment in which someone
suggested to fix on of the first errors by modifying the `Auth_OpenID_detectMathLibrary` (File:
Auth/BigMath.php Line: 365). The new function looks like this:

[code php]
function Auth_OpenID_detectMathLibrary($exts)
{
    $loaded = false;

   // > This if is the only modification to the function <
   if ( ! function_exists( 'dl' ) )
    {
        return false;
    }
    
    foreach ($exts as $extension)
    {
    // See if the extension specified is already loaded.
        if ($extension['extension'] &&
            extension_loaded($extension['extension']))
        {
            $loaded = true;
        }

        // Try to load dynamic modules.
        if ( !$loaded)
        {
            foreach ($extension['modules'] as $module)
            {
                if (@dl($module.".".PHP_SHLIB_SUFFIX))
                {
                    $loaded = true;
                    break;
                }
            }
        }

        // If the load succeeded, supply an instance of
        // Auth_OpenID_MathWrapper which wraps the specified
        // module's functionality.
        if ($loaded)
        {
            return $extension;
        }
    }

    return false;
}
[/code]

After modifying that function the library seemed to work better, but I kept getting a lot of warnings and
errors. To fix them I removed all the pass-by-reference elements (as suggested
[here](http://stackoverflow.com/questions/1245741/openid-in-php-5-3/1482175#1482175)) and added the
`static` keyword to all the static functions. After doing this with a lot of patience, I finally got it
working even using Google as vendor.