summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2007-04-02 22:28:59 +0000
committertailor <cygnus@janrain.com>2007-04-02 22:28:59 +0000
commitecbbb96cb663bd80a73a4c84484bf1335c31e73b (patch)
treef6df27a1f19ef5bdc28da161e9af3d0079bab645
parent8d4af1add86ed970d463f74d48aad4b7986165e6 (diff)
downloadphp-openid-ecbbb96cb663bd80a73a4c84484bf1335c31e73b.zip
php-openid-ecbbb96cb663bd80a73a4c84484bf1335c31e73b.tar.gz
php-openid-ecbbb96cb663bd80a73a4c84484bf1335c31e73b.tar.bz2
[project @ Add CURL override for testing]
-rw-r--r--Auth/Yadis/Yadis.php6
-rw-r--r--admin/texttest.php4
2 files changed, 9 insertions, 1 deletions
diff --git a/Auth/Yadis/Yadis.php b/Auth/Yadis/Yadis.php
index b6dad09..064b5e2 100644
--- a/Auth/Yadis/Yadis.php
+++ b/Auth/Yadis/Yadis.php
@@ -200,10 +200,14 @@ class Auth_Yadis_Yadis {
* present, an instance of {@link Auth_Yadis_ParanoidHTTPFetcher}
* is returned. If not, an instance of
* {@link Auth_Yadis_PlainHTTPFetcher} is returned.
+ *
+ * If Auth_Yadis_CURL_OVERRIDE is defined, this method will always
+ * return a {@link Auth_Yadis_PlainHTTPFetcher}.
*/
function getHTTPFetcher($timeout = 20)
{
- if (Auth_Yadis_Yadis::curlPresent()) {
+ if (Auth_Yadis_Yadis::curlPresent() &&
+ (!defined('Auth_Yadis_CURL_OVERRIDE'))) {
$fetcher = new Auth_Yadis_ParanoidHTTPFetcher($timeout);
} else {
$fetcher = new Auth_Yadis_PlainHTTPFetcher($timeout);
diff --git a/admin/texttest.php b/admin/texttest.php
index 5564aae..bb01eee 100644
--- a/admin/texttest.php
+++ b/admin/texttest.php
@@ -45,6 +45,7 @@ function microtime_float()
}
$longopts = array('no-math',
+ 'no-curl',
'math-lib=',
'insecure-rand',
'thorough');
@@ -72,6 +73,9 @@ foreach ($flags as $flag) {
case '--no-math':
define('Auth_OpenID_NO_MATH_SUPPORT', true);
break;
+ case '--no-curl':
+ define('Auth_Yadis_CURL_OVERRIDE', true);
+ break;
case '--math-lib':
$math_type[] = $value;
break;