[GH-ISSUE #57] New branch for a new release #23

Closed
opened 2026-03-04 23:23:48 +03:00 by kerem · 4 comments
Owner

Originally created by @samuelwilliams on GitHub (Sep 9, 2018).
Original GitHub issue: https://github.com/yswery/PHP-DNS-SERVER/issues/57

I've made a butt-load of changes to the core-code that breaks some existing functionality, so I made a new branch tentatively named "version-1".

The big changes are:

  • The header and resource records are now their own objects as opposed to juggling arrays
  • Implemented the PSR logger interface to the server class
    • You can log to the console with the EchoLogger (issue #25 )
  • Separated the Encoder and Decoder methods from the Server class to their own classes.
  • Expanded the test suite and moved the tests to be within the src directory (this is how most projects do it these days :) (issue #23 )
  • Dropped support for PHP<7.1 (issue #53 )
  • Everything now is PSR-2 compliant (#41 )
  • Normalised the RDATA terms (issue #54 )
Originally created by @samuelwilliams on GitHub (Sep 9, 2018). Original GitHub issue: https://github.com/yswery/PHP-DNS-SERVER/issues/57 I've made a butt-load of changes to the core-code that breaks some existing functionality, so I made a new branch tentatively named "version-1". The big changes are: * The header and resource records are now their own objects as opposed to juggling arrays * Implemented the PSR logger interface to the server class * You can log to the console with the EchoLogger (issue #25 ) * Separated the Encoder and Decoder methods from the Server class to their own classes. * Expanded the test suite and moved the tests to be within the src directory (this is how most projects do it these days :) (issue #23 ) * Dropped support for PHP<7.1 (issue #53 ) * Everything now is PSR-2 compliant (#41 ) * Normalised the RDATA terms (issue #54 )
kerem closed this issue 2026-03-04 23:23:49 +03:00
Author
Owner

@ivanstan commented on GitHub (Sep 9, 2018):

Seems like Server::errorResponse is no longer used? Also class members defaultTtl and packetMaxLength

<!-- gh-comment-id:419707120 --> @ivanstan commented on GitHub (Sep 9, 2018): Seems like Server::errorResponse is no longer used? Also class members defaultTtl and packetMaxLength
Author
Owner

@samuelwilliams commented on GitHub (Sep 11, 2018):

You're right, it is probably worth taking them out. But I am not sure of the packetMaxLength's original purpose, did it have something to do with REACT?

<!-- gh-comment-id:420152435 --> @samuelwilliams commented on GitHub (Sep 11, 2018): You're right, it is probably worth taking them out. But I am not sure of the packetMaxLength's original purpose, did it have something to do with REACT?
Author
Owner

@ivanstan commented on GitHub (Sep 11, 2018):

No, it was used before we introduced react

<!-- gh-comment-id:420193266 --> @ivanstan commented on GitHub (Sep 11, 2018): No, it was used before we introduced react
Author
Owner

@ivanstan commented on GitHub (Sep 11, 2018):

Issue we discussed here https://github.com/yswery/PHP-DNS-SERVER/pull/56 still present on version-1 branch. Looking if I can simulate it in tests.

default:PHP-DNS-SERVER ivanstan$ sudo php example/example.php 
PHP Fatal error:  Uncaught yswery\DNS\UnsupportedTypeException: Record type "OPT" is not a supported type. in /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php:179
Stack trace:
#0 /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php(119): yswery\DNS\Decoder::decodeType(41, '')
#1 /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php(29): yswery\DNS\Decoder::decodeResourceRecords('N|\x01 \x00\x01\x00\x00\x00\x00\x00\x01\x04te...', 37, 1)
#2 /Users/ivanstan/projects/PHP-DNS-SERVER/src/Server.php(100): yswery\DNS\Decoder::decodeMessage('N|\x01 \x00\x01\x00\x00\x00\x00\x00\x01\x04te...')
#3 /Users/ivanstan/projects/PHP-DNS-SERVER/src/Server.php(85): yswery\DNS\Server->handleQueryFromStream('N|\x01 \x00\x01\x00\x00\x00\x00\x00\x01\x04te...')
#4 /Users/ivanstan/projects/PHP-DNS-SERVER/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): yswery\DNS\Server->yswery\DNS\{closure}('N|\x01 \x00\x01\x00\x00\x00\x00\x00\x01\x04te...', '127.0.0.1:59923', Object(React\Datagram\Socket))
#5 /Users/ivanstan/projects/PH in /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php on line 179

Fatal error: Uncaught yswery\DNS\UnsupportedTypeException: Record type "OPT" is not a supported type. in /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php on line 179

yswery\DNS\UnsupportedTypeException: Record type "OPT" is not a supported type. in /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php on line 179

Call Stack:
    0.0004     389768   1. {main}() /Users/ivanstan/projects/PHP-DNS-SERVER/example/example.php:0
    0.0059    1171112   2. yswery\DNS\Server->start() /Users/ivanstan/projects/PHP-DNS-SERVER/example/example.php:17
    0.0242    1613944   3. React\EventLoop\StreamSelectLoop->run() /Users/ivanstan/projects/PHP-DNS-SERVER/src/Server.php:90
    0.0243    1614024   4. React\EventLoop\StreamSelectLoop->waitForStreamActivity() /Users/ivanstan/projects/PHP-DNS-SERVER/vendor/react/event-loop/src/StreamSelectLoop.php:205
    5.4736    1614504   5. React\Datagram\Socket->onReceive() /Users/ivanstan/projects/PHP-DNS-SERVER/vendor/react/event-loop/src/StreamSelectLoop.php:238
    5.4736    1684792   6. React\Datagram\Socket->emit() /Users/ivanstan/projects/PHP-DNS-SERVER/vendor/react/datagram/src/Socket.php:75
    5.4736    1684792   7. yswery\DNS\Server->yswery\DNS\{closure}() /Users/ivanstan/projects/PHP-DNS-SERVER/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123
    5.4736    1684792   8. yswery\DNS\Server->handleQueryFromStream() /Users/ivanstan/projects/PHP-DNS-SERVER/src/Server.php:85
    5.4740    1725080   9. yswery\DNS\Decoder::decodeMessage() /Users/ivanstan/projects/PHP-DNS-SERVER/src/Server.php:100
    5.4748    1779384  10. yswery\DNS\Decoder::decodeResourceRecords() /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php:29
    5.4748    1780048  11. yswery\DNS\Decoder::decodeType() /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php:119
<!-- gh-comment-id:420266560 --> @ivanstan commented on GitHub (Sep 11, 2018): Issue we discussed here https://github.com/yswery/PHP-DNS-SERVER/pull/56 still present on version-1 branch. Looking if I can simulate it in tests. ```bash default:PHP-DNS-SERVER ivanstan$ sudo php example/example.php PHP Fatal error: Uncaught yswery\DNS\UnsupportedTypeException: Record type "OPT" is not a supported type. in /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php:179 Stack trace: #0 /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php(119): yswery\DNS\Decoder::decodeType(41, '') #1 /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php(29): yswery\DNS\Decoder::decodeResourceRecords('N|\x01 \x00\x01\x00\x00\x00\x00\x00\x01\x04te...', 37, 1) #2 /Users/ivanstan/projects/PHP-DNS-SERVER/src/Server.php(100): yswery\DNS\Decoder::decodeMessage('N|\x01 \x00\x01\x00\x00\x00\x00\x00\x01\x04te...') #3 /Users/ivanstan/projects/PHP-DNS-SERVER/src/Server.php(85): yswery\DNS\Server->handleQueryFromStream('N|\x01 \x00\x01\x00\x00\x00\x00\x00\x01\x04te...') #4 /Users/ivanstan/projects/PHP-DNS-SERVER/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): yswery\DNS\Server->yswery\DNS\{closure}('N|\x01 \x00\x01\x00\x00\x00\x00\x00\x01\x04te...', '127.0.0.1:59923', Object(React\Datagram\Socket)) #5 /Users/ivanstan/projects/PH in /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php on line 179 Fatal error: Uncaught yswery\DNS\UnsupportedTypeException: Record type "OPT" is not a supported type. in /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php on line 179 yswery\DNS\UnsupportedTypeException: Record type "OPT" is not a supported type. in /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php on line 179 Call Stack: 0.0004 389768 1. {main}() /Users/ivanstan/projects/PHP-DNS-SERVER/example/example.php:0 0.0059 1171112 2. yswery\DNS\Server->start() /Users/ivanstan/projects/PHP-DNS-SERVER/example/example.php:17 0.0242 1613944 3. React\EventLoop\StreamSelectLoop->run() /Users/ivanstan/projects/PHP-DNS-SERVER/src/Server.php:90 0.0243 1614024 4. React\EventLoop\StreamSelectLoop->waitForStreamActivity() /Users/ivanstan/projects/PHP-DNS-SERVER/vendor/react/event-loop/src/StreamSelectLoop.php:205 5.4736 1614504 5. React\Datagram\Socket->onReceive() /Users/ivanstan/projects/PHP-DNS-SERVER/vendor/react/event-loop/src/StreamSelectLoop.php:238 5.4736 1684792 6. React\Datagram\Socket->emit() /Users/ivanstan/projects/PHP-DNS-SERVER/vendor/react/datagram/src/Socket.php:75 5.4736 1684792 7. yswery\DNS\Server->yswery\DNS\{closure}() /Users/ivanstan/projects/PHP-DNS-SERVER/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php:123 5.4736 1684792 8. yswery\DNS\Server->handleQueryFromStream() /Users/ivanstan/projects/PHP-DNS-SERVER/src/Server.php:85 5.4740 1725080 9. yswery\DNS\Decoder::decodeMessage() /Users/ivanstan/projects/PHP-DNS-SERVER/src/Server.php:100 5.4748 1779384 10. yswery\DNS\Decoder::decodeResourceRecords() /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php:29 5.4748 1780048 11. yswery\DNS\Decoder::decodeType() /Users/ivanstan/projects/PHP-DNS-SERVER/src/Decoder.php:119 ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/PHP-DNS-SERVER#23
No description provided.