You are here

protected function DeployServiceRest::fetchContext in Deploy - Content Staging 7.2

Same name and namespace in other branches
  1. 7.3 includes/DeployServiceRest.inc \DeployServiceRest::fetchContext()

Fetches the context for the HTTP request.

Return value

resource The stream context resource.

See also

stream_context_create()

1 call to DeployServiceRest::fetchContext()
DeployServiceRest::__construct in includes/DeployServiceRest.inc
Constructor for a service plugin.

File

includes/DeployServiceRest.inc, line 105
Implementation of a REST based client for deploying entities.

Class

DeployServiceRest
Base class for REST-based service plugins.

Code

protected function fetchContext() {
  $verify_ssl = variable_get('deploy_verify_ssl', TRUE);
  $context_options = array(
    'ssl' => array(
      'verify_peer' => $verify_ssl,
      'verify_peer_name' => $verify_ssl,
      'allow_self_signed' => !$verify_ssl,
    ),
  );
  $context = stream_context_create($context_options);
  return $context;
}