Commit c8a5c8e3 authored by webchick's avatar webchick

Issue #2052923 by Berdir: Update Guzzle to latest version.

parent edcc7560
......@@ -3,7 +3,7 @@
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
],
"hash": "99355ea2b3166a2c7d7029c8ddc76f4e",
"hash": "eb2c59507a34a3831afe33b16c4d5775",
"packages": [
{
"name": "doctrine/annotations",
......@@ -449,17 +449,17 @@
},
{
"name": "guzzle/common",
"version": "v3.1.2",
"version": "v3.7.1",
"target-dir": "Guzzle/Common",
"source": {
"type": "git",
"url": "git://github.com/guzzle/common.git",
"reference": "v3.1.2"
"url": "https://github.com/guzzle/common.git",
"reference": "v3.7.1"
},
"dist": {
"type": "zip",
"url": "https://github.com/guzzle/common/archive/v3.1.2.zip",
"reference": "v3.1.2",
"url": "https://api.github.com/repos/guzzle/common/zipball/v3.7.1",
"reference": "v3.7.1",
"shasum": ""
},
"require": {
......@@ -469,7 +469,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "3.7-dev"
}
},
"autoload": {
......@@ -489,21 +489,21 @@
"event",
"exception"
],
"time": "2013-01-28 00:07:40"
"time": "2013-07-05 20:17:54"
},
{
"name": "guzzle/http",
"version": "v3.1.2",
"version": "v3.7.1",
"target-dir": "Guzzle/Http",
"source": {
"type": "git",
"url": "git://github.com/guzzle/http.git",
"reference": "v3.1.2"
"url": "https://github.com/guzzle/http.git",
"reference": "v3.7.1"
},
"dist": {
"type": "zip",
"url": "https://github.com/guzzle/http/archive/v3.1.2.zip",
"reference": "v3.1.2",
"url": "https://api.github.com/repos/guzzle/http/zipball/v3.7.1",
"reference": "v3.7.1",
"shasum": ""
},
"require": {
......@@ -518,7 +518,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "3.7-dev"
}
},
"autoload": {
......@@ -546,21 +546,21 @@
"http",
"http client"
],
"time": "2013-01-26 08:20:43"
"time": "2013-07-02 19:53:26"
},
{
"name": "guzzle/parser",
"version": "v3.1.2",
"version": "v3.7.1",
"target-dir": "Guzzle/Parser",
"source": {
"type": "git",
"url": "git://github.com/guzzle/parser.git",
"reference": "v3.1.2"
"url": "https://github.com/guzzle/parser.git",
"reference": "v3.7.1"
},
"dist": {
"type": "zip",
"url": "https://github.com/guzzle/parser/archive/v3.1.2.zip",
"reference": "v3.1.2",
"url": "https://api.github.com/repos/guzzle/parser/zipball/v3.7.1",
"reference": "v3.7.1",
"shasum": ""
},
"require": {
......@@ -569,7 +569,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "3.7-dev"
}
},
"autoload": {
......@@ -590,31 +590,34 @@
"message",
"url"
],
"time": "2013-01-12 21:43:21"
"time": "2013-06-11 00:24:07"
},
{
"name": "guzzle/stream",
"version": "v3.1.2",
"version": "v3.7.1",
"target-dir": "Guzzle/Stream",
"source": {
"type": "git",
"url": "https://github.com/guzzle/stream",
"reference": "v3.0.7"
"url": "https://github.com/guzzle/stream.git",
"reference": "v3.7.1"
},
"dist": {
"type": "zip",
"url": "https://github.com/guzzle/stream/archive/v3.0.7.zip",
"reference": "v3.0.7",
"url": "https://api.github.com/repos/guzzle/stream/zipball/v3.7.1",
"reference": "v3.7.1",
"shasum": ""
},
"require": {
"guzzle/common": "self.version",
"php": ">=5.3.2"
},
"suggest": {
"guzzle/http": "To convert Guzzle request objects to PHP streams"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "3.7-dev"
}
},
"autoload": {
......@@ -640,7 +643,7 @@
"component",
"stream"
],
"time": "2012-12-07 16:45:11"
"time": "2013-06-27 00:50:43"
},
{
"name": "kriswallsmith/assetic",
......
......@@ -45,16 +45,22 @@ public function fetch(Feed $feed) {
try {
$response = $request->send();
// In case of a 304 Not Modified, there is no new content, so return
// FALSE.
if ($response->getStatusCode() == 304) {
return FALSE;
}
$feed->source_string = $response->getBody(TRUE);
$feed->etag = $response->getEtag();
$feed->modified = strtotime($response->getLastModified());
$feed->http_headers = $response->getHeaders();
// Update the feed URL in case of a 301 redirect.
if ($previous_response = $response->getPreviousResponse()) {
if ($previous_response->getStatusCode() == 301 && $location = $previous_response->getLocation()) {
$feed->url->value = $location;
}
if ($response->getEffectiveUrl() != $feed->url->value) {
$feed->url->value = $response->getEffectiveUrl();
}
return TRUE;
}
......
......@@ -236,11 +236,9 @@ function locale_translation_http_check($uri) {
->send();
$result = array();
// In case of a permanent redirected response, return the final location.
if ($previous = $response->getPreviousResponse()) {
if ($previous->getStatusCode() == 301) {
$result['location'] = $previous->getLocation();
}
// Return the effective URL if it differs from the requested.
if ($response->getEffectiveUrl() != $uri) {
$result['location'] = $response->getEffectiveUrl();
}
$result['last_modified'] = $response->getLastModified() ? strtotime($response->getLastModified()) : 0;
......
......@@ -83,20 +83,19 @@ function testStatisticsSettings() {
$this->drupalGet('node/' . $this->test_node->id());
// Manually calling statistics.php, simulating ajax behavior.
$nid = $this->test_node->id();
$post = http_build_query(array('nid' => $nid));
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');
$post = array('nid' => $nid);
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
$this->client->post($stats_path, $headers, $post)->send();
$this->client->post($stats_path, array(), $post)->send();
// Hit the node again (the counter is incremented after the hit, so
// "1 view" will actually be shown when the node is hit the second time).
$this->drupalGet('node/' . $this->test_node->id());
$this->client->post($stats_path, $headers, $post)->send();
$this->client->post($stats_path, array(), $post)->send();
$this->assertText('1 view', 'Node is viewed once.');
$this->drupalGet('node/' . $this->test_node->id());
$this->client->post($stats_path, $headers, $post)->send();
$this->client->post($stats_path, array(), $post)->send();
$this->assertText('2 views', 'Node is viewed 2 times.');
}
......@@ -109,11 +108,10 @@ function testDeleteNode() {
$this->drupalGet('node/' . $this->test_node->id());
// Manually calling statistics.php, simulating ajax behavior.
$nid = $this->test_node->id();
$post = http_build_query(array('nid' => $nid));
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');
$post = array('nid' => $nid);
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
$this->client->post($stats_path, $headers, $post)->send();
$this->client->post($stats_path, array(), $post)->send();
$result = db_select('node_counter', 'n')
->fields('n', array('nid'))
......@@ -144,13 +142,12 @@ function testExpiredLogs() {
$this->drupalGet('node/' . $this->test_node->id());
// Manually calling statistics.php, simulating ajax behavior.
$nid = $this->test_node->id();
$post = http_build_query(array('nid' => $nid));
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');
$post = array('nid' => $nid);
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
$this->client->post($stats_path, $headers, $post)->send();
$this->client->post($stats_path, array(), $post)->send();
$this->drupalGet('node/' . $this->test_node->id());
$this->client->post($stats_path, $headers, $post)->send();
$this->client->post($stats_path, array(), $post)->send();
$this->assertText('1 view', 'Node is viewed once.');
// statistics_cron() will subtract
......
......@@ -85,11 +85,10 @@ function testLogging() {
$this->drupalGet($path);
// Manually calling statistics.php, simulating ajax behavior.
$nid = $this->node->id();
$post = http_build_query(array('nid' => $nid));
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');
$post = array('nid' => $nid);
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
$this->client->post($stats_path, $headers, $post)->send();
$this->client->post($stats_path, array(), $post)->send();
$this->assertIdentical($this->drupalGetHeader('X-Drupal-Cache'), 'MISS', 'Testing an uncached page.');
$node_counter = statistics_get($this->node->id());
$this->assertIdentical($node_counter['totalcount'], '1');
......@@ -97,7 +96,7 @@ function testLogging() {
// Verify logging of a cached page.
$this->drupalGet($path);
// Manually calling statistics.php, simulating ajax behavior.
$this->client->post($stats_path, $headers, $post)->send();
$this->client->post($stats_path, array(), $post)->send();
$this->assertIdentical($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Testing a cached page.');
$node_counter = statistics_get($this->node->id());
$this->assertIdentical($node_counter['totalcount'], '2');
......@@ -106,7 +105,7 @@ function testLogging() {
$this->drupalLogin($this->auth_user);
$this->drupalGet($path);
// Manually calling statistics.php, simulating ajax behavior.
$this->client->post($stats_path, $headers, $post)->send();
$this->client->post($stats_path, array(), $post)->send();
$node_counter = statistics_get($this->node->id());
$this->assertIdentical($node_counter['totalcount'], '3');
......
......@@ -80,12 +80,11 @@ public function testNodeCounterIntegration() {
$this->drupalGet('node/' . $this->node->id());
// Manually calling statistics.php, simulating ajax behavior.
// @see \Drupal\statistics\Tests\StatisticsLoggingTest::testLogging().
$post = http_build_query(array('nid' => $this->node->id()));
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
$client = \Drupal::httpClient();
$client->setConfig(array('curl.options' => array(CURLOPT_TIMEOUT => 10)));
$client->post($stats_path, array(), $post)->send();
$client->post($stats_path, array(), array('nid' => $this->node->id()))->send();
$this->drupalGet('test_statistics_integration');
$expected = statistics_get($this->node->id());
......
......@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInitae9396db2008f9b266cde1fb85dfa4f8::getLoader();
return ComposerAutoloaderInit3a4905090abf2f2252330204ffd02eb8::getLoader();
......@@ -2,7 +2,7 @@
// autoload_real.php generated by Composer
class ComposerAutoloaderInitae9396db2008f9b266cde1fb85dfa4f8
class ComposerAutoloaderInit3a4905090abf2f2252330204ffd02eb8
{
private static $loader;
......@@ -19,9 +19,9 @@ public static function getLoader()
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitae9396db2008f9b266cde1fb85dfa4f8', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit3a4905090abf2f2252330204ffd02eb8', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitae9396db2008f9b266cde1fb85dfa4f8', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit3a4905090abf2f2252330204ffd02eb8', 'loadClassLoader'));
$vendorDir = dirname(__DIR__);
$baseDir = dirname(dirname($vendorDir));
......
......@@ -533,209 +533,6 @@
"description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com"
},
{
"name": "guzzle/common",
"version": "v3.1.2",
"version_normalized": "3.1.2.0",
"target-dir": "Guzzle/Common",
"source": {
"type": "git",
"url": "git://github.com/guzzle/common.git",
"reference": "v3.1.2"
},
"dist": {
"type": "zip",
"url": "https://github.com/guzzle/common/archive/v3.1.2.zip",
"reference": "v3.1.2",
"shasum": ""
},
"require": {
"php": ">=5.3.2",
"symfony/event-dispatcher": ">=2.1"
},
"time": "2013-01-28 00:07:40",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"Guzzle\\Common": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Common libraries used by Guzzle",
"homepage": "http://guzzlephp.org/",
"keywords": [
"collection",
"common",
"event",
"exception"
]
},
{
"name": "guzzle/stream",
"version": "v3.1.2",
"version_normalized": "3.1.2.0",
"target-dir": "Guzzle/Stream",
"source": {
"type": "git",
"url": "https://github.com/guzzle/stream",
"reference": "v3.0.7"
},
"dist": {
"type": "zip",
"url": "https://github.com/guzzle/stream/archive/v3.0.7.zip",
"reference": "v3.0.7",
"shasum": ""
},
"require": {
"guzzle/common": "self.version",
"php": ">=5.3.2"
},
"time": "2012-12-07 16:45:11",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"Guzzle\\Stream": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "Guzzle stream wrapper component",
"homepage": "http://guzzlephp.org/",
"keywords": [
"Guzzle",
"component",
"stream"
]
},
{
"name": "guzzle/parser",
"version": "v3.1.2",
"version_normalized": "3.1.2.0",
"target-dir": "Guzzle/Parser",
"source": {
"type": "git",
"url": "git://github.com/guzzle/parser.git",
"reference": "v3.1.2"
},
"dist": {
"type": "zip",
"url": "https://github.com/guzzle/parser/archive/v3.1.2.zip",
"reference": "v3.1.2",
"shasum": ""
},
"require": {
"php": ">=5.3.2"
},
"time": "2013-01-12 21:43:21",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"Guzzle\\Parser": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Interchangeable parsers used by Guzzle",
"homepage": "http://guzzlephp.org/",
"keywords": [
"URI Template",
"cookie",
"http",
"message",
"url"
]
},
{
"name": "guzzle/http",
"version": "v3.1.2",
"version_normalized": "3.1.2.0",
"target-dir": "Guzzle/Http",
"source": {
"type": "git",
"url": "git://github.com/guzzle/http.git",
"reference": "v3.1.2"
},
"dist": {
"type": "zip",
"url": "https://github.com/guzzle/http/archive/v3.1.2.zip",
"reference": "v3.1.2",
"shasum": ""
},
"require": {
"guzzle/common": "self.version",
"guzzle/parser": "self.version",
"guzzle/stream": "self.version",
"php": ">=5.3.2"
},
"suggest": {
"ext-curl": "*"
},
"time": "2013-01-26 08:20:43",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"Guzzle\\Http": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
}
],
"description": "HTTP libraries used by Guzzle",
"homepage": "http://guzzlephp.org/",
"keywords": [
"Guzzle",
"client",
"curl",
"http",
"http client"
]
},
{
"name": "symfony/process",
"version": "v2.3.1",
......@@ -2060,5 +1857,211 @@
"persistence",
"spl"
]
},
{
"name": "guzzle/common",
"version": "v3.7.1",
"version_normalized": "3.7.1.0",
"target-dir": "Guzzle/Common",
"source": {
"type": "git",
"url": "https://github.com/guzzle/common.git",
"reference": "v3.7.1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/guzzle/common/zipball/v3.7.1",
"reference": "v3.7.1",
"shasum": ""
},
"require": {
"php": ">=5.3.2",
"symfony/event-dispatcher": ">=2.1"
},
"time": "2013-07-05 20:17:54",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.7-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"Guzzle\\Common": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"