Skip to content

Commit

Permalink
Merge pull request #72 from php-http/plugins
Browse files Browse the repository at this point in the history
Replace plugins package with client-common
  • Loading branch information
dbu committed May 19, 2016
2 parents 218bed6 + 092d841 commit b311293
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 17 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- Guzzle 6 client is now created according to the Httplug specifications with automated minimal behaviour.
Make sure you configure the Httplug plugins as needed,
for example if you want to get exceptions for failure HTTP status codes.
- **[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))
- Plugins are loaded from their new packages


### Fixed
Expand Down
4 changes: 2 additions & 2 deletions ClientFactory/PluginClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Http\HttplugBundle\ClientFactory;

use Http\Client\Plugin\Plugin;
use Http\Client\Plugin\PluginClient;
use Http\Client\Common\Plugin;
use Http\Client\Common\PluginClient;

/**
* This factory creates a PluginClient.
Expand Down
2 changes: 1 addition & 1 deletion Collector/MessageJournal.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Http\HttplugBundle\Collector;

use Http\Client\Exception;
use Http\Client\Plugin\Journal;
use Http\Client\Common\Plugin\Journal;
use Http\Message\Formatter;
use Http\Message\Formatter\SimpleFormatter;
use Psr\Http\Message\RequestInterface;
Expand Down
5 changes: 3 additions & 2 deletions DependencyInjection/HttplugExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Http\HttplugBundle\DependencyInjection;

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

foreach ($config as $name => $pluginConfig) {
$pluginId = 'httplug.plugin.'.$name;

if ($pluginConfig['enabled']) {
$def = $container->getDefinition($pluginId);
$this->configurePluginByName($name, $def, $pluginConfig);
Expand Down
2 changes: 1 addition & 1 deletion Resources/config/data-collector.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<argument>null</argument>
</service>

<service id="httplug.collector.history_plugin" class="Http\Client\Plugin\HistoryPlugin" public="false">
<service id="httplug.collector.history_plugin" class="Http\Client\Common\Plugin\HistoryPlugin" public="false">
<argument type="service" id="httplug.collector.message_journal"/>
</service>
</services>
Expand Down
20 changes: 10 additions & 10 deletions Resources/config/plugins.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<service id="httplug.plugin.cache" class="Http\Client\Plugin\CachePlugin" public="false">
<service id="httplug.plugin.cache" class="Http\Client\Common\Plugin\CachePlugin" public="false">
<argument />
<argument />
<argument />
</service>
<service id="httplug.plugin.content_length" class="Http\Client\Plugin\ContentLengthPlugin" public="false" />
<service id="httplug.plugin.cookie" class="Http\Client\Plugin\CookiePlugin" public="false">
<service id="httplug.plugin.content_length" class="Http\Client\Common\Plugin\ContentLengthPlugin" public="false" />
<service id="httplug.plugin.cookie" class="Http\Client\Common\Plugin\CookiePlugin" public="false">
<argument />
</service>
<service id="httplug.plugin.decoder" class="Http\Client\Plugin\DecoderPlugin" public="false" />
<service id="httplug.plugin.error" class="Http\Client\Plugin\ErrorPlugin" public="false" />
<service id="httplug.plugin.history" class="Http\Client\Plugin\HistoryPlugin" public="false">
<service id="httplug.plugin.decoder" class="Http\Client\Common\Plugin\DecoderPlugin" public="false" />
<service id="httplug.plugin.error" class="Http\Client\Common\Plugin\ErrorPlugin" public="false" />
<service id="httplug.plugin.history" class="Http\Client\Common\Plugin\HistoryPlugin" public="false">
<argument />
</service>
<service id="httplug.plugin.logger" class="Http\Client\Plugin\LoggerPlugin" public="false">
<service id="httplug.plugin.logger" class="Http\Client\Common\Plugin\LoggerPlugin" public="false">
<argument />
<argument>null</argument>
</service>
<service id="httplug.plugin.redirect" class="Http\Client\Plugin\RedirectPlugin" public="false" />
<service id="httplug.plugin.retry" class="Http\Client\Plugin\RetryPlugin" public="false" />
<service id="httplug.plugin.stopwatch" class="Http\Client\Plugin\StopwatchPlugin" public="false">
<service id="httplug.plugin.redirect" class="Http\Client\Common\Plugin\RedirectPlugin" public="false" />
<service id="httplug.plugin.retry" class="Http\Client\Common\Plugin\RetryPlugin" public="false" />
<service id="httplug.plugin.stopwatch" class="Http\Client\Common\Plugin\StopwatchPlugin" public="false">
<argument />
</service>
</services>
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
"php": ">=5.5",
"php-http/client-implementation": "^1.0",
"php-http/message-factory": "^1.0.2",
"php-http/plugins": "^1.0",
"php-http/client-common": "^1.1",
"php-http/cache-plugin": "^1.0",
"php-http/logger-plugin": "^1.0",
"php-http/stopwatch-plugin": "^1.0",
"symfony/options-resolver": "^2.7|^3.0",
"symfony/framework-bundle": "^2.7|^3.0"
},
Expand Down

0 comments on commit b311293

Please sign in to comment.