Issue #2400407 by DuaelFr: Ensure vendor fabpot/goutte is on latest stable release
parent
3e646a2f52
commit
836574f2cf
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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
|
||||
<https://github.com/FriendsOfPHP/Goutte/releases/download/v2.0.4/goutte-v2.0.4.phar>`_).
|
||||
|
||||
If you need support for PHP 5.3 or Guzzle 3, use Goutte 1.x (latest `phar
|
||||
<https://github.com/FriendsOfPHP/Goutte/releases/download/v1.0.7/goutte-v1.0.7.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
|
||||
<http://get.sensiolabs.org/goutte-v1.0.7.phar>`.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
|
|
@ -120,5 +112,4 @@ 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
|
||||
|
|
|
|||
Loading…
Reference in New Issue