diff --git a/.editorconfig b/.editorconfig index 7918eaf7..677e36e2 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,5 +7,3 @@ indent_size = 4 indent_style = space insert_final_newline = true trim_trailing_whitespace = true - -# we diverge from the yml 2 spaces convention of php-http in favor of the symfony code style. diff --git a/.gitattributes b/.gitattributes index df1f2734..fd35ce54 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1,13 @@ +spec/ export-ignore +Tests/ export-ignore .editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore +.php_cs export-ignore .scrutinizer.yml export-ignore +.styleci.yml export-ignore .travis.yml export-ignore CONTRIBUTING.md export-ignore -Tests/ export-ignore +phpspec.yml.ci export-ignore +phpspec.yml.dist export-ignore +phpunit.xml.dist export-ignore diff --git a/.gitignore b/.gitignore index d1502b08..da734f1b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ +.puli/ +build/ vendor/ composer.lock +phpspec.yml +phpunit.xml diff --git a/.php_cs b/.php_cs new file mode 100644 index 00000000..23ba165e --- /dev/null +++ b/.php_cs @@ -0,0 +1,13 @@ + +Copyright (c) 2015-2016 PHP HTTP Team Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index d5bc83a1..65e21cc0 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ $ composer require php-http/httplug-bundle ``` Enable the bundle in your kernel: - + ``` php httplug.plugin.decoder
httplug.plugin.error
httplug.plugin.logger
httplug.plugin.redirect
httplug.plugin.retry | These are build in plugins that lives in the `php-http/plugins` package. These servcies are not public and may only be used when configure HttpClients or services. +| httplug.plugin.content_length
httplug.plugin.decoder
httplug.plugin.error
httplug.plugin.logger
httplug.plugin.redirect
httplug.plugin.retry | These are build in plugins that lives in the `php-http/plugins` package. These servcies are not public and may only be used when configure HttpClients or services. \* *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.* @@ -59,10 +59,10 @@ If you need a more custom setup, define the services in your application configu ```yaml httplug: - clients: + clients: acme_client: # This is the name of the client factory: 'httplug.factory.guzzle6' - + main_alias: client: httplug.client.default message_factory: httplug.message_factory.default @@ -71,33 +71,34 @@ httplug: classes: # uses discovery if not specified client: ~ - message_factory: ~ + message_factory: ~ uri_factory: ~ stream_factory: ~ ``` + #### Configure your client -You can configure your clients with some good default options. The clients are later registered as services. +You can configure your clients with some good default options. The clients are later registered as services. ```yaml httplug: - clients: - my_guzzle5: + clients: + my_guzzle5: factory: 'httplug.factory.guzzle5' config: - # These options are given to Guzzle without validation. + # These options are given to Guzzle without validation. defaults: base_uri: 'http://google.se/' verify_ssl: false timeout: 4 headers: Content-Type: 'application/json' - acme: + acme: factory: 'httplug.factory.guzzle6' config: base_uri: 'http://google.se/' - + ``` ```php @@ -106,21 +107,22 @@ $httpClient = $this->container->get('httplug.client.my_guzzle5'); $httpClient = $this->container->get('httplug.client.acme'); ``` + #### Plugins -You can configure the clients with plugins. +You can configure the clients with plugins. ```yaml // services.yml acme_plugin: - class: Acme\Plugin\MyCustonPlugin + class: Acme\Plugin\MyCustonPlugin arguments: ["%api_key%"] ``` ```yaml // config.yml httpug: - clients: - acme: + clients: + acme: factory: 'httplug.factory.guzzle6' plugins: ['acme_plugin' , 'httplug.plugin.logger'] config: @@ -134,6 +136,7 @@ Rather than code against specific HTTP clients, you want to use the Httplug `Cli The only steps they need is `require` one of the adapter implementations in their projects `composer.json` and instantiating the HttplugBundle in their kernel. + ## Testing ``` bash @@ -143,7 +146,7 @@ $ composer test ## Contributing -Please see [CONTRIBUTING](CONTRIBUTING.md) for details. +Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html). ## Security diff --git a/composer.json b/composer.json index ed906aa3..63677411 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "Symfony bundle to integrate the Httplug generic HTTP client into Symfony", "type": "symfony-bundle", "keywords": ["http", "discovery", "adapter", "message", "factory", "bundle", "httplug", "php-http"], - "homepage": "http://php-http.org", + "homepage": "http://httplug.io", "license": "MIT", "authors": [ { @@ -11,8 +11,6 @@ "email": "mail@davidbu.ch" } ], - "minimum-stability": "dev", - "prefer-stable": true, "require": { "php": ">=5.5", "php-http/discovery": "^0.6.3", @@ -43,5 +41,7 @@ "branch-alias": { "dev-master": "1.0-dev" } - } + }, + "minimum-stability": "dev", + "prefer-stable": true }