From 8851de90faa958b7966a9d86b4013cf1dabc09bd Mon Sep 17 00:00:00 2001 From: Greg Date: Sun, 14 Dec 2014 13:41:06 -0500 Subject: [PATCH] Add driver to config to allow for curl vs native --- src/Greggilbert/Recaptcha/CheckRecaptchaV2.php | 2 +- src/config/config.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Greggilbert/Recaptcha/CheckRecaptchaV2.php b/src/Greggilbert/Recaptcha/CheckRecaptchaV2.php index 659a903..2556dd5 100644 --- a/src/Greggilbert/Recaptcha/CheckRecaptchaV2.php +++ b/src/Greggilbert/Recaptcha/CheckRecaptchaV2.php @@ -26,7 +26,7 @@ public function check($challenge, $response) $checkResponse = null; // prefer curl, but fall back to file_get_contents - if(function_exists('curl_version')) + if('curl' === app('config')->get('recaptcha::config.driver') && function_exists('curl_version')) { $curl = curl_init($url); curl_setopt($curl, CURLOPT_HEADER, false); diff --git a/src/config/config.php b/src/config/config.php index f27e03b..2ce57fc 100644 --- a/src/config/config.php +++ b/src/config/config.php @@ -26,6 +26,17 @@ */ 'template' => '', + /* + |-------------------------------------------------------------------------- + | Driver + |-------------------------------------------------------------------------- + | + | Determine how to call out to get response; values are 'curl' or 'native'. + | Only applies to v2. + | + */ + 'driver' => 'curl', + /* |-------------------------------------------------------------------------- | Version