Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@ indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.yml*]
indent_size = 2
9 changes: 8 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +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
CONTRIBUTING export-ignore
phpspec.yml.ci export-ignore
phpspec.yml.dist export-ignore
phpunit.xml.dist export-ignore
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.puli
.puli/
build/
vendor/
composer.lock
phpspec.yml
phpunit.xml
13 changes: 13 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

/*
* In order to make it work, fabpot/php-cs-fixer and sllh/php-cs-fixer-styleci-bridge must be installed globally
* with composer.
*
* @link https://github.com/Soullivaneuh/php-cs-fixer-styleci-bridge
* @link https://github.com/FriendsOfPHP/PHP-CS-Fixer
*/

use SLLH\StyleCIBridge\ConfigBridge;

return ConfigBridge::create();
13 changes: 5 additions & 8 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
filter:
paths: [src/*]
paths: [src/*]
checks:
php:
code_rating: true
duplication: true
php:
code_rating: true
duplication: true
tools:
external_code_coverage: true
php_code_sniffer:
config:
standard: "PSR2"
external_code_coverage: true
10 changes: 10 additions & 0 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
preset: symfony

finder:
exclude:
- "spec"
path:
- "src"

enabled:
- short_array_syntax
49 changes: 27 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,45 @@ language: php
sudo: false

cache:
directories:
- $HOME/.composer/cache
directories:
- $HOME/.composer/cache

php:
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm

env:
global:
- TEST_COMMAND="composer test"
global:
- TEST_COMMAND="composer test"

branches:
except:
- /^analysis-.*$/

matrix:
allow_failures:
- php: hhvm
fast_finish: true
include:
- php: 5.4
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
allow_failures:
- php: hhvm
fast_finish: true
include:
- php: 5.4
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"

before_install:
- travis_retry composer self-update
- travis_retry composer self-update

install:
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-source --no-interaction
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-source --no-interaction

before_script: vendor/bin/http_test_server > /dev/null 2>&1 &
before_script:
- vendor/bin/http_test_server > /dev/null 2>&1 &

script:
- $TEST_COMMAND
- ./vendor/bin/phpunit tests/SocketClientFeatureTest.php --printer Http\\Client\\Tests\\FeatureTestListener || echo ""
- $TEST_COMMAND
- ./vendor/bin/phpunit tests/SocketClientFeatureTest.php --printer Http\\Client\\Tests\\FeatureTestListener || echo ""

after_success:
- if [[ "$COVERAGE" = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [[ "$COVERAGE" = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi
- if [[ "$COVERAGE" = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [[ "$COVERAGE" = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi
22 changes: 0 additions & 22 deletions CONDUCT.md

This file was deleted.

1 change: 1 addition & 0 deletions CONTRIBUTING
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Please see http://docs.php-http.org/en/latest/development/contributing.html
84 changes: 0 additions & 84 deletions CONTRIBUTING.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015 PHP HTTP Team <team@php-http.org>
Copyright (c) 2015-2016 PHP HTTP Team <team@php-http.org>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ $ composer require php-http/socket-client
* TLS / SSL Encyrption
* Client Certificate (only for php > 5.6)


## Usage

The SocketHttpClient class need a [message factory](https://github.com/php-http/message-factory) in order to work:
Expand All @@ -35,27 +36,28 @@ $client = new new Http\Socket\SocketHttpClient($messageFactory, $options);

The `$options` array allow to configure the socket client.


## Options

Here is the list of available options:

* remote_socket: Specify the remote socket where the library should send the request to

Can be a tcp remote : tcp://hostname:port

Can be a unix remote : unix://hostname:port

Do not use a tls / ssl scheme, this is handle by the ssl option.

If not set, the client will try to determine it from the request uri or host header.

* timeout : Timeout in __milliseconds__ for writing request and reading response on the remote
* ssl : Activate or deactivate the ssl / tls encryption
* stream_context_options : Custom options for the context of the stream, same as [PHP stream context options](http://php.net/manual/en/context.php)

As an example someone may want to pass a client certificate when using the ssl, a valid configuration for this
use case would be:

```php
$options = [
'stream_context_options' => [
Expand All @@ -71,6 +73,7 @@ Here is the list of available options:
* write_buffer_size : When sending the request we need to bufferize the body, this option specify the size of this buffer, default is 8192,
if you are sending big file with your client it may be interesting to have a bigger value in order to increase performance.


## Testing

First launch the http server:
Expand All @@ -88,7 +91,7 @@ $ composer test

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.
Please see our [contributing guide](http://docs.php-http.org/en/latest/development/contributing.html).


## Security
Expand Down
File renamed without changes.
Loading