src/Geocoder.php
private function call($url)
        {
        $handle = curl_init();

        // set the options
        curl_setopt($handle, CURLOPT_URL, $url);
        curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($handle, CURLOPT_ENCODING, "");
        curl_setopt($handle, CURLOPT_MAXREDIRS, 10);
        curl_setopt($handle, CURLOPT_TIMEOUT, 30);
        curl_setopt($handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
        curl_setopt($handle, CURLOPT_CUSTOMREQUEST, "GET");

        // make the call
        $output = curl_exec($handle);
        if ($output == false)
            {
            $this->error["code"]    = "BadConnection";
            $this->error["message"] = curl_error($handle);
            }

        curl_close($handle);

        // return the json
        return $output;
        }
private function call($url)
        {
        $handle = curl_init();

        // set the options
        curl_setopt($handle, CURLOPT_URL, $url);
        curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($handle, CURLOPT_ENCODING, "");
        curl_setopt($handle, CURLOPT_MAXREDIRS, 10);
        curl_setopt($handle, CURLOPT_TIMEOUT, 30);
        curl_setopt($handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
        curl_setopt($handle, CURLOPT_CUSTOMREQUEST, "GET");

        // make the call
        $output = curl_exec($handle);
        if ($output == false)
            {
            $this->error["code"]    = "BadConnection";
            $this->error["message"] = curl_error($handle);
            }

        curl_close($handle);

        // return the json
        return $output;
        }
private function call ( $ url ) { $ handle = curl_init ( ) ; // set the options curl_setopt ( $ handle , CURLOPT_URL , $ url ) ; curl_setopt ( $ handle , CURLOPT_RETURNTRANSFER , true ) ; curl_setopt ( $ handle , CURLOPT_ENCODING , "" ) ; curl_setopt ( $ handle , CURLOPT_MAXREDIRS , 10 ) ; curl_setopt ( $ handle , CURLOPT_TIMEOUT , 30 ) ; curl_setopt ( $ handle , CURLOPT_HTTP_VERSION , CURL_HTTP_VERSION_1_1 ) ; curl_setopt ( $ handle , CURLOPT_CUSTOMREQUEST , "GET" ) ; // make the call $ output = curl_exec ( $ handle ) ; if ( $ output == false ) { $ this -> error [ "code" ] = "BadConnection" ; $ this -> error [ "message" ] = curl_error ( $ handle ) ; } curl_close ( $ handle ) ; // return the json return $ output ; }
Make the call to the API server
Make the call to the API server