Improve coding conventions

This commit is contained in:
Kevin Wenger 2015-06-12 10:45:55 +02:00
parent 660b2ddcc2
commit 1eab9c4f5c

View file

@ -8,20 +8,22 @@ class GooglePlacesClient
{
$curl = curl_init();
$ssl_verifypeer = true;
// Remove ssl certificate verification for Windows
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')
{
$ssl_verifypeer = false;
}
$options = array(
CURLOPT_URL => $url,
CURLOPT_HEADER => false,
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_SSL_VERIFYPEER => $ssl_verifypeer,
CURLOPT_RETURNTRANSFER => true,
);
curl_setopt_array($curl, $options);
// Add certificate for Windows
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
}
$response = curl_exec($curl);
if ($error = curl_error($curl))