Skip to content

Commit

Permalink
Add driver to config to allow for curl vs native
Browse files Browse the repository at this point in the history
  • Loading branch information
greggilbert committed Dec 14, 2014
1 parent b769409 commit 8851de9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Greggilbert/Recaptcha/CheckRecaptchaV2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 11 additions & 0 deletions src/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8851de9

Please sign in to comment.