Skip to content

Commit 898bba9

Browse files
RC namespace & package name
1 parent 9b64718 commit 898bba9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+157
-144
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM greensheep/dockerfiles-php-5.3
2+
RUN apt-get update -y
3+
RUN apt-get install -y curl
4+
RUN curl -sS https://getcomposer.org/installer | php
5+
RUN mv composer.phar /usr/local/bin/composer

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@ view-coverage:
1111

1212
clean:
1313
rm -rf artifacts/*
14+
15+
.PHONY: docker-login
16+
docker-login:
17+
docker run -t -i -v $(shell pwd):/opt/psr7 ringcentral-psr7 /bin/bash
18+
19+
.PHONY: docker-build
20+
docker-build:
21+
docker build -t ringcentral-psr7 .

README.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ decorators.
1414

1515
## AppendStream
1616

17-
`GuzzleHttp\Psr7\AppendStream`
17+
`RingCentral\Psr7\AppendStream`
1818

1919
Reads from multiple streams, one after the other.
2020

2121
```php
22-
use GuzzleHttp\Psr7;
22+
use RingCentral\Psr7;
2323

2424
$a = Psr7\stream_for('abc, ');
2525
$b = Psr7\stream_for('123.');
@@ -33,7 +33,7 @@ echo $composed(); // abc, 123. Above all listen to me.
3333

3434
## BufferStream
3535

36-
`GuzzleHttp\Psr7\BufferStream`
36+
`RingCentral\Psr7\BufferStream`
3737

3838
Provides a buffer stream that can be written to to fill a buffer, and read
3939
from to remove bytes from the buffer.
@@ -43,7 +43,7 @@ what the configured high water mark of the stream is, or the maximum
4343
preferred size of the buffer.
4444

4545
```php
46-
use GuzzleHttp\Psr7;
46+
use RingCentral\Psr7;
4747

4848
// When more than 1024 bytes are in the buffer, it will begin returning
4949
// false to writes. This is an indication that writers should slow down.
@@ -61,7 +61,7 @@ a PHP temp stream so that previously read bytes are cached first in memory,
6161
then on disk.
6262

6363
```php
64-
use GuzzleHttp\Psr7;
64+
use RingCentral\Psr7;
6565

6666
$original = Psr7\stream_for(fopen('http://www.google.com', 'r'));
6767
$stream = new Psr7\CachingStream($original);
@@ -78,13 +78,13 @@ echo $stream->tell();
7878

7979
## DroppingStream
8080

81-
`GuzzleHttp\Psr7\DroppingStream`
81+
`RingCentral\Psr7\DroppingStream`
8282

8383
Stream decorator that begins dropping data once the size of the underlying
8484
stream becomes too full.
8585

8686
```php
87-
use GuzzleHttp\Psr7;
87+
use RingCentral\Psr7;
8888

8989
// Create an empty stream
9090
$stream = Psr7\stream_for();
@@ -99,7 +99,7 @@ echo $stream; // 0123456789
9999

100100
## FnStream
101101

102-
`GuzzleHttp\Psr7\FnStream`
102+
`RingCentral\Psr7\FnStream`
103103

104104
Compose stream implementations based on a hash of functions.
105105

@@ -108,7 +108,7 @@ to create a concrete class for a simple extension point.
108108

109109
```php
110110

111-
use GuzzleHttp\Psr7;
111+
use RingCentral\Psr7;
112112

113113
$stream = Psr7\stream_for('hi');
114114
$fnStream = Psr7\FnStream::decorate($stream, [
@@ -126,7 +126,7 @@ $fnStream->rewind();
126126

127127
## InflateStream
128128

129-
`GuzzleHttp\Psr7\InflateStream`
129+
`RingCentral\Psr7\InflateStream`
130130

131131
Uses PHP's zlib.inflate filter to inflate deflate or gzipped content.
132132

@@ -138,13 +138,13 @@ to a Guzzle stream resource to be used as a Guzzle stream.
138138

139139
## LazyOpenStream
140140

141-
`GuzzleHttp\Psr7\LazyOpenStream`
141+
`RingCentral\Psr7\LazyOpenStream`
142142

143143
Lazily reads or writes to a file that is opened only after an IO operation
144144
take place on the stream.
145145

146146
```php
147-
use GuzzleHttp\Psr7;
147+
use RingCentral\Psr7;
148148

149149
$stream = new Psr7\LazyOpenStream('/path/to/file', 'r');
150150
// The file has not yet been opened...
@@ -156,14 +156,14 @@ echo $stream->read(10);
156156

157157
## LimitStream
158158

159-
`GuzzleHttp\Psr7\LimitStream`
159+
`RingCentral\Psr7\LimitStream`
160160

161161
LimitStream can be used to read a subset or slice of an existing stream object.
162162
This can be useful for breaking a large file into smaller pieces to be sent in
163163
chunks (e.g. Amazon S3's multipart upload API).
164164

165165
```php
166-
use GuzzleHttp\Psr7;
166+
use RingCentral\Psr7;
167167

168168
$original = Psr7\stream_for(fopen('/tmp/test.txt', 'r+'));
169169
echo $original->getSize();
@@ -180,20 +180,20 @@ echo $stream->tell();
180180

181181
## MultipartStream
182182

183-
`GuzzleHttp\Psr7\MultipartStream`
183+
`RingCentral\Psr7\MultipartStream`
184184

185185
Stream that when read returns bytes for a streaming multipart or
186186
multipart/form-data stream.
187187

188188

189189
## NoSeekStream
190190

191-
`GuzzleHttp\Psr7\NoSeekStream`
191+
`RingCentral\Psr7\NoSeekStream`
192192

193193
NoSeekStream wraps a stream and does not allow seeking.
194194

195195
```php
196-
use GuzzleHttp\Psr7;
196+
use RingCentral\Psr7;
197197

198198
$original = Psr7\stream_for('foo');
199199
$noSeek = new Psr7\NoSeekStream($original);
@@ -210,7 +210,7 @@ var_export($noSeek->read(3));
210210

211211
## PumpStream
212212

213-
`GuzzleHttp\Psr7\PumpStream`
213+
`RingCentral\Psr7\PumpStream`
214214

215215
Provides a read only stream that pumps data from a PHP callable.
216216

@@ -225,7 +225,7 @@ false when there is no more data to read.
225225
## Implementing stream decorators
226226

227227
Creating a stream decorator is very easy thanks to the
228-
`GuzzleHttp\Psr7\StreamDecoratorTrait`. This trait provides methods that
228+
`RingCentral\Psr7\StreamDecoratorTrait`. This trait provides methods that
229229
implement `Psr\Http\Message\StreamInterface` by proxying to an underlying
230230
stream. Just `use` the `StreamDecoratorTrait` and implement your custom
231231
methods.
@@ -236,7 +236,7 @@ byte is read from a stream. This could be implemented by overriding the
236236

237237
```php
238238
use Psr\Http\Message\StreamInterface;
239-
use GuzzleHttp\Psr7\StreamDecoratorTrait;
239+
use RingCentral\Psr7\StreamDecoratorTrait;
240240

241241
class EofCallbackStream implements StreamInterface
242242
{
@@ -267,7 +267,7 @@ class EofCallbackStream implements StreamInterface
267267
This decorator could be added to any existing stream and used like so:
268268

269269
```php
270-
use GuzzleHttp\Psr7;
270+
use RingCentral\Psr7;
271271

272272
$original = Psr7\stream_for('foo');
273273

@@ -286,24 +286,24 @@ $eofStream->read(3);
286286

287287
## PHP StreamWrapper
288288

289-
You can use the `GuzzleHttp\Psr7\StreamWrapper` class if you need to use a
289+
You can use the `RingCentral\Psr7\StreamWrapper` class if you need to use a
290290
PSR-7 stream as a PHP stream resource.
291291

292-
Use the `GuzzleHttp\Psr7\StreamWrapper::getResource()` method to create a PHP
292+
Use the `RingCentral\Psr7\StreamWrapper::getResource()` method to create a PHP
293293
stream from a PSR-7 stream.
294294

295295
```php
296-
use GuzzleHttp\Psr7\StreamWrapper;
296+
use RingCentral\Psr7\StreamWrapper;
297297

298-
$stream = GuzzleHttp\Psr7\stream_for('hello!');
298+
$stream = RingCentral\Psr7\stream_for('hello!');
299299
$resource = StreamWrapper::getResource($stream);
300300
echo fread($resource, 6); // outputs hello!
301301
```
302302

303303

304304
# Function API
305305

306-
There are various functions available under the `GuzzleHttp\Psr7` namespace.
306+
There are various functions available under the `RingCentral\Psr7` namespace.
307307

308308

309309
## `function str`
@@ -313,8 +313,8 @@ There are various functions available under the `GuzzleHttp\Psr7` namespace.
313313
Returns the string representation of an HTTP message.
314314

315315
```php
316-
$request = new GuzzleHttp\Psr7\Request('GET', 'http://example.com');
317-
echo GuzzleHttp\Psr7\str($request);
316+
$request = new RingCentral\Psr7\Request('GET', 'http://example.com');
317+
echo RingCentral\Psr7\str($request);
318318
```
319319

320320

@@ -327,8 +327,8 @@ UriInterface for the given value. If the value is already a `UriInterface`, it
327327
is returned as-is.
328328

329329
```php
330-
$uri = GuzzleHttp\Psr7\uri_for('http://example.com');
331-
assert($uri === GuzzleHttp\Psr7\uri_for($uri));
330+
$uri = RingCentral\Psr7\uri_for('http://example.com');
331+
assert($uri === RingCentral\Psr7\uri_for($uri));
332332
```
333333

334334

@@ -367,16 +367,16 @@ This method accepts the following `$resource` types:
367367
buffered and used in subsequent reads.
368368

369369
```php
370-
$stream = GuzzleHttp\Psr7\stream_for('foo');
371-
$stream = GuzzleHttp\Psr7\stream_for(fopen('/path/to/file', 'r'));
370+
$stream = RingCentral\Psr7\stream_for('foo');
371+
$stream = RingCentral\Psr7\stream_for(fopen('/path/to/file', 'r'));
372372

373373
$generator function ($bytes) {
374374
for ($i = 0; $i < $bytes; $i++) {
375375
yield ' ';
376376
}
377377
}
378378

379-
$stream = GuzzleHttp\Psr7\stream_for($generator(100));
379+
$stream = RingCentral\Psr7\stream_for($generator(100));
380380
```
381381

382382

@@ -519,10 +519,10 @@ Maps a file extensions to a mimetype.
519519

520520
# Static URI methods
521521

522-
The `GuzzleHttp\Psr7\Uri` class has several static methods to manipulate URIs.
522+
The `RingCentral\Psr7\Uri` class has several static methods to manipulate URIs.
523523

524524

525-
## `GuzzleHttp\Psr7\Uri::removeDotSegments`
525+
## `RingCentral\Psr7\Uri::removeDotSegments`
526526

527527
`public static function removeDotSegments($path) -> UriInterface`
528528

@@ -531,7 +531,7 @@ Removes dot segments from a path and returns the new path.
531531
See http://tools.ietf.org/html/rfc3986#section-5.2.4
532532

533533

534-
## `GuzzleHttp\Psr7\Uri::resolve`
534+
## `RingCentral\Psr7\Uri::resolve`
535535

536536
`public static function resolve(UriInterface $base, $rel) -> UriInterface`
537537

@@ -540,7 +540,7 @@ Resolve a base URI with a relative URI and return a new URI.
540540
See http://tools.ietf.org/html/rfc3986#section-5
541541

542542

543-
## `GuzzleHttp\Psr7\Uri::withQueryValue`
543+
## `RingCentral\Psr7\Uri::withQueryValue`
544544

545545
`public static function withQueryValue(UriInterface $uri, $key, $value) -> UriInterface`
546546

@@ -552,7 +552,7 @@ removed and replaced with the given key value pair.
552552
Note: this function will convert "=" to "%3D" and "&" to "%26".
553553

554554

555-
## `GuzzleHttp\Psr7\Uri::withoutQueryValue`
555+
## `RingCentral\Psr7\Uri::withoutQueryValue`
556556

557557
`public static function withoutQueryValue(UriInterface $uri, $key, $value) -> UriInterface`
558558

@@ -564,11 +564,11 @@ removed.
564564
Note: this function will convert "=" to "%3D" and "&" to "%26".
565565

566566

567-
## `GuzzleHttp\Psr7\Uri::fromParts`
567+
## `RingCentral\Psr7\Uri::fromParts`
568568

569569
`public static function fromParts(array $parts) -> UriInterface`
570570

571-
Create a `GuzzleHttp\Psr7\Uri` object from a hash of `parse_url` parts.
571+
Create a `RingCentral\Psr7\Uri` object from a hash of `parse_url` parts.
572572

573573

574574
# Not Implemented

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "guzzlehttp/psr7",
2+
"name": "ringcentral/psr7",
33
"type": "library",
44
"description": "PSR-7 message implementation",
55
"keywords": ["message", "stream", "http", "uri"],
@@ -23,7 +23,7 @@
2323
},
2424
"autoload": {
2525
"psr-4": {
26-
"GuzzleHttp\\Psr7\\": "src/"
26+
"RingCentral\\Psr7\\": "src/"
2727
},
2828
"files": ["src/functions_include.php"]
2929
},

src/AppendStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
namespace GuzzleHttp\Psr7;
2+
namespace RingCentral\Psr7;
33

44
use Psr\Http\Message\StreamInterface;
55

src/BufferStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
namespace GuzzleHttp\Psr7;
2+
namespace RingCentral\Psr7;
33

44
use Psr\Http\Message\StreamInterface;
55

src/CachingStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
namespace GuzzleHttp\Psr7;
2+
namespace RingCentral\Psr7;
33

44
use Psr\Http\Message\StreamInterface;
55

src/DroppingStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
namespace GuzzleHttp\Psr7;
2+
namespace RingCentral\Psr7;
33

44
use Psr\Http\Message\StreamInterface;
55

src/FnStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
namespace GuzzleHttp\Psr7;
2+
namespace RingCentral\Psr7;
33

44
use Psr\Http\Message\StreamInterface;
55

src/InflateStream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
namespace GuzzleHttp\Psr7;
2+
namespace RingCentral\Psr7;
33

44
use Psr\Http\Message\StreamInterface;
55

0 commit comments

Comments
 (0)