Skip to content

Commit de3a634

Browse files
author
Martin Brecht-Precht
committed
Change root namespace and vendor prefixes
1 parent d110a71 commit de3a634

33 files changed

+166
-166
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 Martin Brecht-Precht, Markenwerk GmbH
3+
Copyright (c) 2016 Martin Brecht-Precht, Chroma Experience GmbH
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+37-37
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# PHP Basic HTTP Client
22

3-
[![Build Status](https://travis-ci.org/markenwerk/php-basic-http-client.svg?branch=master)](https://travis-ci.org/markenwerk/php-basic-http-client)
3+
[![Build Status](https://travis-ci.org/chroma-x/php-basic-http-client.svg?branch=master)](https://travis-ci.org/chroma-x/php-basic-http-client)
44
[![SensioLabs Insight](https://img.shields.io/sensiolabs/i/0bc596c2-5849-4e0f-a46f-a7b94d28f97c.svg)](https://insight.sensiolabs.com/projects/0bc596c2-5849-4e0f-a46f-a7b94d28f97c)
5-
[![Code Climate](https://codeclimate.com/github/markenwerk/php-basic-http-client/badges/gpa.svg)](https://codeclimate.com/github/markenwerk/php-basic-http-client)
6-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/03db69a367dd4bbbbbd03e4612dfdbe5)](https://www.codacy.com/app/Bonscho/php-basic-http-client?utm_source=github.com&utm_medium=referral&utm_content=markenwerk/php-basic-http-client&utm_campaign=Badge_Grade)
7-
[![Latest Stable Version](https://poser.pugx.org/markenwerk/basic-http-client/v/stable)](https://packagist.org/packages/markenwerk/basic-http-client)
8-
[![Total Downloads](https://poser.pugx.org/markenwerk/basic-http-client/downloads)](https://packagist.org/packages/markenwerk/basic-http-client)
9-
[![License](https://poser.pugx.org/markenwerk/basic-http-client/license)](https://packagist.org/packages/markenwerk/basic-http-client)
5+
[![Code Climate](https://codeclimate.com/github/chroma-x/php-basic-http-client/badges/gpa.svg)](https://codeclimate.com/github/chroma-x/php-basic-http-client)
6+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/03db69a367dd4bbbbbd03e4612dfdbe5)](https://www.codacy.com/app/Bonscho/php-basic-http-client?utm_source=github.com&utm_medium=referral&utm_content=chroma-x/php-basic-http-client&utm_campaign=Badge_Grade)
7+
[![Latest Stable Version](https://poser.pugx.org/chroma-x/basic-http-client/v/stable)](https://packagist.org/packages/chroma-x/basic-http-client)
8+
[![Total Downloads](https://poser.pugx.org/chroma-x/basic-http-client/downloads)](https://packagist.org/packages/chroma-x/basic-http-client)
9+
[![License](https://poser.pugx.org/chroma-x/basic-http-client/license)](https://packagist.org/packages/chroma-x/basic-http-client)
1010

1111
A basic yet extensible HTTP client library providing different authentication methods written in PHP.
1212

@@ -26,7 +26,7 @@ Find out more at the [„PSR-7 is imminent, and here's my issues with it“](htt
2626
```{json}
2727
{
2828
"require": {
29-
"markenwerk/basic-http-client": "~3.0"
29+
"chroma-x/basic-http-client": "~3.0"
3030
}
3131
}
3232
```
@@ -44,9 +44,9 @@ require_once('path/to/vendor/autoload.php');
4444
#### Preparing the HTTP client
4545

4646
```{php}
47-
use Markenwerk\BasicHttpClient;
48-
use Markenwerk\BasicHttpClient\Request\Authentication;
49-
use Markenwerk\BasicHttpClient\Request\Message;
47+
use ChromaX\BasicHttpClient;
48+
use ChromaX\BasicHttpClient\Request\Authentication;
49+
use ChromaX\BasicHttpClient\Request\Message;
5050
5151
// Instantiating a basic HTTP client with the endpoints URL
5252
// If the endpoint uses the `HTTPS` schema a `HttpsTransport` instance will be used automatically.
@@ -134,7 +134,7 @@ The following example shows the usage with a more detailed configuration.
134134
#### Configuring a HTTP Transport instance
135135

136136
```{php}
137-
use Markenwerk\BasicHttpClient\Request\Transport\HttpTransport;
137+
use ChromaX\BasicHttpClient\Request\Transport\HttpTransport;
138138
139139
// Configuring a Transport instance
140140
$transport = new HttpTransport();
@@ -150,7 +150,7 @@ $transport
150150
#### Configuring a HTTPS Transport instance
151151

152152
```{php}
153-
use Markenwerk\BasicHttpClient\Request\Transport\HttpsTransport;
153+
use ChromaX\BasicHttpClient\Request\Transport\HttpsTransport;
154154
155155
// Configuring a Transport instance
156156
$transport = new HttpsTransport();
@@ -167,10 +167,10 @@ $transport
167167
#### Configuring a Message instance with Body
168168

169169
```{php}
170-
use Markenwerk\BasicHttpClient\Request\Message\Body\Body;
171-
use Markenwerk\BasicHttpClient\Request\Message\Cookie\Cookie;
172-
use Markenwerk\BasicHttpClient\Request\Message\Header\Header;
173-
use Markenwerk\BasicHttpClient\Request\Message\Message;
170+
use ChromaX\BasicHttpClient\Request\Message\Body\Body;
171+
use ChromaX\BasicHttpClient\Request\Message\Cookie\Cookie;
172+
use ChromaX\BasicHttpClient\Request\Message\Header\Header;
173+
use ChromaX\BasicHttpClient\Request\Message\Message;
174174
175175
// Configuring a message Body instance
176176
$messageBody = new Body();
@@ -218,12 +218,12 @@ $message->addAdditionalHeader(new Header('Custom-Header', array('AnotherCustomHe
218218

219219
#### Configuring an endpoints URL, build the Request instance and perform the HTTP request
220220

221-
For more information about the usage of the URL object please take a look at the [PHP URL Util](https://github.com/markenwerk/php-url-util) project.
221+
For more information about the usage of the URL object please take a look at the [PHP URL Util](https://github.com/chroma-x/php-url-util) project.
222222

223223
```{php}
224-
use Markenwerk\BasicHttpClient\Request\Authentication\BasicAuthentication;
225-
use Markenwerk\BasicHttpClient\Request\Request;
226-
use Markenwerk\UrlUtil\Url;
224+
use ChromaX\BasicHttpClient\Request\Authentication\BasicAuthentication;
225+
use ChromaX\BasicHttpClient\Request\Request;
226+
use ChromaX\UrlUtil\Url;
227227
228228
// Setting up the endpoints URL
229229
$url = new Url('https://john:[email protected]:443/path/to/resource?arg1=123#fragment');
@@ -273,8 +273,8 @@ You can add one or more Authentication instances to every Request instance. At t
273273
Required credentials are a *username* and a *password* that get provided to the class constructor as arguments.
274274

275275
```{php}
276-
use Markenwerk\BasicHttpClient\Request\Authentication\BasicAuthentication;
277-
use Markenwerk\BasicHttpClient\Request\Request;
276+
use ChromaX\BasicHttpClient\Request\Authentication\BasicAuthentication;
277+
use ChromaX\BasicHttpClient\Request\Request;
278278
279279
// Configuring the authentication
280280
$basicAuthentication = new BasicAuthentication('username', 'password');
@@ -289,8 +289,8 @@ $request->addAuthentication($basicAuthentication);
289289
Required credentials are a *Certificate Authority Certificate*, a *Client Certificate* and the password that is used to decrypt the Client Certificate that get provided to the class constructor as arguments.
290290

291291
```{php}
292-
use Markenwerk\BasicHttpClient\Request\Authentication\ClientCertificateAuthentication;
293-
use Markenwerk\BasicHttpClient\Request\Request;
292+
use ChromaX\BasicHttpClient\Request\Authentication\ClientCertificateAuthentication;
293+
use ChromaX\BasicHttpClient\Request\Request;
294294
295295
// Configuring the authentication
296296
$clientCertificateAuthentication = new ClientCertificateAuthentication(
@@ -313,7 +313,7 @@ $request->addAuthentication($clientCertificateAuthentication);
313313
If using the `BasicHttpClient` the response object is returned by the termination methods listed above. If directly using the Request instance, you can get the Response object via a getter.
314314

315315
```{php}
316-
// Getting the response Markenwerk\BasicHttpClient\Response\Response object
316+
// Getting the response ChromaX\BasicHttpClient\Response\Response object
317317
$response = $request->getResponse();
318318
319319
// Reading the HTTP status code as integer; will return `200`
@@ -322,7 +322,7 @@ echo print_r($response->getStatusCode(), true) . PHP_EOL;
322322
// Reading the HTTP status text as string; will return `HTTP/1.1 200 OK`
323323
echo print_r($response->getStatusText(), true) . PHP_EOL;
324324
325-
// Reading the HTTP response headers as array of Markenwerk\BasicHttpClient\Response\Header\Header objects
325+
// Reading the HTTP response headers as array of ChromaX\BasicHttpClient\Response\Header\Header objects
326326
echo print_r($response->getHeaders(), true) . PHP_EOL;
327327
328328
// Reading the HTTP response body as string
@@ -345,7 +345,7 @@ echo print_r($request->getEffectiveStatus(), true) . PHP_EOL;
345345
// Getting the effective raw request headers as string
346346
echo print_r($request->getEffectiveRawHeader(), true) . PHP_EOL;
347347
348-
// Getting the effective request headers as array of `Markenwerk\BasicHttpClient\Request\Message\Header\Header` objects
348+
// Getting the effective request headers as array of `ChromaX\BasicHttpClient\Request\Message\Header\Header` objects
349349
echo print_r($request->getEffectiveHeaders(), true) . PHP_EOL.PHP_EOL;
350350
```
351351

@@ -354,7 +354,7 @@ echo print_r($request->getEffectiveHeaders(), true) . PHP_EOL.PHP_EOL;
354354
## Getting some transactional statistics
355355

356356
```{php}
357-
// Getting the statistics Markenwerk\BasicHttpClient\Response\Statistics\Statistics object
357+
// Getting the statistics ChromaX\BasicHttpClient\Response\Statistics\Statistics object
358358
$statistics = $request->getResponse()->getStatistics();
359359
360360
// Reading the redirection URL if the server responds with an redirect HTTP header and
@@ -390,32 +390,32 @@ echo print_r($statistics->getTotalTime(), true).PHP_EOL;
390390
Every part of the client is based upon proper interfaces. Most class instances can get injected into the client itself.
391391
If you want to extend the client just write some classes implementing the according interface and you´re done with that.
392392

393-
Take a look at the [PHP JSON HTTP Client](https://github.com/markenwerk/php-json-http-client) which is an extension of the PHP Basic HTTP Client.
393+
Take a look at the [PHP JSON HTTP Client](https://github.com/chroma-x/php-json-http-client) which is an extension of the PHP Basic HTTP Client.
394394

395395
---
396396

397397
## Exception handling
398398

399399
PHP Basic HTTP Client provides different exceptions – also provided by the PHP Common Exceptions project – for proper handling.
400-
You can find more information about [PHP Common Exceptions at Github](https://github.com/markenwerk/php-common-exceptions).
400+
You can find more information about [PHP Common Exceptions at Github](https://github.com/chroma-x/php-common-exceptions).
401401

402402
### Exceptions to be expected
403403

404404
In general you should expect that any setter method could thrown an `\InvalidArgumentException`. The following exceptions could get thrown while using PHP Basic HTTP Client.
405405

406-
- `Markenwerk\CommonException\IoException\FileNotFoundException` on configuring a `ClientCertificateAuthentication`instance
407-
- `Markenwerk\CommonException\IoException\FileReadableException` on configuring a `ClientCertificateAuthentication`instance
408-
- `Markenwerk\BasicHttpClient\Exception\HttpRequestAuthenticationException` on performing a request
409-
- `Markenwerk\BasicHttpClient\Exception\HttpRequestException` on performing a request
410-
- `Markenwerk\CommonException\NetworkException\ConnectionTimeoutException` on performing a request
411-
- `Markenwerk\CommonException\NetworkException\CurlException` on performing a request
406+
- `ChromaX\CommonException\IoException\FileNotFoundException` on configuring a `ClientCertificateAuthentication`instance
407+
- `ChromaX\CommonException\IoException\FileReadableException` on configuring a `ClientCertificateAuthentication`instance
408+
- `ChromaX\BasicHttpClient\Exception\HttpRequestAuthenticationException` on performing a request
409+
- `ChromaX\BasicHttpClient\Exception\HttpRequestException` on performing a request
410+
- `ChromaX\CommonException\NetworkException\ConnectionTimeoutException` on performing a request
411+
- `ChromaX\CommonException\NetworkException\CurlException` on performing a request
412412

413413
---
414414

415415
## Contribution
416416

417417
Contributing to our projects is always very appreciated.
418-
**But: please follow the contribution guidelines written down in the [CONTRIBUTING.md](https://github.com/markenwerk/php-basic-http-client/blob/master/CONTRIBUTING.md) document.**
418+
**But: please follow the contribution guidelines written down in the [CONTRIBUTING.md](https://github.com/chroma-x/php-basic-http-client/blob/master/CONTRIBUTING.md) document.**
419419

420420
## License
421421

composer.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "markenwerk/basic-http-client",
2+
"name": "chroma-x/basic-http-client",
33
"type": "library",
44
"description": "A basic yet extensible HTTP client library providing different authentication methods written in PHP.",
55
"keywords": [
@@ -10,25 +10,25 @@
1010
"Basic Auth",
1111
"Client Certificate Auth"
1212
],
13-
"homepage": "http://markenwerk.net/",
13+
"homepage": "http://chroma-x.de/",
1414
"license": "MIT",
1515
"authors": [
1616
{
1717
"name": "Martin Brecht-Precht",
18-
"email": "mb@markenwerk.net",
19-
"homepage": "http://markenwerk.net"
18+
"email": "mb@chroma-x.de",
19+
"homepage": "http://chroma-x.de"
2020
}
2121
],
2222
"autoload": {
2323
"psr-4": {
24-
"Markenwerk\\BasicHttpClient\\": "src/"
24+
"ChromaX\\BasicHttpClient\\": "src/"
2525
}
2626
},
2727
"require": {
2828
"php": "^7.1",
2929
"ext-curl": "*",
3030
"ext-mbstring": "*",
31-
"markenwerk/url-util": "~2.0",
32-
"markenwerk/common-exceptions": "~3.0"
31+
"chroma-x/url-util": "~2.0",
32+
"chroma-x/common-exceptions": "~3.0"
3333
}
3434
}

src/BasicHttpClient.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<?php
22

3-
namespace Markenwerk\BasicHttpClient;
3+
namespace ChromaX\BasicHttpClient;
44

5-
use Markenwerk\BasicHttpClient\Request\RequestInterface;
6-
use Markenwerk\BasicHttpClient\Request\Message\Body\Body;
7-
use Markenwerk\BasicHttpClient\Request\Message\Message;
8-
use Markenwerk\BasicHttpClient\Request\Request;
9-
use Markenwerk\BasicHttpClient\Request\Transport\HttpsTransport;
10-
use Markenwerk\BasicHttpClient\Request\Transport\HttpTransport;
11-
use Markenwerk\BasicHttpClient\Response\ResponseInterface;
12-
use Markenwerk\CommonException\NetworkException\Base\NetworkException;
13-
use Markenwerk\CommonException\NetworkException\ConnectionTimeoutException;
14-
use Markenwerk\UrlUtil\Url;
5+
use ChromaX\BasicHttpClient\Request\RequestInterface;
6+
use ChromaX\BasicHttpClient\Request\Message\Body\Body;
7+
use ChromaX\BasicHttpClient\Request\Message\Message;
8+
use ChromaX\BasicHttpClient\Request\Request;
9+
use ChromaX\BasicHttpClient\Request\Transport\HttpsTransport;
10+
use ChromaX\BasicHttpClient\Request\Transport\HttpTransport;
11+
use ChromaX\BasicHttpClient\Response\ResponseInterface;
12+
use ChromaX\CommonException\NetworkException\Base\NetworkException;
13+
use ChromaX\CommonException\NetworkException\ConnectionTimeoutException;
14+
use ChromaX\UrlUtil\Url;
1515

1616
/**
1717
* Class BasicHttpClient
1818
*
19-
* @package Markenwerk\BasicHttpClient
19+
* @package ChromaX\BasicHttpClient
2020
*/
2121
class BasicHttpClient implements HttpClientInterface
2222
{

src/Exception/HttpRequestAuthenticationException.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
namespace Markenwerk\BasicHttpClient\Exception;
3+
namespace ChromaX\BasicHttpClient\Exception;
44

55
/**
66
* Class HttpRequestAuthenticationException
77
*
8-
* @package Markenwerk\BasicHttpClient\Exception
8+
* @package ChromaX\BasicHttpClient\Exception
99
*/
1010
class HttpRequestAuthenticationException extends \Exception
1111
{

src/Exception/HttpRequestException.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
namespace Markenwerk\BasicHttpClient\Exception;
3+
namespace ChromaX\BasicHttpClient\Exception;
44

55
/**
66
* Class HttpRequestException
77
*
8-
* @package Markenwerk\BasicHttpClient\Exception
8+
* @package ChromaX\BasicHttpClient\Exception
99
*/
1010
class HttpRequestException extends \Exception
1111
{

src/Exception/HttpRequestMessageException.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
namespace Markenwerk\BasicHttpClient\Exception;
3+
namespace ChromaX\BasicHttpClient\Exception;
44

55
/**
66
* Class HttpRequestMessageException
77
*
8-
* @package Markenwerk\BasicHttpClient\Exception
8+
* @package ChromaX\BasicHttpClient\Exception
99
*/
1010
class HttpRequestMessageException extends \Exception
1111
{

src/Exception/HttpResponseException.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
namespace Markenwerk\BasicHttpClient\Exception;
3+
namespace ChromaX\BasicHttpClient\Exception;
44

55
/**
66
* Class HttpResponseException
77
*
8-
* @package Markenwerk\BasicHttpClient\Exception
8+
* @package ChromaX\BasicHttpClient\Exception
99
*/
1010
class HttpResponseException extends \Exception
1111
{

src/HttpClientInterface.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?php
22

3-
namespace Markenwerk\BasicHttpClient;
3+
namespace ChromaX\BasicHttpClient;
44

5-
use Markenwerk\BasicHttpClient\Request\RequestInterface;
6-
use Markenwerk\BasicHttpClient\Response\ResponseInterface;
5+
use ChromaX\BasicHttpClient\Request\RequestInterface;
6+
use ChromaX\BasicHttpClient\Response\ResponseInterface;
77

88
/**
99
* Interface HttpClientInterface
1010
*
11-
* @package Markenwerk\BasicHttpClient
11+
* @package ChromaX\BasicHttpClient
1212
*/
1313
interface HttpClientInterface
1414
{

src/Request/AbstractRequest.php

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
<?php
22

3-
namespace Markenwerk\BasicHttpClient\Request;
4-
5-
use Markenwerk\BasicHttpClient\Exception\HttpRequestException;
6-
use Markenwerk\BasicHttpClient\Request\Authentication\AuthenticationInterface;
7-
use Markenwerk\BasicHttpClient\Request\Message\MessageInterface;
8-
use Markenwerk\BasicHttpClient\Request\Message\Header\Header;
9-
use Markenwerk\BasicHttpClient\Request\Transport\TransportInterface;
10-
use Markenwerk\BasicHttpClient\Request\Transport\HttpsTransport;
11-
use Markenwerk\BasicHttpClient\Request\Transport\HttpTransport;
12-
use Markenwerk\BasicHttpClient\Response\ResponseInterface;
13-
use Markenwerk\CommonException\NetworkException\Base\NetworkException;
14-
use Markenwerk\CommonException\NetworkException\ConnectionTimeoutException;
15-
use Markenwerk\CommonException\NetworkException\CurlException;
16-
use Markenwerk\UrlUtil\UrlInterface;
3+
namespace ChromaX\BasicHttpClient\Request;
4+
5+
use ChromaX\BasicHttpClient\Exception\HttpRequestException;
6+
use ChromaX\BasicHttpClient\Request\Authentication\AuthenticationInterface;
7+
use ChromaX\BasicHttpClient\Request\Message\MessageInterface;
8+
use ChromaX\BasicHttpClient\Request\Message\Header\Header;
9+
use ChromaX\BasicHttpClient\Request\Transport\TransportInterface;
10+
use ChromaX\BasicHttpClient\Request\Transport\HttpsTransport;
11+
use ChromaX\BasicHttpClient\Request\Transport\HttpTransport;
12+
use ChromaX\BasicHttpClient\Response\ResponseInterface;
13+
use ChromaX\CommonException\NetworkException\Base\NetworkException;
14+
use ChromaX\CommonException\NetworkException\ConnectionTimeoutException;
15+
use ChromaX\CommonException\NetworkException\CurlException;
16+
use ChromaX\UrlUtil\UrlInterface;
1717

1818
/**
1919
* Class Request
2020
*
21-
* @package Markenwerk\BasicHttpClient\Request
21+
* @package ChromaX\BasicHttpClient\Request
2222
*/
2323
abstract class AbstractRequest implements RequestInterface
2424
{

0 commit comments

Comments
 (0)