diff options
author | Brion Vibber <brion@pobox.com> | 2010-06-29 10:24:48 -0400 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-06-29 10:24:48 -0400 |
commit | 2d920e05d563c9c327cf235b31ce18dfc4a83870 (patch) | |
tree | 31f3cde800220484cd242a8c4138c166307a2dea /extlib/Auth/Yadis/XML.php | |
parent | 923d9ef71ce49bfa55460bf42acb8a35bf3e84be (diff) |
Update the (formerly) Janrain OpenID library to 2.2.2 -- bug fixes including PHP 5.3 compatibility fix.
Upstream release was tagged at: http://github.com/openid/php-openid/commit/a287b2d85e753c84b3b883ed8ee3ffe8692c8477
Diffstat (limited to 'extlib/Auth/Yadis/XML.php')
-rw-r--r-- | extlib/Auth/Yadis/XML.php | 56 |
1 files changed, 17 insertions, 39 deletions
diff --git a/extlib/Auth/Yadis/XML.php b/extlib/Auth/Yadis/XML.php index 81b2ce221..cf1f5c41b 100644 --- a/extlib/Auth/Yadis/XML.php +++ b/extlib/Auth/Yadis/XML.php @@ -310,20 +310,16 @@ $__Auth_Yadis_defaultParser = null; * @param Auth_Yadis_XMLParser $parser An instance of a * Auth_Yadis_XMLParser subclass. */ -function Auth_Yadis_setDefaultParser(&$parser) +function Auth_Yadis_setDefaultParser($parser) { global $__Auth_Yadis_defaultParser; - $__Auth_Yadis_defaultParser =& $parser; + $__Auth_Yadis_defaultParser = $parser; } function Auth_Yadis_getSupportedExtensions() { - return array( - 'dom' => array('classname' => 'Auth_Yadis_dom', - 'libname' => array('dom.so', 'dom.dll')), - 'domxml' => array('classname' => 'Auth_Yadis_domxml', - 'libname' => array('domxml.so', 'php_domxml.dll')), - ); + return array('dom' => 'Auth_Yadis_dom', + 'domxml' => 'Auth_Yadis_domxml'); } /** @@ -332,43 +328,25 @@ function Auth_Yadis_getSupportedExtensions() * Auth_Yadis_setDefaultParser has been called, the parser used in * that call will be returned instead. */ -function &Auth_Yadis_getXMLParser() +function Auth_Yadis_getXMLParser() { global $__Auth_Yadis_defaultParser; - + if (isset($__Auth_Yadis_defaultParser)) { return $__Auth_Yadis_defaultParser; } - - $p = null; - $classname = null; - - $extensions = Auth_Yadis_getSupportedExtensions(); - - // Return a wrapper for the resident implementation, if any. - foreach ($extensions as $name => $params) { - if (!extension_loaded($name)) { - foreach ($params['libname'] as $libname) { - if (@dl($libname)) { - $classname = $params['classname']; - } - } - } else { - $classname = $params['classname']; - } - if (isset($classname)) { - $p = new $classname(); - return $p; - } - } - - if (!isset($p)) { - trigger_error('No XML parser was found', E_USER_ERROR); - } else { + + foreach(Auth_Yadis_getSupportedExtensions() as $extension => $classname) + { + if (extension_loaded($extension)) + { + $p = new $classname(); Auth_Yadis_setDefaultParser($p); + return $p; + } } - - return $p; + + return false; } -?> + |