File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,19 @@ class Guzzle implements RequestResolverInterface
2121 */
2222 protected $ response ;
2323
24+ protected $ defaultConfig = [
25+ 'verify ' => false ,
26+ 'timeout ' => 10 ,
27+ 'connect_timeout ' => 20 ,
28+ 'headers ' => [
29+ 'User-Agent ' => 'Embed PHP Library ' ,
30+ ],
31+ 'allow_redirects ' => [
32+ 'max ' => 20 ,
33+ 'referer ' => true ,
34+ ],
35+ ];
36+
2437 /**
2538 * Constructor. Sets the url
2639 *
@@ -29,7 +42,10 @@ class Guzzle implements RequestResolverInterface
2942 */
3043 public function __construct ($ url , array $ config )
3144 {
32- $ this ->client = isset ($ config ['client ' ]) ? $ config ['client ' ] : new Client ();
45+ $ this ->client = isset ($ config ['client ' ]) ? $ config ['client ' ] : new Client ([
46+ 'defaults ' => $ this ->defaultConfig ,
47+ ]);
48+
3349 $ this ->request = $ this ->client ->createRequest ('GET ' , $ url );
3450 }
3551
Original file line number Diff line number Diff line change 11<?php
22error_reporting (E_ALL );
33
4+ if (file_exists (__DIR__ . '/../vendor/autoload.php ' )) {
5+ require_once (__DIR__ . '/../vendor/autoload.php ' );
6+ }
7+
48include_once dirname (__DIR__ ).'/src/autoloader.php ' ;
59include_once __DIR__ .'/TestCaseBase.php ' ;
610
You can’t perform that action at this time.
0 commit comments