Skip to content

Commit 092d841

Browse files
committed
Use new packages, remove php-http/plugins
1 parent 3bc3559 commit 092d841

File tree

4 files changed

+7
-20
lines changed

4 files changed

+7
-20
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Make sure you configure the Httplug plugins as needed,
1313
for example if you want to get exceptions for failure HTTP status codes.
1414
- **[BC] PluginClientFactory returns an instance of `Http\Client\Common\PluginClient`** (see [php-http/client-common#14](https://github.com/php-http/client-common/pull/14))
15-
- Plugins are loaded from their new packages, fall back to `php-http/plugins` if necessary
15+
- Plugins are loaded from their new packages
1616

1717

1818
### Fixed

DependencyInjection/HttplugExtension.php

-15
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
namespace Http\HttplugBundle\DependencyInjection;
44

55
use Http\Client\Common\Plugin\AuthenticationPlugin;
6-
use Http\Client\Common\Plugin\CachePlugin;
7-
use Http\Client\Common\Plugin\LoggerPlugin;
8-
use Http\Client\Common\Plugin\StopwatchPlugin;
96
use Http\Client\Common\PluginClient;
107
use Http\HttplugBundle\ClientFactory\DummyClient;
118
use Http\Message\Authentication\BasicAuth;
@@ -141,10 +138,6 @@ private function configurePluginByName($name, Definition $definition, array $con
141138
{
142139
switch ($name) {
143140
case 'cache':
144-
// To preserve BC, we check the existence of the new plugin class and use it if available
145-
if (class_exists(CachePlugin::class)) {
146-
$definition->setClass(CachePlugin::class);
147-
}
148141
$definition
149142
->replaceArgument(0, new Reference($config['cache_pool']))
150143
->replaceArgument(1, new Reference($config['stream_factory']))
@@ -160,10 +153,6 @@ private function configurePluginByName($name, Definition $definition, array $con
160153
$definition->replaceArgument(0, new Reference($config['journal']));
161154
break;
162155
case 'logger':
163-
// To preserve BC, we check the existence of the new plugin class and use it if available
164-
if (class_exists(LoggerPlugin::class)) {
165-
$definition->setClass(LoggerPlugin::class);
166-
}
167156
$definition->replaceArgument(0, new Reference($config['logger']));
168157
if (!empty($config['formatter'])) {
169158
$definition->replaceArgument(1, new Reference($config['formatter']));
@@ -178,10 +167,6 @@ private function configurePluginByName($name, Definition $definition, array $con
178167
$definition->addArgument($config['retry']);
179168
break;
180169
case 'stopwatch':
181-
// To preserve BC, we check the existence of the new plugin class and use it if available
182-
if (class_exists(StopwatchPlugin::class)) {
183-
$definition->setClass(StopwatchPlugin::class);
184-
}
185170
$definition->replaceArgument(0, new Reference($config['stopwatch']));
186171
break;
187172
}

Resources/config/plugins.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
55

66
<services>
7-
<service id="httplug.plugin.cache" class="Http\Client\Plugin\CachePlugin" public="false">
7+
<service id="httplug.plugin.cache" class="Http\Client\Common\Plugin\CachePlugin" public="false">
88
<argument />
99
<argument />
1010
<argument />
@@ -18,13 +18,13 @@
1818
<service id="httplug.plugin.history" class="Http\Client\Common\Plugin\HistoryPlugin" public="false">
1919
<argument />
2020
</service>
21-
<service id="httplug.plugin.logger" class="Http\Client\Plugin\LoggerPlugin" public="false">
21+
<service id="httplug.plugin.logger" class="Http\Client\Common\Plugin\LoggerPlugin" public="false">
2222
<argument />
2323
<argument>null</argument>
2424
</service>
2525
<service id="httplug.plugin.redirect" class="Http\Client\Common\Plugin\RedirectPlugin" public="false" />
2626
<service id="httplug.plugin.retry" class="Http\Client\Common\Plugin\RetryPlugin" public="false" />
27-
<service id="httplug.plugin.stopwatch" class="Http\Client\Plugin\StopwatchPlugin" public="false">
27+
<service id="httplug.plugin.stopwatch" class="Http\Client\Common\Plugin\StopwatchPlugin" public="false">
2828
<argument />
2929
</service>
3030
</services>

composer.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
"php-http/client-implementation": "^1.0",
2121
"php-http/message-factory": "^1.0.2",
2222
"php-http/client-common": "^1.1",
23-
"php-http/plugins": "^1.1",
23+
"php-http/cache-plugin": "^1.0",
24+
"php-http/logger-plugin": "^1.0",
25+
"php-http/stopwatch-plugin": "^1.0",
2426
"symfony/options-resolver": "^2.7|^3.0",
2527
"symfony/framework-bundle": "^2.7|^3.0"
2628
},

0 commit comments

Comments
 (0)