Fix http/ssl stream context options.

This commit is contained in:
Dave Longley 2014-03-19 18:55:18 -04:00
parent f77210c1c1
commit c6f06ab52a

View file

@ -1,7 +1,7 @@
<?php <?php
/** /**
* PHP implementation of the JSON-LD API. * PHP implementation of the JSON-LD API.
* Version: 0.2.8 * Version: 0.3.0
* *
* @author Dave Longley * @author Dave Longley
* *
@ -312,14 +312,8 @@ function jsonld_default_document_loader($url) {
'http' => array( 'http' => array(
'method' => 'GET', 'method' => 'GET',
'header' => 'header' =>
"Accept: application/ld+json\r\n" . "Accept: application/ld+json\r\n"),
"User-Agent: JSON-LD PHP Client/1.0\r\n"), 'ssl' => array('verify_peer' => true));
'https' => array(
'verify_peer' => true,
'method' => 'GET',
'header' =>
"Accept: application/ld+json\r\n" .
"User-Agent: JSON-LD PHP Client/1.0\r\n"));
$context = stream_context_create($opts); $context = stream_context_create($opts);
$content_type = null; $content_type = null;
stream_context_set_params($context, array('notification' => stream_context_set_params($context, array('notification' =>
@ -397,12 +391,11 @@ function jsonld_default_secure_document_loader($url) {
// default JSON-LD https GET implementation // default JSON-LD https GET implementation
$opts = array( $opts = array(
'https' => array( 'http' => array(
'verify_peer' => true, 'method' => 'GET',
'method' => "GET",
'header' => 'header' =>
"Accept: application/ld+json\r\n" . "Accept: application/ld+json\r\n"),
"User-Agent: JSON-LD PHP Client/1.0\r\n")); 'ssl' => array('verify_peer' => true));
$context = stream_context_create($opts); $context = stream_context_create($opts);
$content_type = null; $content_type = null;
stream_context_set_params($context, array('notification' => stream_context_set_params($context, array('notification' =>