Skip to content

Commit d77dfa1

Browse files
committed
Curl based event dispatcher
1 parent 91b29d3 commit d77dfa1

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/Optimizely/Event/Dispatcher/CurlEventDispatcher.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ class CurlEventDispatcher implements EventDispatcherInterface
2828
{
2929
public function dispatchEvent(LogEvent $event)
3030
{
31-
31+
$curl = curl_init();
32+
$options = [
33+
CURLOPT_URL => $event->getUrl(),
34+
CURLOPT_HEADER => $event->getHeaders(),
35+
CURLOPT_POSTFIELDS => http_build_query($event->getParams()),
36+
CURLOPT_POST => 1,
37+
CURLOPT_CONNECTTIMEOUT_MS => 1
38+
];
39+
40+
curl_setopt_array($curl, $options);
41+
curl_exec($curl);
42+
curl_close($curl);
3243
}
33-
}
44+
}

0 commit comments

Comments
 (0)