File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed
src/Optimizely/Event/Dispatcher Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -28,18 +28,13 @@ class CurlEventDispatcher implements EventDispatcherInterface
2828{
2929 public function dispatchEvent (LogEvent $ event )
3030 {
31- $ curl = curl_init ();
32- $ options = [
33- CURLOPT_URL => $ event ->getUrl (),
34- CURLOPT_HTTPHEADER => $ event ->getHeaders (),
35- CURLOPT_POSTFIELDS => http_build_query ($ event ->getParams ()),
36- CURLOPT_POST => 1 ,
37- CURLOPT_RETURNTRANSFER => true ,
38- CURLOPT_CONNECTTIMEOUT_MS => 1
39- ];
40-
41- curl_setopt_array ($ curl , $ options );
42- curl_exec ($ curl );
43- curl_close ($ curl );
31+ $ cmd = "curl " ;
32+ $ cmd .= " -X " .$ event ->getHttpVerb ();
33+ foreach ($ event ->getHeaders () as $ type => $ value ) {
34+ $ cmd .= " -H ' " .$ type .": " .$ value ."' " ;
35+ }
36+ $ cmd .= " -d ' " .json_encode ($ event ->getParams ())."' " ;
37+ $ cmd .= " ' " .$ event ->getUrl ()."' > /dev/null 2>&1 & " ;
38+ exec ($ cmd );
4439 }
4540}
You can’t perform that action at this time.
0 commit comments