-
Notifications
You must be signed in to change notification settings - Fork 61
Decouple from HTTP client library #173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
language: php | ||
|
||
php: | ||
- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
|
@@ -13,20 +12,21 @@ env: | |
|
||
matrix: | ||
include: | ||
- php: 5.5 | ||
env: VARNISH_VERSION=3.0 | ||
- php: 5.3 | ||
env: SYMFONY_VERSION=2.3.* VARNISH_VERSION=4.0 COMPOSER_FLAGS="--prefer-lowest" | ||
- php: 5.4 | ||
env: SYMFONY_VERSION=2.3.* VARNISH_VERSION=3.0 COMPOSER_FLAGS="--prefer-lowest" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we completely drop varnish 3 support? otherwise we should keep this. maybe as a second --prefer-lowest run. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I can see Varnish 3 became THE lowest supported one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Varnish 3.0 is still included: see https://github.com/FriendsOfSymfony/FOSHttpCache/pull/173/files#diff-354f30a63fb0907d4ad57269548329e3R20. |
||
branches: | ||
only: | ||
- master | ||
# Build maintenance branches for older releases if needed. such branches should be named like "1.2" | ||
- '/^\d+\.\d+$/' | ||
|
||
install: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Composer setup should be done in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
- if [[ "$TRAVIS_PHP_VERSION" == "5.4" || "$TRAVIS_PHP_VERSION" == "hhvm" ]]; then composer remove "php-http/guzzle6-adapter" --dev --no-update; fi | ||
- if [[ "$TRAVIS_PHP_VERSION" == "5.4" || "$TRAVIS_PHP_VERSION" == "hhvm" ]]; then composer require "php-http/guzzle5-adapter" --dev --no-update; fi | ||
- composer update $COMPOSER_FLAGS --prefer-source --no-interaction | ||
|
||
before_script: | ||
# Install deps | ||
- composer update $COMPOSER_FLAGS --dev --prefer-source --no-interaction | ||
# Install Varnish | ||
- curl http://repo.varnish-cache.org/debian/GPG-key.txt | sudo apt-key add - | ||
- echo "deb http://repo.varnish-cache.org/ubuntu/ precise varnish-${VARNISH_VERSION}" | sudo tee -a /etc/apt/sources.list | ||
|
@@ -36,7 +36,6 @@ before_script: | |
# Install NGINX | ||
- sh ./tests/install-nginx.sh | ||
# Starting webserver | ||
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3' ]; then ./tests/ci/install-apache.sh; fi" | ||
- sh -c "if [ '$TRAVIS_PHP_VERSION' = 'hhvm' ]; then ./tests/ci/install-apache-hhvm.sh; fi" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets also delete the bash file There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
|
||
script: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,20 @@ Changelog | |
|
||
See also the [GitHub releases page](https://github.com/FriendsOfSymfony/FOSHttpCache/releases). | ||
|
||
2.0.0 (unreleased) | ||
------------------ | ||
|
||
* Replace hard coupling on Guzzle HTTP client with HTTP adapter. | ||
* The NGINX purge location is no longer passed as constructor argument but by | ||
calling `setPurgeLocation()`. | ||
* In ProxyTestCase, `getHttpClient()` has been replaced with `getHttpAdapter()`; | ||
added HTTP method parameter to `getResponse()`. | ||
|
||
1.4.0 | ||
----- | ||
|
||
* Added symfony/http-kernel [HttpCache client](http://foshttpcache.readthedocs.org/en/latest/proxy-clients.html#symfony-client). | ||
* Added [SymfonyTestCase](http://foshttpcache.readthedocs.org/en/latest/testing-your-application.html#symfonytestcase). | ||
* Added symfony/http-kernel [HttpCache client](http://foshttpcache.readthedocs.org/en/stable/proxy-clients.html#symfony-client). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. even this will at some point no longer work. can we have a 1.4 thing on readthedocs? also, can we add some warning on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added 1.4.0 to the docs. If we decide to bring out more updates for 1.0, this may become cumbersome. In that case, a 1.0 branch (and building the docs for that) are preferred. |
||
* Added [SymfonyTestCase](http://foshttpcache.readthedocs.org/en/stable/testing-your-application.html#symfonytestcase). | ||
* Removed unneeded files from dist packages. | ||
|
||
1.3.2 | ||
|
@@ -19,17 +28,17 @@ See also the [GitHub releases page](https://github.com/FriendsOfSymfony/FOSHttpC | |
----- | ||
|
||
* Added authentication support to user context subscribe. | ||
* Fixed usage of deprecated Guzzle subtree splits. | ||
* Fixed usage of deprecated Guzzle subtree splits. | ||
* Fixed exposed cache tags. | ||
|
||
1.3.0 | ||
----- | ||
|
||
* Added [TagHandler](http://foshttpcache.readthedocs.org/en/latest/invalidation-handlers.html#tag-handler). | ||
* Added [TagHandler](http://foshttpcache.readthedocs.org/en/stable/invalidation-handlers.html#tag-handler). | ||
* It is no longer possible to change the event dispatcher of the | ||
CacheInvalidator once its instantiated. If you need a custom dispatcher, set | ||
it right after creating the invalidator instance. | ||
* Deprecated `CacheInvalidator::addSubscriber` in favor of either using the event | ||
CacheInvalidator once its instantiated. If you need a custom dispatcher, set | ||
it right after creating the invalidator instance. | ||
* Deprecated `CacheInvalidator::addSubscriber` in favor of either using the event | ||
dispatcher instance you inject or doing `getEventDispatcher()->addSubscriber($subscriber)`. | ||
|
||
1.2.0 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,14 +21,19 @@ | |
} | ||
], | ||
"require": { | ||
"php": ">=5.3.3", | ||
"guzzle/guzzle": "~3.8", | ||
"php": ">=5.4.8", | ||
"symfony/event-dispatcher": "~2.3", | ||
"symfony/options-resolver": "~2.3" | ||
"symfony/options-resolver": "~2.3", | ||
"psr/http-message-implementation": "~1.0", | ||
"php-http/adapter-implementation": "^0.1.0", | ||
"php-http/discovery": "^0.1.1", | ||
"php-http/message-decorator": "^0.1.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got rid of the Guzzle dependency. We now only have generic and virtual dependencies for the HTTP client. |
||
}, | ||
"require-dev": { | ||
"mockery/mockery": "~0.9.1", | ||
"monolog/monolog": "~1.0", | ||
"php-http/guzzle6-adapter": "^0.1.0", | ||
"guzzlehttp/psr7": "^1.0", | ||
"symfony/process": "~2.3", | ||
"symfony/http-kernel": "~2.3" | ||
}, | ||
|
@@ -47,7 +52,7 @@ | |
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "1.4.x-dev" | ||
"dev-master": "2.0.x-dev" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updating the alias. Do we still want to create a 1.0 branch? I say let’s just stick to our old plan of not maintaining parallel branches (as long we can get away with doing so) and upping master to 2.0. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can always create a branch from the latest 1.4 tag if there is
something we need to fix urgently.
|
||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
This allows you to pass headers that are different between purge requests. | ||
If you want to add a header to all purge requests, such as ``Authorization``, | ||
use a :ref:`custom Guzzle client <custom Guzzle client>` instead. | ||
:ref:`configure the HTTP adapter <HTTP adapter configuration>` to use a | ||
custom HTTP client instead. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ hostnames | |
http | ||
invalidator | ||
localhost | ||
middleware | ||
middlewares | ||
nginx | ||
roundtrip | ||
symfony | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,16 @@ | |
* A collection of exceptions that might occur during the flush operation of a | ||
* ProxyClientInterface implementation | ||
*/ | ||
class ExceptionCollection extends \Exception implements \IteratorAggregate, \Countable, HttpCacheExceptionInterface | ||
class ExceptionCollection extends \Exception implements \IteratorAggregate, \Countable, HttpCacheExceptionInterface | ||
{ | ||
private $exceptions = array(); | ||
|
||
public function __construct(array $exceptions = array()) | ||
{ | ||
foreach ($exceptions as $exception) { | ||
$this->add($exception); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should the add method become private? kind of unrelated to this PR but when we start refactoring for 2.0 anyways... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #163 (comment). |
||
} | ||
} | ||
|
||
/** | ||
* Add an exception to the collection | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we use Guzzle 6 as our testing client, which requires PHP 5.5, we can no longer test 5.4 (we’re dropping 5.3 support anyway). Is this reason enough to switch to Guzzle 5? It’s, of course, a temporary problem: PHP 5.4 will be EOL in 3 months.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being EOL doesn't mean you have to drop 5.4. Since in the HTTP interfaces nothing indicates that you need 5.5, I would say try to test against 5.4 as well, even if it means you need a lower version. I would do the following: If the travis php version is 5.4 then remove guzzle6-adapter and install guzzle5-adapter. The guesser will always find the class for you. This way you can test against 5.4. See how it is done in php-http/discovery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that in this case you have to require a message implementation as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, going to do that.