Skip to content

Commit a6d76de

Browse files
committed
Update license information
1 parent dc797bc commit a6d76de

Some content is hidden

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

49 files changed

+204
-142
lines changed

LICENSE

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Copyright (c) 2010-2014 Pierrick Charron
2-
Copyright (c) 2016-2018 Holger Woltersdorf & Contributors
2+
Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
33

44
Permission is hereby granted, free of charge, to any person obtaining a copy of
55
this software and associated documentation files (the "Software"), to deal in
@@ -22,4 +22,6 @@ SOFTWARE.
2222
Contributors:
2323

2424
* https://github.com/dugwood (Yvan Taviaud)
25-
* https://github.com/rbro
25+
* https://github.com/rbro
26+
* https://github.com/theseer (Arne Blankerts)
27+
* https://github.com/andybee (Andy Buckingham)

bin/exampleWorker.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11
<?php declare(strict_types=1);
2+
/*
3+
* Copyright (c) 2010-2014 Pierrick Charron
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
7+
* this software and associated documentation files (the "Software"), to deal in
8+
* the Software without restriction, including without limitation the rights to
9+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10+
* of the Software, and to permit persons to whom the Software is furnished to do
11+
* so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in all
14+
* copies or substantial portions of the Software.
15+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
* SOFTWARE.
22+
*/
223

324
sleep( (int)($_REQUEST['sleep'] ?? 0) );
425

bin/examples.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types=1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in

bin/fcgiget

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<?php declare(strict_types=1);
33
/*
44
* Copyright (c) 2010-2014 Pierrick Charron
5-
* Copyright (c) 2016-2018 Holger Woltersdorf
5+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
66
*
77
* Permission is hereby granted, free of charge, to any person obtaining a copy of
88
* this software and associated documentation files (the "Software"), to deal in

src/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types=1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in
@@ -183,7 +183,7 @@ public function waitForResponse( int $requestId, ?int $timeoutMs = null ) : void
183183
* @param int|null $timeoutMs
184184
*
185185
* @throws ReadFailedException
186-
* @throws \Throwable
186+
* @throws Throwable
187187
*/
188188
public function waitForResponses( ?int $timeoutMs = null ) : void
189189
{

src/Constants/RequestMethod.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types = 1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in

src/Constants/ServerProtocol.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types = 1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in

src/Encoders/NameValuePairEncoder.php

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types = 1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in
@@ -24,6 +24,9 @@
2424
namespace hollodotme\FastCGI\Encoders;
2525

2626
use hollodotme\FastCGI\Interfaces\EncodesNameValuePair;
27+
use function chr;
28+
use function ord;
29+
use function strlen;
2730

2831
/**
2932
* Class NameValuePairEncoder
@@ -45,34 +48,34 @@ public function encodePairs( array $pairs ) : string
4548

4649
public function encodePair( string $name, string $value ) : string
4750
{
48-
$nameLength = \strlen( $name );
49-
$valueLength = \strlen( $value );
51+
$nameLength = strlen( $name );
52+
$valueLength = strlen( $value );
5053

5154
if ( $nameLength < 128 )
5255
{
5356
/* nameLengthB0 */
54-
$nameValuePair = \chr( $nameLength );
57+
$nameValuePair = chr( $nameLength );
5558
}
5659
else
5760
{
5861
/* nameLengthB3 & nameLengthB2 & nameLengthB1 & nameLengthB0 */
59-
$nameValuePair = \chr( ($nameLength >> 24) | 0x80 )
60-
. \chr( ($nameLength >> 16) & 0xFF )
61-
. \chr( ($nameLength >> 8) & 0xFF )
62-
. \chr( $nameLength & 0xFF );
62+
$nameValuePair = chr( ($nameLength >> 24) | 0x80 )
63+
. chr( ($nameLength >> 16) & 0xFF )
64+
. chr( ($nameLength >> 8) & 0xFF )
65+
. chr( $nameLength & 0xFF );
6366
}
6467
if ( $valueLength < 128 )
6568
{
6669
/* valueLengthB0 */
67-
$nameValuePair .= \chr( $valueLength );
70+
$nameValuePair .= chr( $valueLength );
6871
}
6972
else
7073
{
7174
/* valueLengthB3 & valueLengthB2 & valueLengthB1 & valueLengthB0 */
72-
$nameValuePair .= \chr( ($valueLength >> 24) | 0x80 )
73-
. \chr( ($valueLength >> 16) & 0xFF )
74-
. \chr( ($valueLength >> 8) & 0xFF )
75-
. \chr( $valueLength & 0xFF );
75+
$nameValuePair .= chr( ($valueLength >> 24) | 0x80 )
76+
. chr( ($valueLength >> 16) & 0xFF )
77+
. chr( ($valueLength >> 8) & 0xFF )
78+
. chr( $valueLength & 0xFF );
7679
}
7780

7881
return $nameValuePair . $name . $value;
@@ -84,29 +87,29 @@ public function decodePairs( string $data, int $length = -1 ) : array
8487

8588
if ( $length === -1 )
8689
{
87-
$length = \strlen( $data );
90+
$length = strlen( $data );
8891
}
8992

9093
$p = 0;
9194

9295
while ( $p !== $length )
9396
{
94-
$nameLength = \ord( $data{$p++} );
97+
$nameLength = ord( $data{$p++} );
9598
if ( $nameLength >= 128 )
9699
{
97100
$nameLength &= (0x7F << 24);
98-
$nameLength |= (\ord( $data{$p++} ) << 16);
99-
$nameLength |= (\ord( $data{$p++} ) << 8);
100-
$nameLength |= \ord( $data{$p++} );
101+
$nameLength |= (ord( $data{$p++} ) << 16);
102+
$nameLength |= (ord( $data{$p++} ) << 8);
103+
$nameLength |= ord( $data{$p++} );
101104
}
102105

103-
$valueLength = \ord( $data{$p++} );
106+
$valueLength = ord( $data{$p++} );
104107
if ( $valueLength >= 128 )
105108
{
106109
$valueLength = ($nameLength & 0x7F << 24);
107-
$valueLength |= (\ord( $data{$p++} ) << 16);
108-
$valueLength |= (\ord( $data{$p++} ) << 8);
109-
$valueLength |= \ord( $data{$p++} );
110+
$valueLength |= (ord( $data{$p++} ) << 16);
111+
$valueLength |= (ord( $data{$p++} ) << 8);
112+
$valueLength |= ord( $data{$p++} );
110113
}
111114
$array[ substr( $data, $p, $nameLength ) ] = substr( $data, $p + $nameLength, $valueLength );
112115
$p += ($nameLength + $valueLength);

src/Encoders/PacketEncoder.php

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types = 1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in
@@ -24,6 +24,9 @@
2424
namespace hollodotme\FastCGI\Encoders;
2525

2626
use hollodotme\FastCGI\Interfaces\EncodesPacket;
27+
use function chr;
28+
use function ord;
29+
use function strlen;
2730

2831
/**
2932
* Class PacketEncoder
@@ -35,28 +38,28 @@ final class PacketEncoder implements EncodesPacket
3538

3639
public function encodePacket( int $type, string $content, int $requestId ) : string
3740
{
38-
$contentLength = \strlen( $content );
41+
$contentLength = strlen( $content );
3942

40-
return \chr( self::VERSION ) /* version */
41-
. \chr( $type ) /* type */
42-
. \chr( ($requestId >> 8) & 0xFF ) /* requestIdB1 */
43-
. \chr( $requestId & 0xFF ) /* requestIdB0 */
44-
. \chr( ($contentLength >> 8) & 0xFF ) /* contentLengthB1 */
45-
. \chr( $contentLength & 0xFF ) /* contentLengthB0 */
46-
. \chr( 0 ) /* paddingLength */
47-
. \chr( 0 ) /* reserved */
43+
return chr( self::VERSION ) /* version */
44+
. chr( $type ) /* type */
45+
. chr( ($requestId >> 8) & 0xFF ) /* requestIdB1 */
46+
. chr( $requestId & 0xFF ) /* requestIdB0 */
47+
. chr( ($contentLength >> 8) & 0xFF ) /* contentLengthB1 */
48+
. chr( $contentLength & 0xFF ) /* contentLengthB0 */
49+
. chr( 0 ) /* paddingLength */
50+
. chr( 0 ) /* reserved */
4851
. $content; /* content */
4952
}
5053

5154
public function decodeHeader( string $data ) : array
5255
{
5356
$header = [];
54-
$header['version'] = \ord( $data{0} );
55-
$header['type'] = \ord( $data{1} );
56-
$header['requestId'] = (\ord( $data{2} ) << 8) + \ord( $data{3} );
57-
$header['contentLength'] = (\ord( $data{4} ) << 8) + \ord( $data{5} );
58-
$header['paddingLength'] = \ord( $data{6} );
59-
$header['reserved'] = \ord( $data{7} );
57+
$header['version'] = ord( $data{0} );
58+
$header['type'] = ord( $data{1} );
59+
$header['requestId'] = (ord( $data{2} ) << 8) + ord( $data{3} );
60+
$header['contentLength'] = (ord( $data{4} ) << 8) + ord( $data{5} );
61+
$header['paddingLength'] = ord( $data{6} );
62+
$header['reserved'] = ord( $data{7} );
6063

6164
return $header;
6265
}

src/Exceptions/ConnectException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types = 1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in

src/Exceptions/FastCGIClientException.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types = 1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in
@@ -23,7 +23,9 @@
2323

2424
namespace hollodotme\FastCGI\Exceptions;
2525

26-
class FastCGIClientException extends \Exception
26+
use Exception;
27+
28+
class FastCGIClientException extends Exception
2729
{
2830

2931
}

src/Exceptions/ReadFailedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types = 1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in

src/Exceptions/TimedoutException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types = 1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in

src/Exceptions/WriteFailedException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types = 1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in

src/Interfaces/ConfiguresSocketConnection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types=1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in

src/Interfaces/EncodesNameValuePair.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types=1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in

src/Interfaces/EncodesPacket.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types=1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in

src/Interfaces/ProvidesRequestData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types=1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in

src/Interfaces/ProvidesResponseData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types=1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in

src/Requests/AbstractRequest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php declare(strict_types=1);
22
/*
33
* Copyright (c) 2010-2014 Pierrick Charron
4-
* Copyright (c) 2016-2018 Holger Woltersdorf
4+
* Copyright (c) 2016-2019 Holger Woltersdorf & Contributors
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy of
77
* this software and associated documentation files (the "Software"), to deal in
@@ -25,6 +25,7 @@
2525

2626
use hollodotme\FastCGI\Constants\ServerProtocol;
2727
use hollodotme\FastCGI\Interfaces\ProvidesRequestData;
28+
use function strlen;
2829

2930
/**
3031
* Class AbstractRequest
@@ -177,7 +178,7 @@ public function getContent() : string
177178
public function setContent( string $content ) : void
178179
{
179180
$this->content = $content;
180-
$this->contentLength = \strlen( $content );
181+
$this->contentLength = strlen( $content );
181182
}
182183

183184
public function setCustomVar( string $key, $value ) : void

0 commit comments

Comments
 (0)