diff --git a/core/composer.lock b/core/composer.lock index 4e155f1c7769..c7fa933d3ae6 100644 --- a/core/composer.lock +++ b/core/composer.lock @@ -737,16 +737,16 @@ }, { "name": "fabpot/goutte", - "version": "v3.1.0", + "version": "v3.1.1", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/Goutte.git", - "reference": "d9a5a28782d30e9f4e20176caea58a1d459f2c71" + "reference": "751a3dc5c4d86ec3e97c9f27133ef9694d9243cc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/d9a5a28782d30e9f4e20176caea58a1d459f2c71", - "reference": "d9a5a28782d30e9f4e20176caea58a1d459f2c71", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/751a3dc5c4d86ec3e97c9f27133ef9694d9243cc", + "reference": "751a3dc5c4d86ec3e97c9f27133ef9694d9243cc", "shasum": "" }, "require": { @@ -782,7 +782,7 @@ "keywords": [ "scraper" ], - "time": "2015-06-24 16:11:31" + "time": "2015-08-29 16:16:56" }, { "name": "guzzlehttp/guzzle", diff --git a/core/vendor/composer/ClassLoader.php b/core/vendor/composer/ClassLoader.php index 5e1469e8307d..4e05d3b15834 100644 --- a/core/vendor/composer/ClassLoader.php +++ b/core/vendor/composer/ClassLoader.php @@ -351,7 +351,7 @@ class ClassLoader foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { if (0 === strpos($class, $prefix)) { foreach ($this->prefixDirsPsr4[$prefix] as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { + if (is_file($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { return $file; } } @@ -361,7 +361,7 @@ class ClassLoader // PSR-4 fallback dirs foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { return $file; } } @@ -380,7 +380,7 @@ class ClassLoader foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { if (0 === strpos($class, $prefix)) { foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } @@ -390,7 +390,7 @@ class ClassLoader // PSR-0 fallback dirs foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + if (is_file($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { return $file; } } diff --git a/core/vendor/composer/installed.json b/core/vendor/composer/installed.json index e7c44d1224e1..dc5a7b673dca 100644 --- a/core/vendor/composer/installed.json +++ b/core/vendor/composer/installed.json @@ -1255,57 +1255,6 @@ "web service" ] }, - { - "name": "fabpot/goutte", - "version": "v3.1.0", - "version_normalized": "3.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/FriendsOfPHP/Goutte.git", - "reference": "d9a5a28782d30e9f4e20176caea58a1d459f2c71" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/d9a5a28782d30e9f4e20176caea58a1d459f2c71", - "reference": "d9a5a28782d30e9f4e20176caea58a1d459f2c71", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^6.0", - "php": ">=5.5.0", - "symfony/browser-kit": "~2.1", - "symfony/css-selector": "~2.1", - "symfony/dom-crawler": "~2.1" - }, - "time": "2015-06-24 16:11:31", - "type": "application", - "extra": { - "branch-alias": { - "dev-master": "3.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Goutte\\": "Goutte" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "A simple PHP Web Scraper", - "homepage": "https://github.com/FriendsOfPHP/Goutte", - "keywords": [ - "scraper" - ] - }, { "name": "behat/mink-goutte-driver", "version": "dev-master", @@ -3486,5 +3435,56 @@ "keywords": [ "templating" ] + }, + { + "name": "fabpot/goutte", + "version": "v3.1.1", + "version_normalized": "3.1.1.0", + "source": { + "type": "git", + "url": "https://github.com/FriendsOfPHP/Goutte.git", + "reference": "751a3dc5c4d86ec3e97c9f27133ef9694d9243cc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/751a3dc5c4d86ec3e97c9f27133ef9694d9243cc", + "reference": "751a3dc5c4d86ec3e97c9f27133ef9694d9243cc", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "symfony/browser-kit": "~2.1", + "symfony/css-selector": "~2.1", + "symfony/dom-crawler": "~2.1" + }, + "time": "2015-08-29 16:16:56", + "type": "application", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Goutte\\": "Goutte" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A simple PHP Web Scraper", + "homepage": "https://github.com/FriendsOfPHP/Goutte", + "keywords": [ + "scraper" + ] } ] diff --git a/core/vendor/fabpot/goutte/Goutte/Client.php b/core/vendor/fabpot/goutte/Goutte/Client.php index 609595d733d2..1474578865b9 100644 --- a/core/vendor/fabpot/goutte/Goutte/Client.php +++ b/core/vendor/fabpot/goutte/Goutte/Client.php @@ -17,6 +17,7 @@ use GuzzleHttp\Cookie\CookieJar; use GuzzleHttp\Exception\RequestException; use Psr\Http\Message\ResponseInterface; use Symfony\Component\BrowserKit\Client as BaseClient; +use Symfony\Component\BrowserKit\Request; use Symfony\Component\BrowserKit\Response; /** @@ -75,6 +76,11 @@ class Client extends BaseClient return $this; } + /** + * @param Request $request + * + * @return Response + */ protected function doRequest($request) { $headers = array(); @@ -92,7 +98,7 @@ class Client extends BaseClient $cookies = CookieJar::fromArray( $this->getCookieJar()->allRawValues($request->getUri()), - $request->getServer()['HTTP_HOST'] + parse_url($request->getUri(), PHP_URL_HOST) ); $requestOptions = array( diff --git a/core/vendor/fabpot/goutte/Goutte/Tests/ClientTest.php b/core/vendor/fabpot/goutte/Goutte/Tests/ClientTest.php index f10d8fbea0df..8c2b0a512cbb 100644 --- a/core/vendor/fabpot/goutte/Goutte/Tests/ClientTest.php +++ b/core/vendor/fabpot/goutte/Goutte/Tests/ClientTest.php @@ -114,6 +114,17 @@ class ClientTest extends \PHPUnit_Framework_TestCase $this->assertEquals('test=123', $request->getHeaderLine('Cookie')); } + public function testUsesCookiesWithCustomPort() + { + $guzzle = $this->getGuzzle(); + $client = new Client(); + $client->setClient($guzzle); + $client->getCookieJar()->set(new Cookie('test', '123')); + $client->request('GET', 'http://www.example.com:8000/'); + $request = end($this->history)['request']; + $this->assertEquals('test=123', $request->getHeaderLine('Cookie')); + } + public function testUsesPostFiles() { $guzzle = $this->getGuzzle(); diff --git a/core/vendor/fabpot/goutte/README.rst b/core/vendor/fabpot/goutte/README.rst index c1ade391f54f..abd847ea0823 100644 --- a/core/vendor/fabpot/goutte/README.rst +++ b/core/vendor/fabpot/goutte/README.rst @@ -13,8 +13,11 @@ Goutte depends on PHP 5.5+ and Guzzle 6+. .. tip:: - If you need support for PHP 5.4 or Guzzle 4-5, use Goutte 2.x. - If you need support for PHP 5.3 or Guzzle 3, use Goutte 1.x. + If you need support for PHP 5.4 or Guzzle 4-5, use Goutte 2.x (latest `phar + `_). + + If you need support for PHP 5.3 or Guzzle 3, use Goutte 1.x (latest `phar + `_). Installation ------------ @@ -25,17 +28,6 @@ Add ``fabpot/goutte`` as a require dependency in your ``composer.json`` file: composer require fabpot/goutte -.. tip:: - - You can also download the `Goutte.phar`_ file: - - .. code-block:: php - - require_once '/path/to/goutte.phar'; - - The phars for Goutte 1.x are also available for `download - `. - Usage ----- @@ -119,6 +111,5 @@ License Goutte is licensed under the MIT license. -.. _`Composer`: http://getcomposer.org -.. _`Goutte.phar`: http://get.sensiolabs.org/goutte.phar -.. _`Guzzle`: http://docs.guzzlephp.org +.. _`Composer`: http://getcomposer.org +.. _`Guzzle`: http://docs.guzzlephp.org