You are here

protected function PhpCurlHttpClient::getCurlResource in Backup and Migrate 5.0.x

Get the CURL Resource with default options.

Parameters

$url:

Return value

resource

1 call to PhpCurlHttpClient::getCurlResource()
PhpCurlHttpClient::post in src/Core/Service/PhpCurlHttpClient.php
Post the given data (as a string or an array) to the given URL.

File

src/Core/Service/PhpCurlHttpClient.php, line 64

Class

PhpCurlHttpClient
@package Drupal\backup_migrate\Core\Service

Namespace

Drupal\backup_migrate\Core\Service

Code

protected function getCurlResource($url) {
  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_FAILONERROR, TRUE);
  return $ch;
}