array( 'method'=>$method, 'timeout'=>$timeOut, 'follow_location'=>$followRedirections ), "ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false ) ); $stream = stream_context_create($options); $output = file_get_contents($url, false, $stream); } return $output; } public static function download($url, $destination) { $data = self::http($url, $method='GET', $verifySSL=true, $timeOut=3, $followRedirections=true, $binary=true, $headers=false); return file_put_contents($destination, $data); } }