Skip to content

Commit cad78a5

Browse files
committed
Added stream factory
1 parent 72bad26 commit cad78a5

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ For information how to write applications with the services provided by this bun
4141

4242
### Use in Applications
4343

44+
#### Custom services
45+
4446
This bundle provides 3 services:
4547

4648
* `httplug.client` a service that provides the `Http\Client\HttpClient`
4749
* `httplug.message_factory` a service that provides the `Http\Message\MessageFactory`
4850
* `httplug.uri_factory` a service that provides the `Http\Message\UriFactory`
51+
* `httplug.stream_factory` a service that provides the `Http\Message\StreamFactory`
4952

5053
These services are always an alias to another service. You can specify your own service or leave the default, which is the same name with `.default` appended. The default services in turn use the service discovery mechanism to provide the best available implementation. You can specify a class for each of the default services to use instead of discovery, as long as those classes can be instantiated without arguments.
5154

@@ -57,10 +60,13 @@ httplug:
5760
client: httplug.client.default
5861
message_factory: httplug.message_factory.default
5962
uri_factory: httplug.uri_factory.default
63+
stream_factory: httplug.stream_factory.default
6064
classes:
61-
client: ~ # uses discovery if not specified
62-
message_factory: ~
65+
# uses discovery if not specified
66+
client: ~
67+
message_factory: ~
6368
uri_factory: ~
69+
stream_factory: ~
6470
clients:
6571
acme:
6672
adapter: guzzle5

Resources/config/discovery.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
class="Http\Message\UriFactory">
1717
<factory class="Http\Discovery\UriFactoryDiscovery" method="find"/>
1818
</service>
19+
<service id="httplug.stream_factory.default"
20+
class="Http\Message\StreamFactory">
21+
<factory class="Http\Discovery\StreamFactoryDiscovery" method="find"/>
22+
</service>
1923

2024
</services>
2125
</container>

0 commit comments

Comments
 (0)