Skip to content

Commit b311293

Browse files
committed
Merge pull request #72 from php-http/plugins
Replace plugins package with client-common
2 parents 218bed6 + 092d841 commit b311293

File tree

7 files changed

+23
-17
lines changed

7 files changed

+23
-17
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
- Guzzle 6 client is now created according to the Httplug specifications with automated minimal behaviour.
1212
Make sure you configure the Httplug plugins as needed,
1313
for example if you want to get exceptions for failure HTTP status codes.
14+
- **[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
1416

1517

1618
### Fixed

ClientFactory/PluginClientFactory.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Http\HttplugBundle\ClientFactory;
44

5-
use Http\Client\Plugin\Plugin;
6-
use Http\Client\Plugin\PluginClient;
5+
use Http\Client\Common\Plugin;
6+
use Http\Client\Common\PluginClient;
77

88
/**
99
* This factory creates a PluginClient.

Collector/MessageJournal.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace Http\HttplugBundle\Collector;
44

55
use Http\Client\Exception;
6-
use Http\Client\Plugin\Journal;
6+
use Http\Client\Common\Plugin\Journal;
77
use Http\Message\Formatter;
88
use Http\Message\Formatter\SimpleFormatter;
99
use Psr\Http\Message\RequestInterface;

DependencyInjection/HttplugExtension.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Http\HttplugBundle\DependencyInjection;
44

5-
use Http\Client\Plugin\AuthenticationPlugin;
6-
use Http\Client\Plugin\PluginClient;
5+
use Http\Client\Common\Plugin\AuthenticationPlugin;
6+
use Http\Client\Common\PluginClient;
77
use Http\HttplugBundle\ClientFactory\DummyClient;
88
use Http\Message\Authentication\BasicAuth;
99
use Http\Message\Authentication\Bearer;
@@ -119,6 +119,7 @@ private function configurePlugins(ContainerBuilder $container, array $config)
119119

120120
foreach ($config as $name => $pluginConfig) {
121121
$pluginId = 'httplug.plugin.'.$name;
122+
122123
if ($pluginConfig['enabled']) {
123124
$def = $container->getDefinition($pluginId);
124125
$this->configurePluginByName($name, $def, $pluginConfig);

Resources/config/data-collector.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<argument>null</argument>
1111
</service>
1212

13-
<service id="httplug.collector.history_plugin" class="Http\Client\Plugin\HistoryPlugin" public="false">
13+
<service id="httplug.collector.history_plugin" class="Http\Client\Common\Plugin\HistoryPlugin" public="false">
1414
<argument type="service" id="httplug.collector.message_journal"/>
1515
</service>
1616
</services>

Resources/config/plugins.xml

+10-10
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@
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 />
1111
</service>
12-
<service id="httplug.plugin.content_length" class="Http\Client\Plugin\ContentLengthPlugin" public="false" />
13-
<service id="httplug.plugin.cookie" class="Http\Client\Plugin\CookiePlugin" public="false">
12+
<service id="httplug.plugin.content_length" class="Http\Client\Common\Plugin\ContentLengthPlugin" public="false" />
13+
<service id="httplug.plugin.cookie" class="Http\Client\Common\Plugin\CookiePlugin" public="false">
1414
<argument />
1515
</service>
16-
<service id="httplug.plugin.decoder" class="Http\Client\Plugin\DecoderPlugin" public="false" />
17-
<service id="httplug.plugin.error" class="Http\Client\Plugin\ErrorPlugin" public="false" />
18-
<service id="httplug.plugin.history" class="Http\Client\Plugin\HistoryPlugin" public="false">
16+
<service id="httplug.plugin.decoder" class="Http\Client\Common\Plugin\DecoderPlugin" public="false" />
17+
<service id="httplug.plugin.error" class="Http\Client\Common\Plugin\ErrorPlugin" public="false" />
18+
<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>
25-
<service id="httplug.plugin.redirect" class="Http\Client\Plugin\RedirectPlugin" public="false" />
26-
<service id="httplug.plugin.retry" class="Http\Client\Plugin\RetryPlugin" public="false" />
27-
<service id="httplug.plugin.stopwatch" class="Http\Client\Plugin\StopwatchPlugin" public="false">
25+
<service id="httplug.plugin.redirect" class="Http\Client\Common\Plugin\RedirectPlugin" public="false" />
26+
<service id="httplug.plugin.retry" class="Http\Client\Common\Plugin\RetryPlugin" public="false" />
27+
<service id="httplug.plugin.stopwatch" class="Http\Client\Common\Plugin\StopwatchPlugin" public="false">
2828
<argument />
2929
</service>
3030
</services>

composer.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
"php": ">=5.5",
2020
"php-http/client-implementation": "^1.0",
2121
"php-http/message-factory": "^1.0.2",
22-
"php-http/plugins": "^1.0",
22+
"php-http/client-common": "^1.1",
23+
"php-http/cache-plugin": "^1.0",
24+
"php-http/logger-plugin": "^1.0",
25+
"php-http/stopwatch-plugin": "^1.0",
2326
"symfony/options-resolver": "^2.7|^3.0",
2427
"symfony/framework-bundle": "^2.7|^3.0"
2528
},

0 commit comments

Comments
 (0)