File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -64,13 +64,13 @@ private function getHTTPResponseCode($url)
64
64
$ ch = curl_init ();
65
65
curl_setopt ($ ch , CURLOPT_URL , $ url );
66
66
curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , 1 );
67
+ // The PHP doc indicates that CURLOPT_CONNECTTIMEOUT_MS constant is added in cURL 7.16.2
68
+ // available since PHP 5.2.3.
69
+ if (!defined (CURLOPT_CONNECTTIMEOUT_MS )) {
70
+ define ('CURLOPT_CONNECTTIMEOUT_MS ' , 156 ); // default value for CURLOPT_CONNECTTIMEOUT_MS
71
+ }
67
72
curl_setopt ($ ch , CURLOPT_CONNECTTIMEOUT_MS , self ::CONNECT_TIMEOUT_MS );
68
- // There is a PHP bug in some versions which didn't define the constant.
69
- curl_setopt (
70
- $ ch ,
71
- 156 , // CURLOPT_CONNECTTIMEOUT_MS
72
- self ::CONNECT_TIMEOUT_MS
73
- );
73
+
74
74
$ code = null ;
75
75
try {
76
76
curl_exec ($ ch );
You can’t perform that action at this time.
0 commit comments